34 #ifndef _ConfigFileSection_H__ 35 #define _ConfigFileSection_H__ 68 , additionalComment_(additionalComment)
75 {
return this->
name_; }
79 { this->additionalComment_ = comment; }
89 { this->getOrCreateEntry(name, value, bString)->setValue(value); }
114 {
return this->getOrCreateEntry(name, fallback, bString)->getValue(); }
125 { this->getOrCreateEntry(name, index, value, bString)->setValue(value); }
152 {
return this->getOrCreateEntry(name, index, fallback, bString)->getValue(); }
154 void deleteVectorEntries(
const std::string& name,
unsigned int startindex = 0);
155 unsigned int getVectorSize(
const std::string& name)
const;
162 {
return this->entries_; }
164 {
return this->entries_; }
167 std::list<ConfigFileEntry*>::iterator getOrCreateEntryIterator(
const std::string& name,
unsigned int index,
const std::string& fallback,
bool bString);
178 {
return (*this->getOrCreateEntryIterator(name, fallback, bString)); }
190 {
return (*this->getOrCreateEntryIterator(name, index, fallback, bString)); }
std::string BLANKSTRING
A blank string (""). Used to return a blank string by reference.
Definition: StringUtils.cc:46
const std::string & getOrCreateValue(const std::string &name, const std::string &fallback, bool bString)
Returns the value of a given entry in the section.
Definition: ConfigFileSection.h:113
const std::string & getValue(const std::string &name, bool bString)
Returns the value of a given entry in the section.
Definition: ConfigFileSection.h:96
std::string additionalComment_
The additional comment which is placed after the title of the section in the config file...
Definition: ConfigFileSection.h:193
const std::list< ConfigFileEntry * > & getEntries() const
Definition: ConfigFileSection.h:163
ConfigFileSection(const std::string &name, const std::string &additionalComment="")
Constructor: Initializes the section.
Definition: ConfigFileSection.h:66
std::list< ConfigFileEntry * > entries_
The list of entries in this section.
Definition: ConfigFileSection.h:194
Shared library macros, enums, constants and forward declarations for the core library ...
::std::string string
Definition: gtest-port.h:756
void setValue(const std::string &name, unsigned int index, const std::string &value, bool bString)
Stores the value of an element of a vector in the section.
Definition: ConfigFileSection.h:124
std::list< ConfigFileEntry * > & getEntries()
Returns the list of entries in this section.
Definition: ConfigFileSection.h:161
This class represents a config file, which is stored on the hard-disk and contains config values in d...
Definition: ConfigFile.h:51
void setComment(const std::string &comment)
Changes the comment which is placed after the title of the section in the config file.
Definition: ConfigFileSection.h:78
std::string name_
The name of the section.
Definition: ConfigFileSection.h:192
virtual const std::string & getValue() const =0
Returns the value of the entry.
ConfigFileEntry * getOrCreateEntry(const std::string &name, unsigned int index, const std::string &fallback, bool bString)
Returns the entry that contains an element of a vector with given name.
Definition: ConfigFileSection.h:189
void setValue(const std::string &name, const std::string &value, bool bString)
Stores a value in the section.
Definition: ConfigFileSection.h:88
const std::string & getOrCreateValue(const std::string &name, unsigned int index, const std::string &fallback, bool bString)
Returns the value of a given element of a vector in the section.
Definition: ConfigFileSection.h:151
Child class of ConfigFile, used to store the settings of the game.
Definition: SettingsConfigFile.h:59
Die Wagnis Klasse hat die folgenden Aufgaben:
Definition: ApplicationPaths.cc:66
#define _CoreExport
Definition: CorePrereqs.h:61
bool bUpdated_
True if an entry is created.
Definition: ConfigFileSection.h:195
ARGUMENT_COMPLETION_FUNCTION_IMPLEMENTATION() fallback()
Fallback implementation, returns an empty list.
Definition: ArgumentCompletionFunctions.cc:67
const std::string & getName() const
Returns the name of the section.
Definition: ConfigFileSection.h:74
virtual void setString(bool bString)=0
Defines if this entry is treated as string which means some special treatment of special characters...
Declaration of several string manipulation functions, used in many parts of the game.
Represents a section in a config file.
Definition: ConfigFileSection.h:54
ConfigFileEntry * getOrCreateEntry(const std::string &name, const std::string &fallback, bool bString)
Returns the entry with given name.
Definition: ConfigFileSection.h:177
internal::String name_
Definition: gtest.cc:2289
const std::string & getValue(const std::string &name, unsigned int index, bool bString)
Returns the value of a given element of a vector in the section.
Definition: ConfigFileSection.h:133
This class represents an entry in the config file.
Definition: ConfigFileEntry.h:49