Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members

FX::FXJSONString Class Reference

Serialize a variant to or from JSON formatted string. More...

#include <FXJSONString.h>

Inheritance diagram for FX::FXJSONString:
FX::FXJSON

Public Member Functions

 FXJSONString ()
 Create JSON string i/o object.
 
 FXJSONString (const FXString &string, Direction d=Load)
 Create JSON string i/o object and open it.
 
 FXJSONString (const FXchar *string, FXuval length, Direction d=Load)
 Create JSON i/o object and open it.
 
FXbool open (const FXString &string, Direction d=Load)
 Open JSON string for loading or saving.
 
FXbool open (const FXchar *string, FXuval length, Direction d=Load)
 Open JSON character string of length for direction d.
 
const FXString text () const
 Return string.
 
virtual FXival fill (FXival count)
 Read at least count bytes into buffer; return bytes available, or -1 for error.
 
virtual FXival flush (FXival count)
 Write at least count bytes from buffer; return space available, or -1 for error.
 
FXbool close ()
 Close JSON file and delete buffers.
 
virtual ~FXJSONString ()
 Close JSON file.
 
- Public Member Functions inherited from FX::FXJSON
 FXJSON ()
 Initialize JSON serializer with buffer of size and direction. More...
 
 FXJSON (FXchar *buffer, FXuval sz=8192, Direction d=Load)
 Construct JSON serializer and open for direction d. More...
 
FXbool open (FXchar *buffer=NULL, FXuval sz=8192, Direction d=Load)
 Open JSON parse buffer with given size and direction.
 
Direction direction () const
 Return direction in effect.
 
FXuval size () const
 Return size of parse buffer.
 
FXint getLine () const
 Return current line number.
 
FXint getColumn () const
 Return current column number.
 
FXlong getOffset () const
 Return offset from begin of file.
 
Error load (FXVariant &variant)
 Load a variant from stream. More...
 
Error save (const FXVariant &variant)
 Save a variant to stream. More...
 
void setNumericPrecision (FXint p)
 Floating point output precision control.
 
FXint getNumericPrecision () const
 
void setNumericFormat (FXint f)
 Floating point output precision control.
 
FXint getNumericFormat () const
 
void setOutputFlow (FXint f)
 Change output flow format (Stream, Compact, Pretty). More...
 
FXint getOutputFlow () const
 
void setIndentation (FXint d)
 Change indentation level for pretty print flow, the amount of indentation applied for each level.
 
FXint getIndentation () const
 
void setLineWrap (FXint w)
 Change column at which lines are wrapped.
 
FXint getLineWrap () const
 
void setEscapeMode (FXint e)
 Change string escape mode; 0=don't escape unicode in strings; 1=escape unicode as , 2=escape unicode as . More...
 
FXint getEscapeMode () const
 
FXbool close ()
 Close stream and delete buffer, if owned.
 
virtual ~FXJSON ()
 Close JSON stream and clean up.
 

Additional Inherited Members

- Public Types inherited from FX::FXJSON
enum  Error {
  ErrOK, ErrSave, ErrLoad, ErrToken,
  ErrColon, ErrComma, ErrBracket, ErrBrace,
  ErrQuotes, ErrQuote, ErrNumber, ErrEnd
}
 
enum  Flow { Stream, Compact, Pretty }
 
enum  Direction { Stop = 0, Save = 1, Load = 2 }
 
- Static Public Member Functions inherited from FX::FXJSON
static const FXchar * getError (Error err)
 Returns error code for given error.
 
- Protected Attributes inherited from FX::FXJSON
FXchar * begptr
 
FXchar * endptr
 
FXchar * wptr
 
FXchar * rptr
 
FXchar * sptr
 
FXlong offset
 
FXint column
 
FXint indent
 
FXint line
 
Direction dir
 
FXint token
 
FXint wrap
 
FXuchar flow
 
FXuchar prec
 
FXuchar fmt
 
FXuchar esc
 
FXuchar dent
 

Detailed Description

Serialize a variant to or from JSON formatted string.


The documentation for this class was generated from the following file:

Copyright © 1997-2018 Jeroen van der Zijp