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 FXbool fill ()
 Fill buffer from file. More...
 
virtual FXbool flush ()
 Flush buffer to file. More...
 
virtual FXbool close ()
 Close JSON file and delete buffers.
 
virtual ~FXJSONFile ()
 Close JSON file.
 
- Public Member Functions inherited from FX::FXJSON
 FXJSON ()
 Construct JSON serializer.
 
 FXJSON (FXchar *data, FXuval sz=4096, Direction d=Load)
 Construct JSON serializer and open for direction d. More...
 
FXbool open (FXchar *data=NULL, FXuval size=4096, Direction d=Load)
 Open JSON stream for given direction d. More...
 
Direction direction () const
 Return direction in effect.
 
FXuval size () const
 Return size of parse buffer.
 
Error load (FXVariant &variant)
 Load a variant from stream. More...
 
Error save (const FXVariant &variant)
 Save a variant to stream. More...
 
FXint getLine () const
 Return current line number.
 
FXint getColumn () const
 Return current column number.
 
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
 
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, 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 * sptr
 
FXchar * rptr
 
FXchar * wptr
 
FXint token
 
FXint column
 
FXint indent
 
FXint line
 
FXint wrap
 
Direction dir
 
FXuchar flow
 
FXuchar prec
 
FXuchar fmt
 
FXuchar dent
 
FXbool owns
 

Detailed Description

Serialize a variant to or from JSON formatted file.

Member Function Documentation

◆ fill()

virtual FXbool FX::FXJSONFile::fill ( )
virtual

Fill buffer from file.

Return false if not open for reading, or fail to read from disk.

Reimplemented from FX::FXJSON.

◆ flush()

virtual FXbool FX::FXJSONFile::flush ( )
virtual

Flush buffer to file.

Return false if not open for writing, or if fail to write to disk.

Reimplemented from FX::FXJSON.


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

Copyright © 1997-2018 Jeroen van der Zijp