From f0cd59034ccc57d69fd79014ed3466deeea2c332 Mon Sep 17 00:00:00 2001 From: kwolekr Date: Thu, 4 Dec 2014 03:20:07 -0500 Subject: Settings: Various setting group fixes and enhancements - Remove blank setting values when setting has a group - Pair setting values with groups in file when possible - Preserve user-set whitespace in setting objects - Delete setting value when setting NoiseParams group - Delete overwritten groups outside of lock --- src/settings.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/settings.h') diff --git a/src/settings.h b/src/settings.h index cc7ea365d..6c063e43e 100644 --- a/src/settings.h +++ b/src/settings.h @@ -114,13 +114,20 @@ public: SettingsParseEvent parseConfigObject(const std::string &line, const std::string &end, std::string &name, std::string &value); + void getNamesPresent(std::istream &is, const std::string &end, + std::set &present_values, + std::set &present_groups); bool updateConfigObject(std::istream &is, std::ostream &os, const std::string &end, u32 tab_depth=0); - static std::string getMultiline(std::istream &is); + static std::string getMultiline(std::istream &is, size_t *num_lines=NULL); static std::string sanitizeString(const std::string &value); + static bool printEntry(std::ostream &os, const std::string &name, + const SettingsEntry &entry, u32 tab_depth=0); static void printValue(std::ostream &os, const std::string &name, - const SettingsEntry &entry, bool is_value_multiline, u32 tab_depth=0); + const std::string &value, u32 tab_depth=0); + static void printGroup(std::ostream &os, const std::string &name, + const Settings *group, u32 tab_depth=0); /*********** * Getters * -- cgit v1.2.3