diff options
author | Alyssa Milburn | 2013-04-19 00:20:46 +0200 |
---|---|---|
committer | Alyssa Milburn | 2013-04-19 00:22:07 +0200 |
commit | ace04a92a2d85a330c00f8479fa7b3cf2aad7c4d (patch) | |
tree | fda1040bdc13a6016de4505f715543cd2b0e6e72 /common | |
parent | d7a4a12b67755f258f3d60eadc9f9bd555ad119f (diff) | |
download | scummvm-rg350-ace04a92a2d85a330c00f8479fa7b3cf2aad7c4d.tar.gz scummvm-rg350-ace04a92a2d85a330c00f8479fa7b3cf2aad7c4d.tar.bz2 scummvm-rg350-ace04a92a2d85a330c00f8479fa7b3cf2aad7c4d.zip |
COMMON: Add ConfigFile::addSection function.
Diffstat (limited to 'common')
-rw-r--r-- | common/config-file.cpp | 9 | ||||
-rw-r--r-- | common/config-file.h | 1 |
2 files changed, 10 insertions, 0 deletions
diff --git a/common/config-file.cpp b/common/config-file.cpp index fe042e9eda..0ce6dcf0c8 100644 --- a/common/config-file.cpp +++ b/common/config-file.cpp @@ -226,6 +226,15 @@ bool ConfigFile::saveToStream(WriteStream &stream) { return !stream.err(); } +void ConfigFile::addSection(const String §ion) { + Section *s = getSection(section); + if (s) + return; + + Section newSection; + newSection.name = section; + _sections.push_back(newSection); +} void ConfigFile::removeSection(const String §ion) { assert(isValidName(section)); diff --git a/common/config-file.h b/common/config-file.h index 8bd731c038..8bba851110 100644 --- a/common/config-file.h +++ b/common/config-file.h @@ -106,6 +106,7 @@ public: bool saveToStream(WriteStream &stream); bool hasSection(const String §ion) const; + void addSection(const String §ion); void removeSection(const String §ion); void renameSection(const String &oldName, const String &newName); |