Guitarix
gx_system::JsonWriter Class Reference

#include <gx_json.h>

Inheritance diagram for gx_system::JsonWriter:

Public Member Functions

 JsonWriter (ostream *o=0, bool enable_newlines=true)
 
virtual ~JsonWriter ()
 
void reset ()
 
void set_stream (ostream *o)
 
bool good ()
 
void flush ()
 
virtual void close ()
 
bool is_closed ()
 
void write (float v, bool nl=false)
 
void write (double v, bool nl=false)
 
void write (int i, bool nl=false)
 
void write (unsigned int i, bool nl=false)
 
void write (const char *p, bool nl=false)
 
void write (const string &s, bool nl=false)
 
void write_kv (const char *key, float v)
 
void write_kv (const char *key, double v)
 
void write_kv (const char *key, int i)
 
void write_kv (const char *key, unsigned int i)
 
void write_kv (const char *key, const char *p)
 
void write_kv (const char *key, const std::string &s)
 
void write_lit (const string &s, bool nl=false)
 
void begin_object (bool nl=false)
 
void end_object (bool nl=false)
 
void begin_array (bool nl=false)
 
void end_array (bool nl=false)
 
void write_key (const char *p, bool nl=false)
 
void write_key (const string &p, bool nl=false)
 
void write_null (bool nl=false)
 
void newline ()
 

Detailed Description

Definition at line 54 of file gx_json.h.

Constructor & Destructor Documentation

◆ JsonWriter()

gx_system::JsonWriter::JsonWriter ( ostream *  o = 0,
bool  enable_newlines = true 
)

Definition at line 48 of file gx_json.cpp.

◆ ~JsonWriter()

gx_system::JsonWriter::~JsonWriter ( )
virtual

Definition at line 54 of file gx_json.cpp.

Member Function Documentation

◆ begin_array()

◆ begin_object()

◆ close()

void gx_system::JsonWriter::close ( void  )
virtual

Reimplemented in gx_system::ModifyPreset, gx_system::ModifyState, and gx_system::PresetTransformer.

Definition at line 67 of file gx_json.cpp.

Referenced by ~JsonWriter().

◆ end_array()

◆ end_object()

◆ flush()

void gx_system::JsonWriter::flush ( )

Definition at line 212 of file gx_json.cpp.

Referenced by end_array(), and end_object().

◆ good()

bool gx_system::JsonWriter::good ( )
inline

Definition at line 70 of file gx_json.h.

◆ is_closed()

bool gx_system::JsonWriter::is_closed ( )
inline

Definition at line 73 of file gx_json.h.

Referenced by close().

◆ newline()

void gx_system::JsonWriter::newline ( )
inline

Definition at line 94 of file gx_json.h.

◆ reset()

void gx_system::JsonWriter::reset ( void  )

Definition at line 58 of file gx_json.cpp.

◆ set_stream()

void gx_system::JsonWriter::set_stream ( ostream *  o)
inline

Definition at line 69 of file gx_json.h.

Referenced by gx_system::JsonStringWriter::JsonStringWriter().

◆ write() [1/6]

void gx_system::JsonWriter::write ( const char *  p,
bool  nl = false 
)

Definition at line 145 of file gx_json.cpp.

◆ write() [2/6]

void gx_system::JsonWriter::write ( const string &  s,
bool  nl = false 
)
inline

Definition at line 79 of file gx_json.h.

◆ write() [3/6]

void gx_system::JsonWriter::write ( double  v,
bool  nl = false 
)

Definition at line 121 of file gx_json.cpp.

◆ write() [4/6]

◆ write() [5/6]

void gx_system::JsonWriter::write ( int  i,
bool  nl = false 
)

Definition at line 127 of file gx_json.cpp.

◆ write() [6/6]

void gx_system::JsonWriter::write ( unsigned int  i,
bool  nl = false 
)

Definition at line 133 of file gx_json.cpp.

◆ write_key() [1/2]

◆ write_key() [2/2]

void gx_system::JsonWriter::write_key ( const string &  p,
bool  nl = false 
)

◆ write_kv() [1/6]

void gx_system::JsonWriter::write_kv ( const char *  key,
const char *  p 
)
inline

Definition at line 84 of file gx_json.h.

◆ write_kv() [2/6]

void gx_system::JsonWriter::write_kv ( const char *  key,
const std::string &  s 
)
inline

Definition at line 85 of file gx_json.h.

◆ write_kv() [3/6]

void gx_system::JsonWriter::write_kv ( const char *  key,
double  v 
)
inline

Definition at line 81 of file gx_json.h.

◆ write_kv() [4/6]

◆ write_kv() [5/6]

void gx_system::JsonWriter::write_kv ( const char *  key,
int  i 
)
inline

Definition at line 82 of file gx_json.h.

◆ write_kv() [6/6]

void gx_system::JsonWriter::write_kv ( const char *  key,
unsigned int  i 
)
inline

Definition at line 83 of file gx_json.h.

◆ write_lit()

void gx_system::JsonWriter::write_lit ( const string &  s,
bool  nl = false 
)

Definition at line 139 of file gx_json.cpp.

Referenced by newline().

◆ write_null()

void gx_system::JsonWriter::write_null ( bool  nl = false)
inline

Definition at line 93 of file gx_json.h.

Referenced by write().


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