10#ifndef WX_JSONREADER_H
11#define WX_JSONREADER_H
14#pragma interface "jsonreader.h"
33 wxJSONREADER_STRICT = 0,
34 wxJSONREADER_ALLOW_COMMENTS = 1,
35 wxJSONREADER_STORE_COMMENTS = 2,
36 wxJSONREADER_CASE = 4,
37 wxJSONREADER_MISSING = 8,
38 wxJSONREADER_MULTISTRING = 16,
39 wxJSONREADER_COMMENTS_AFTER = 32,
40 wxJSONREADER_NOUTF8_STREAM = 64,
41 wxJSONREADER_MEMORYBUFF = 128,
43 wxJSONREADER_TOLERANT = wxJSONREADER_ALLOW_COMMENTS | wxJSONREADER_CASE |
44 wxJSONREADER_MISSING | wxJSONREADER_MULTISTRING,
45 wxJSONREADER_COMMENTS_BEFORE =
46 wxJSONREADER_ALLOW_COMMENTS | wxJSONREADER_STORE_COMMENTS
51 wxJSONReader(
int flags = wxJSONREADER_TOLERANT,
int maxErrors = 30);
58 int GetErrorCount()
const;
59 int GetWarningCount()
const;
60 const wxArrayString& GetErrors()
const;
61 const wxArrayString& GetWarnings()
const;
63 static int UTF8NumBytes(
char ch);
65#if defined(wxJSON_64BIT_INT)
66 static bool Strtoll(
const wxString& str, wxInt64* i64);
67 static bool Strtoull(
const wxString& str, wxUint64* ui64);
68 static bool DoStrto_ll(
const wxString& str, wxUint64* ui64, wxChar* sign);
73 void AddError(
const wxString& descr);
74 void AddError(
const wxString& fmt,
const wxString& str);
75 void AddError(
const wxString& fmt, wxChar ch);
76 void AddWarning(
int type,
const wxString& descr);
77 int GetStart(wxInputStream& is);
78 int ReadChar(wxInputStream& is);
79 int PeekChar(wxInputStream& is);
80 void StoreValue(
int ch,
const wxString& key,
wxJSONValue& value,
82 int SkipWhiteSpace(wxInputStream& is);
83 int SkipComment(wxInputStream& is);
85 int ReadString(wxInputStream& is,
wxJSONValue& val);
86 int ReadToken(wxInputStream& is,
int ch, wxString& s);
87 int ReadValue(wxInputStream& is,
int ch,
wxJSONValue& val);
88 int ReadUES(wxInputStream& is,
char* uesBuffer);
89 int AppendUES(wxMemoryBuffer& utf8Buff,
const char* uesBuffer);
90 int NumBytes(
char ch);
91 int ConvertCharByChar(wxString& s,
const wxMemoryBuffer& utf8Buffer);
92 int ReadMemoryBuff(wxInputStream& is,
wxJSONValue& val);
128 wxArrayString m_errors;
131 wxArrayString m_warnings;
The JSON value class implementation.