prepare for multiple and configurable comment separators (e.g. „; comment“ and „# comment“)
--- a/src/lib/INIReader.cpp Thu Nov 26 18:28:27 2020 +0100
+++ b/src/lib/INIReader.cpp Thu Nov 26 18:42:38 2020 +0100
@@ -82,6 +82,16 @@
*/
std::string keyValueSeparators = "=";
+ /**
+ * This might be configurable.
+ *
+ * Classic INI uses „; comment“ syntax.
+ * But many existing files contain „# comment“ lines.
+ *
+ * Only single character separators are supported (works same as keyValueSeparators).
+ */
+ std::string commentSeparators = ";#";
+
int lineNumber = 1;
int eventNumber = 0;
@@ -194,7 +204,7 @@
}
bool isComment(char ch) {
- return ch == '#' || ch == ';';
+ return oneOf(ch, commentSeparators);
}
bool isQuote(char ch) {