Added StringView type (similar to std::string_view)

This commit is contained in:
Twan van Laarhoven
2020-05-21 19:29:42 +02:00
parent 6a299dfe41
commit 1a0e17221b
9 changed files with 153 additions and 106 deletions
+1 -1
View File
@@ -225,7 +225,7 @@ void Reader::readLine(bool in_string) {
}
}
key = canonical_name_form(trim(key));
value = pos == String::npos ? _("") : trim_left(line.substr(pos+1));
value = pos == String::npos ? String() : trim_left(substr(line, pos+1));
if (key.empty() && pos!=String::npos) key = _(" "); // we don't want an empty key if there was a colon
}
+1 -1
View File
@@ -131,7 +131,7 @@ private:
OUTSIDE, ///< We have not entered the block of the current key
ENTERED, ///< We just entered the block of the current key
HANDLED, ///< We have handled a value, and moved to the next line, previous_value is the value we just handled
UNHANDLED, ///< Something has been 'unhandled()'
UNHANDLED, ///< Something has been 'unhandle()-ed'
} state;
/// Should all invalid keys be ignored?
bool ignore_invalid;