1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

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
This commit is contained in:
kwolekr 2014-12-04 03:20:07 -05:00
parent 0a5373d400
commit f0cd59034c
3 changed files with 196 additions and 66 deletions

View file

@ -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<std::string> &present_values,
std::set<std::string> &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 *