11#if !defined(_WX_JSONREADER_H)
12#define _WX_JSONREADER_H
34 wxJSONREADER_STRICT = 0,
35 wxJSONREADER_ALLOW_COMMENTS = 1,
36 wxJSONREADER_STORE_COMMENTS = 2,
37 wxJSONREADER_CASE = 4,
38 wxJSONREADER_MISSING = 8,
39 wxJSONREADER_MULTISTRING = 16,
40 wxJSONREADER_COMMENTS_AFTER = 32,
41 wxJSONREADER_NOUTF8_STREAM = 64,
42 wxJSONREADER_MEMORYBUFF = 128,
44 wxJSONREADER_TOLERANT = wxJSONREADER_ALLOW_COMMENTS | wxJSONREADER_CASE |
45 wxJSONREADER_MISSING | wxJSONREADER_MULTISTRING,
46 wxJSONREADER_COMMENTS_BEFORE =
47 wxJSONREADER_ALLOW_COMMENTS | wxJSONREADER_STORE_COMMENTS
52 wxJSONReader(
int flags = wxJSONREADER_TOLERANT,
int maxErrors = 30);
59 int GetErrorCount()
const;
60 int GetWarningCount()
const;
61 const wxArrayString& GetErrors()
const;
62 const wxArrayString& GetWarnings()
const;
64 static int UTF8NumBytes(
char ch);
66#if defined(wxJSON_64BIT_INT)
67 static bool Strtoll(
const wxString& str, wxInt64* i64);
68 static bool Strtoull(
const wxString& str, wxUint64* ui64);
69 static bool DoStrto_ll(
const wxString& str, wxUint64* ui64, wxChar* sign);
74 void AddError(
const wxString& descr);
75 void AddError(
const wxString& fmt,
const wxString& str);
76 void AddError(
const wxString& fmt, wxChar ch);
77 void AddWarning(
int type,
const wxString& descr);
78 int GetStart(wxInputStream& is);
79 int ReadChar(wxInputStream& is);
80 int PeekChar(wxInputStream& is);
81 void StoreValue(
int ch,
const wxString& key,
wxJSONValue& value,
83 int SkipWhiteSpace(wxInputStream& is);
84 int SkipComment(wxInputStream& is);
86 int ReadString(wxInputStream& is,
wxJSONValue& val);
87 int ReadToken(wxInputStream& is,
int ch, wxString& s);
88 int ReadValue(wxInputStream& is,
int ch,
wxJSONValue& val);
89 int ReadUES(wxInputStream& is,
char* uesBuffer);
90 int AppendUES(wxMemoryBuffer& utf8Buff,
const char* uesBuffer);
91 int NumBytes(
char ch);
92 int ConvertCharByChar(wxString& s,
const wxMemoryBuffer& utf8Buffer);
93 int ReadMemoryBuff(wxInputStream& is,
wxJSONValue& val);
int m_colNo
The current column number (start at 1).
int m_maxErrors
Maximum number of errors stored in the error's array.
bool m_noUtf8
ANSI: do not convert UTF-8 strings.
wxJSONValue * m_lastStored
The pointer to the value object that was last stored.
int m_flags
Flag that control the parser behaviour,.
int m_lineNo
The current line number (start at 1).
int m_commentLine
The starting line of the comment string.
int m_depth
The depth level of the read JSON text.
wxJSONValue * m_current
The pointer to the value object that is being read.
int m_level
The current level of object/array annidation (start at ZERO).
wxArrayString m_errors
The array of error messages.
wxArrayString m_warnings
The array of warning messages.
wxJSONValue * m_next
The pointer to the value object that will be read.
wxString m_comment
The comment string read by SkipComment().
int m_peekChar
The character read by the PeekChar() function (-1 none)
The JSON value class implementation.