24 #ifndef FXPARSEBUFFER_H 25 #include "FXParseBuffer.h" 146 static const FXchar *
const errors[];
148 virtual Token next();
151 static Token identoken(
const FXString& str);
152 Error loadMap(FXVariant& var);
153 Error loadArray(FXVariant& var);
154 Error loadVariant(FXVariant& var);
155 Error saveString(
const FXString& str);
156 Error saveIdent(
const FXString& str);
157 Error saveMap(
const FXVariant& var);
158 Error saveArray(
const FXVariant& var);
159 Error saveVariant(
const FXVariant& var);
161 FXJSON(
const FXJSON&);
162 FXJSON &operator=(
const FXJSON&);
174 FXJSON(FXchar* buffer,FXuval sz=8192,Direction d=Load);
180 FXbool open(FXchar* buffer=
nullptr,FXuval sz=8192,Direction d=Load);
207 virtual Error save(
const FXVariant& variant);
220 FXuchar getNumericPrecision()
const {
return prec; }
233 FXuchar getNumericFormat()
const {
return fmt; }
245 FXuchar getOutputFlow()
const {
return flow; }
252 FXuchar getIndentation()
const {
return dent; }
258 FXint getLineWrap()
const {
return wrap; }
271 FXuchar getEscapeMode()
const {
return esc; }
277 FXuchar getVersion()
const {
return ver; }
283 FXchar getQuote()
const {
return quote; }
A Variant type can hold any kind of object, be it a boolean, integer, real, string, or even array of Variants or dictionaries of variants.
Definition: FXVariant.h:44
No errors.
Definition: FXJSON.h:86
Flow
JSON serializer flow modes.
Definition: FXJSON.h:102
void setVersion(FXuchar v)
Change json version.
Definition: FXJSON.h:276
void setNumericPrecision(FXuchar p)
Floating point output precision control.
Definition: FXJSON.h:219
Expected closing bracket.
Definition: FXJSON.h:92
Expected closing quotes.
Definition: FXJSON.h:94
void setNumericFormat(FXuchar f)
Floating point output format control.
Definition: FXJSON.h:232
void setLineWrap(FXint w)
Change column at which lines are wrapped.
Definition: FXJSON.h:257
Illegal token.
Definition: FXJSON.h:89
FXint getColumn() const
Return current column number.
Definition: FXJSON.h:190
void setQuote(FXchar q)
Change quote type, either (') or (").
Definition: FXJSON.h:282
Unable to save.
Definition: FXJSON.h:87
The FXJSON serializer loads or saves an FXVariant to a JSON text file.
Definition: FXJSON.h:80
FXint getLine() const
Return current line number.
Definition: FXJSON.h:185
static const FXchar * getError(Error err)
Returns error for given error code.
Definition: FXJSON.h:212
Expected closing brace.
Definition: FXJSON.h:93
void setEscapeMode(FXuchar e)
Change string escape mode.
Definition: FXJSON.h:270
Unexpected identifier.
Definition: FXJSON.h:97
Definition: FX4Splitter.h:28
Stream-of-consciousness output.
Definition: FXJSON.h:104
Unable to load.
Definition: FXJSON.h:88
Error
JSON deserializer error codes.
Definition: FXJSON.h:84
Expected colon ':'.
Definition: FXJSON.h:90
FXParseBuffer manages pointers to a buffer for various file format parsers.
Definition: FXParseBuffer.h:34
void setOutputFlow(FXuchar f)
Change output flow format (Stream, Compact, Pretty).
Definition: FXJSON.h:244
Numeric conversion.
Definition: FXJSON.h:96
FXlong getOffset() const
Return offset from begin of file.
Definition: FXJSON.h:195
void setIndentation(FXuchar d)
Change indentation level for pretty print flow, the amount of indentation applied for each level...
Definition: FXJSON.h:251
Expected comma ','.
Definition: FXJSON.h:91
Expected closing quote.
Definition: FXJSON.h:95