From b4d0a8ba66e2c99949d1fa14d801c7de77db76ba Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Sat, 26 Jan 2013 19:33:27 +0100 Subject: JANITORIAL: Enforce "} // End of namespace" with a single space after }. --- common/config-file.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'common/config-file.cpp') diff --git a/common/config-file.cpp b/common/config-file.cpp index 4224d7491d..fe042e9eda 100644 --- a/common/config-file.cpp +++ b/common/config-file.cpp @@ -380,4 +380,4 @@ void ConfigFile::Section::removeKey(const String &key) { } } -} // End of namespace Common +} // End of namespace Common -- cgit v1.2.3 From ace04a92a2d85a330c00f8479fa7b3cf2aad7c4d Mon Sep 17 00:00:00 2001 From: Alyssa Milburn Date: Fri, 19 Apr 2013 00:20:46 +0200 Subject: COMMON: Add ConfigFile::addSection function. --- common/config-file.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'common/config-file.cpp') 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)); -- cgit v1.2.3