|
|
|
@ -60,15 +60,6 @@ public:
|
|
|
|
|
SpaceParser();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
setting options of the parser to the default values
|
|
|
|
|
utf8 etc.
|
|
|
|
|
*/
|
|
|
|
|
void SetDefault();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
status of parsing
|
|
|
|
|
*/
|
|
|
|
@ -133,33 +124,16 @@ public:
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
if true then empty values and lists, e.g:
|
|
|
|
|
option =
|
|
|
|
|
option2 = ()
|
|
|
|
|
will be omitted (not inserted to 'table')
|
|
|
|
|
default: false
|
|
|
|
|
*/
|
|
|
|
|
void SkipEmpty(bool skip);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
'\' character is used to escape other characters in a quoted string
|
|
|
|
|
so "some \t t\"ext" will produce "some t t"ext"
|
|
|
|
|
default: true
|
|
|
|
|
*/
|
|
|
|
|
void UseEscapeChar(bool escape);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
if true then the input file or string (char* or std::string) is treated as UTF-8
|
|
|
|
|
default true
|
|
|
|
|
|
|
|
|
|
the internal storage for strings is std::wstring so if you call UTF8(false) then
|
|
|
|
|
the characters of input string will be simple static_cast<> from char to wchar_t
|
|
|
|
|
*/
|
|
|
|
|
// rename to use_utf8(bool)
|
|
|
|
|
void UTF8(bool utf);
|
|
|
|
|
* if true then the input file or string (char* or std::string) is treated as UTF-8
|
|
|
|
|
* default true
|
|
|
|
|
*
|
|
|
|
|
* the internal storage for strings is std::wstring so if you call set_utf8(false) then
|
|
|
|
|
* the characters of input string will be simple static_cast<> from char to wchar_t
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
void use_utf8(bool utf);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
@ -271,16 +245,6 @@ private:
|
|
|
|
|
std::ifstream file;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
if true then empty lists, e.g:
|
|
|
|
|
option =
|
|
|
|
|
option2 = ()
|
|
|
|
|
will be omitted (not inserted to 'table')
|
|
|
|
|
default: false
|
|
|
|
|
*/
|
|
|
|
|
bool skip_empty;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
input file is in UTF-8
|
|
|
|
|
default: true
|
|
|
|
@ -289,17 +253,8 @@ private:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
if true you can use an escape character '\' in quoted values
|
|
|
|
|
*/
|
|
|
|
|
bool use_escape_char;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
*
|
|
|
|
|
* if parsing_space is false then it means we are parsing JSON format
|
|
|
|
|
*
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
bool parsing_space;
|
|
|
|
|
|
|
|
|
@ -347,7 +302,6 @@ private:
|
|
|
|
|
void SkipLine();
|
|
|
|
|
void SkipWhite();
|
|
|
|
|
void TrimLastWhite(std::wstring & s);
|
|
|
|
|
//void Trim(std::wstring & s);
|
|
|
|
|
bool IsHexDigit(wchar_t c);
|
|
|
|
|
int HexToInt(wchar_t c);
|
|
|
|
|
void ReadUnicodeCodePoint();
|
|
|
|
|