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

FX::FXJSONFile Class Reference

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

#include <FXJSONFile.h>

Inheritance diagram for FX::FXJSONFile:
FX::FXJSON

Public Member Functions

 FXJSONFile ()
 Create JSON file i/o object.
 
 FXJSONFile (const FXString &filename, Direction d=Load, FXuval sz=4096)
 Create JSON file i/o object and open it.
 
FXbool open (FXInputHandle h, Direction d=Load, FXuval sz=4096)
 Open JSON file from given handle for direction d.
 
FXbool open (const FXString &filename, Direction d=Load, FXuval sz=4096)
 Open JSON file for direction d.
 
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 ~FXJSONFile ()
 Close JSON file.
 
- Public Member Functions inherited from FX::FXJSON
 FXJSON ()
 Initialize JSON serializer with no buffer.
 
 FXJSON (FXchar *buffer, FXuval sz=8192, Direction d=Load)
 Construct JSON serializer with given buffer of size, and open it for direction d.
 
FXbool open (FXchar *buffer=NULL, FXuval sz=8192, Direction d=Load)
 Open JSON parse buffer with 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 JSON stream. More...
 
Error save (const FXVariant &variant)
 Save a variant to JSON stream. More...
 
void setNumericPrecision (FXint p)
 Floating point output precision control. More...
 
FXint getNumericPrecision () const
 
void setNumericFormat (FXint f)
 Floating point output format control. More...
 
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. 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 file.


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

Copyright © 1997-2020 Jeroen van der Zijp