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