string &value) const
{
string section = _section;
- while (!find(section, entry, value)) {
- if (!find(section, "default", section))
+ while (!findAppend(section, entry, value)) {
+ if (!find(section, "default", section)) {
return false;
+ }
}
return true;
}
+bool
+IniFile::findAppend(const string &_section, const string &entry,
+ string &value) const
+{
+ string section = _section;
+ bool ret = false;
+ bool first = true;
+
+ do {
+ string val;
+ if (find(section, entry, val)) {
+ ret = true;
+ if (first) {
+ value = val;
+ first = false;
+ } else {
+ value += " ";
+ value += val;
+ }
+
+ }
+ } while (find(section, "append", section));
+
+ return ret;
+}
bool
IniFile::Section::printUnreferenced(const string §ionName)
bool findDefault(const std::string §ion, const std::string &entry,
std::string &value) const;
+ bool findAppend(const std::string §ion, const std::string &entry,
+ std::string &value) const;
+
/// Print unreferenced entries in object. Iteratively calls
/// printUnreferend() on all the constituent sections.
bool printUnreferenced();