make methods const
This commit is contained in:
parent
f159952090
commit
a59e0b7478
|
@ -24,14 +24,14 @@ void IniFile::parse(std::istream &inputStream)
|
||||||
value.reserve(256);
|
value.reserve(256);
|
||||||
// define actions for state machine
|
// define actions for state machine
|
||||||
// called when key/value pair is complete
|
// called when key/value pair is complete
|
||||||
auto finishKeyValue = [&scope, &key, &value, &whitespace, this] {
|
const auto finishKeyValue = [&scope, &key, &value, &whitespace, this] {
|
||||||
m_data[scope].insert(make_pair(key, value));
|
m_data[scope].insert(make_pair(key, value));
|
||||||
key.clear();
|
key.clear();
|
||||||
value.clear();
|
value.clear();
|
||||||
whitespace = 0;
|
whitespace = 0;
|
||||||
};
|
};
|
||||||
// called to add current character to current key or value
|
// called to add current character to current key or value
|
||||||
auto addChar = [&whitespace, &c] (string &to) {
|
const auto addChar = [&whitespace, &c] (string &to) {
|
||||||
if(c == ' ') {
|
if(c == ' ') {
|
||||||
++whitespace;
|
++whitespace;
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue