hey
This commit is contained in:
parent
8849d1b66c
commit
5efd728e9b
@ -73,23 +73,24 @@ void ConfigBuilder::parseFile(const string& fname) {
|
|||||||
internalValues[fullKey] = value;
|
internalValues[fullKey] = value;
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
|
listIndex = 0;
|
||||||
|
|
||||||
match = line.find(':');
|
match = line.find(':');
|
||||||
if (match == string::npos)throw config_error("Line "+ to_string(lineno)+" invalid : |"+line+"|");
|
if (match == string::npos)throw config_error("Line "+ to_string(lineno)+" invalid : |"+line+"|");
|
||||||
string key = line.substr(0, match);
|
string localKey = line.substr(0, match);
|
||||||
string value = line.substr(match + 1);
|
string value = line.substr(match + 1);
|
||||||
trimSpaces(key);
|
trimSpaces(localKey);
|
||||||
sanitizeValue(value);
|
sanitizeValue(value);
|
||||||
if (value.empty()) {
|
if (value.empty()) {
|
||||||
keyParts.resize(currentIndent);
|
keyParts.resize(currentIndent);
|
||||||
keyParts.push_back(key);
|
keyParts.push_back(localKey);
|
||||||
listIndex = 0;
|
|
||||||
} else {
|
} else {
|
||||||
string fullKey;
|
string fullKey;
|
||||||
for (unsigned i = 0; i < currentIndent; ++i) {
|
for (unsigned i = 0; i < currentIndent; ++i) {
|
||||||
fullKey.append(keyParts[i]);
|
fullKey.append(keyParts[i]);
|
||||||
fullKey.append(".");
|
fullKey.append(".");
|
||||||
}
|
}
|
||||||
fullKey.append(key);
|
fullKey.append(localKey);
|
||||||
internalValues[fullKey] = value;
|
internalValues[fullKey] = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user