# HG changeset patch # User František Kučera # Date 1606413169 -3600 # Node ID 29d673a54ecf5ba7506ed9b4209fc313f1cd231a # Parent b35baebf5005cc780c76f912fb81217c231f0892 prepare for multiple and configurable quotes (e.g. „key="value"“ and „key='value'“ or disabling quote support at all) diff -r b35baebf5005 -r 29d673a54ecf src/lib/INIReader.cpp --- a/src/lib/INIReader.cpp Thu Nov 26 18:42:38 2020 +0100 +++ b/src/lib/INIReader.cpp Thu Nov 26 18:52:49 2020 +0100 @@ -92,6 +92,19 @@ */ std::string commentSeparators = ";#"; + /** + * This might be configurable. + * + * INI often support both "quotes" and 'apostrophes' styles. + * But some dialects may support only one of them or not support quoting at all. + * + * In such case e.g. „key="some value"“ would mean that the value is „"value"“ (including the quotes). + * Thus it is important to allow disabling quote recognizing (which is done by setting this parameter to empty string). + * + * Only single character quotes are supported (works same as keyValueSeparators). + */ + std::string quotes = "\"'"; + int lineNumber = 1; int eventNumber = 0; @@ -208,7 +221,7 @@ } bool isQuote(char ch) { - return ch == '"' || ch == '\''; + return oneOf(ch, quotes); } /**