11#if !defined(_WX_JSONREADER_H)
12#define _WX_JSONREADER_H
15#pragma interface "jsonreader.h"
38 wxJSONREADER_STRICT = 0,
39 wxJSONREADER_ALLOW_COMMENTS = 1,
40 wxJSONREADER_STORE_COMMENTS = 2,
41 wxJSONREADER_CASE = 4,
42 wxJSONREADER_MISSING = 8,
43 wxJSONREADER_MULTISTRING = 16,
44 wxJSONREADER_COMMENTS_AFTER = 32,
45 wxJSONREADER_NOUTF8_STREAM = 64,
46 wxJSONREADER_MEMORYBUFF = 128,
48 wxJSONREADER_TOLERANT = wxJSONREADER_ALLOW_COMMENTS | wxJSONREADER_CASE |
49 wxJSONREADER_MISSING | wxJSONREADER_MULTISTRING,
50 wxJSONREADER_COMMENTS_BEFORE =
51 wxJSONREADER_ALLOW_COMMENTS | wxJSONREADER_STORE_COMMENTS
56 wxJSONReader(
int flags = wxJSONREADER_TOLERANT,
int maxErrors = 30);
63 int GetErrorCount()
const;
64 int GetWarningCount()
const;
65 const wxArrayString& GetErrors()
const;
66 const wxArrayString& GetWarnings()
const;
68 static int UTF8NumBytes(
char ch);
70#if defined(wxJSON_64BIT_INT)
71 static bool Strtoll(
const wxString& str, wxInt64* i64);
72 static bool Strtoull(
const wxString& str, wxUint64* ui64);
73 static bool DoStrto_ll(
const wxString& str, wxUint64* ui64, wxChar* sign);
78 void AddError(
const wxString& descr);
79 void AddError(
const wxString& fmt,
const wxString& str);
80 void AddError(
const wxString& fmt, wxChar ch);
81 void AddWarning(
int type,
const wxString& descr);
82 int GetStart(wxInputStream& is);
83 int ReadChar(wxInputStream& is);
84 int PeekChar(wxInputStream& is);
85 void StoreValue(
int ch,
const wxString& key,
wxJSONValue& value,
87 int SkipWhiteSpace(wxInputStream& is);
88 int SkipComment(wxInputStream& is);
90 int ReadString(wxInputStream& is,
wxJSONValue& val);
91 int ReadToken(wxInputStream& is,
int ch, wxString& s);
92 int ReadValue(wxInputStream& is,
int ch,
wxJSONValue& val);
93 int ReadUES(wxInputStream& is,
char* uesBuffer);
94 int AppendUES(wxMemoryBuffer& utf8Buff,
const char* uesBuffer);
95 int NumBytes(
char ch);
96 int ConvertCharByChar(wxString& s,
const wxMemoryBuffer& utf8Buffer);
97 int ReadMemoryBuff(wxInputStream& is,
wxJSONValue& val);
133 wxArrayString m_errors;
136 wxArrayString m_warnings;
The JSON value class implementation.