aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--common/config-file.cpp9
-rw-r--r--common/config-file.h1
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 &section) {
+ Section *s = getSection(section);
+ if (s)
+ return;
+
+ Section newSection;
+ newSection.name = section;
+ _sections.push_back(newSection);
+}
void ConfigFile::removeSection(const String &section) {
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 &section) const;
+ void addSection(const String &section);
void removeSection(const String &section);
void renameSection(const String &oldName, const String &newName);