src/lib/INIReader.cpp
branchv_0
changeset 22 29d673a54ecf
parent 21 b35baebf5005
child 23 b497140b0b63
equal deleted inserted replaced
21:b35baebf5005 22:29d673a54ecf
    90 	 * 
    90 	 * 
    91 	 * Only single character separators are supported (works same as keyValueSeparators).
    91 	 * Only single character separators are supported (works same as keyValueSeparators).
    92 	 */
    92 	 */
    93 	std::string commentSeparators = ";#";
    93 	std::string commentSeparators = ";#";
    94 
    94 
       
    95 	/**
       
    96 	 * This might be configurable.
       
    97 	 * 
       
    98 	 * INI often support both "quotes" and 'apostrophes' styles.
       
    99 	 * But some dialects may support only one of them or not support quoting at all.
       
   100 	 * 
       
   101 	 * In such case e.g. „key="some value"“ would mean that the value is „"value"“ (including the quotes).
       
   102 	 * Thus it is important to allow disabling quote recognizing (which is done by setting this parameter to empty string).
       
   103 	 * 
       
   104 	 * Only single character quotes are supported (works same as keyValueSeparators).
       
   105 	 */
       
   106 	std::string quotes = "\"'";
       
   107 
    95 	int lineNumber = 1;
   108 	int lineNumber = 1;
    96 	int eventNumber = 0;
   109 	int eventNumber = 0;
    97 
   110 
    98 	/**
   111 	/**
    99 	 * Should be always used instead of input.peek().
   112 	 * Should be always used instead of input.peek().
   206 	bool isComment(char ch) {
   219 	bool isComment(char ch) {
   207 		return oneOf(ch, commentSeparators);
   220 		return oneOf(ch, commentSeparators);
   208 	}
   221 	}
   209 
   222 
   210 	bool isQuote(char ch) {
   223 	bool isQuote(char ch) {
   211 		return ch == '"' || ch == '\'';
   224 		return oneOf(ch, quotes);
   212 	}
   225 	}
   213 
   226 
   214 	/**
   227 	/**
   215 	 * @param ch character to be evaluated
   228 	 * @param ch character to be evaluated
   216 	 * @param options list of options (characters)
   229 	 * @param options list of options (characters)