11 #if !defined( _WX_JSONWRITER_H )
12 #define _WX_JSONWRITER_H
15 #pragma interface "jsonwriter.h"
19 #include "wx/wxprec.h"
28 #include <wx/stream.h>
29 #include <wx/string.h>
32 #include "json_defs.h"
36 wxJSONWRITER_NONE = 0,
37 wxJSONWRITER_STYLED = 1,
38 wxJSONWRITER_WRITE_COMMENTS = 2,
39 wxJSONWRITER_COMMENTS_BEFORE = 4,
40 wxJSONWRITER_COMMENTS_AFTER = 8,
41 wxJSONWRITER_SPLIT_STRING = 16,
42 wxJSONWRITER_NO_LINEFEEDS = 32,
43 wxJSONWRITER_ESCAPE_SOLIDUS = 64,
44 wxJSONWRITER_MULTILINE_STRING = 128,
45 wxJSONWRITER_RECOGNIZE_UNSIGNED = 256,
46 wxJSONWRITER_TAB_INDENT = 512,
47 wxJSONWRITER_NO_INDENTATION = 1024,
48 wxJSONWRITER_NOUTF8_STREAM = 2048,
49 wxJSONWRITER_MEMORYBUFF = 4096
57 wxJSONWriter(
int style = wxJSONWRITER_STYLED,
int indent = 0,
int step = 3 );
60 void Write(
const wxJSONValue& value, wxString& str );
61 void Write(
const wxJSONValue& value, wxOutputStream& os );
62 void SetDoubleFmtString(
const char* fmt );
66 int DoWrite( wxOutputStream& os,
const wxJSONValue& value,
const wxString* key,
bool comma );
67 int WriteIndent( wxOutputStream& os );
68 int WriteIndent( wxOutputStream& os,
int num );
69 bool IsSpace( wxChar ch );
70 bool IsPunctuation( wxChar ch );
72 int WriteString( wxOutputStream& os,
const wxString& str );
73 int WriteStringValue( wxOutputStream& os,
const wxString& str );
74 int WriteNullValue( wxOutputStream& os );
75 int WriteIntValue( wxOutputStream& os,
const wxJSONValue& v );
76 int WriteUIntValue( wxOutputStream& os,
const wxJSONValue& v );
77 int WriteBoolValue( wxOutputStream& os,
const wxJSONValue& v );
78 int WriteDoubleValue( wxOutputStream& os,
const wxJSONValue& v );
79 int WriteMemoryBuff( wxOutputStream& os,
const wxMemoryBuffer& buff );
81 int WriteInvalid( wxOutputStream& os );
82 int WriteSeparator( wxOutputStream& os );
84 int WriteKey( wxOutputStream& os,
const wxString& key );
85 int WriteComment( wxOutputStream& os,
const wxJSONValue& value,
bool indent );
87 int WriteError(
const wxString& err );
116 #endif // not defined _WX_JSONWRITER_H
The JSON value class implementation.
Definition: jsonval.h:91
The JSON document writer.
Definition: jsonwriter.h:54