src/lib/INIReader.cpp
branchv_0
changeset 21 b35baebf5005
parent 20 9187f0439ca9
child 22 29d673a54ecf
equal deleted inserted replaced
20:9187f0439ca9 21:b35baebf5005
    80 	 * If multiple separators should be recognized (e.g. both „=“ and „:“), this string will contain all of them,
    80 	 * If multiple separators should be recognized (e.g. both „=“ and „:“), this string will contain all of them,
    81 	 * i.e. „:=“ does not mean that the „key:=value“ syntax, but „key=value“ or „key:value“.
    81 	 * i.e. „:=“ does not mean that the „key:=value“ syntax, but „key=value“ or „key:value“.
    82 	 */
    82 	 */
    83 	std::string keyValueSeparators = "=";
    83 	std::string keyValueSeparators = "=";
    84 
    84 
       
    85 	/**
       
    86 	 * This might be configurable.
       
    87 	 * 
       
    88 	 * Classic INI uses „; comment“ syntax.
       
    89 	 * But many existing files contain „# comment“ lines.
       
    90 	 * 
       
    91 	 * Only single character separators are supported (works same as keyValueSeparators).
       
    92 	 */
       
    93 	std::string commentSeparators = ";#";
       
    94 
    85 	int lineNumber = 1;
    95 	int lineNumber = 1;
    86 	int eventNumber = 0;
    96 	int eventNumber = 0;
    87 
    97 
    88 	/**
    98 	/**
    89 	 * Should be always used instead of input.peek().
    99 	 * Should be always used instead of input.peek().
   192 		}
   202 		}
   193 		return result;
   203 		return result;
   194 	}
   204 	}
   195 
   205 
   196 	bool isComment(char ch) {
   206 	bool isComment(char ch) {
   197 		return ch == '#' || ch == ';';
   207 		return oneOf(ch, commentSeparators);
   198 	}
   208 	}
   199 
   209 
   200 	bool isQuote(char ch) {
   210 	bool isQuote(char ch) {
   201 		return ch == '"' || ch == '\'';
   211 		return ch == '"' || ch == '\'';
   202 	}
   212 	}