w32tex
About: TeX Live provides a comprehensive TeX system including all the major TeX-related programs, macro packages, and fonts that are free software. Windows sources.
  Fossies Dox: w32tex-src.tar.xz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

graphite2::json Class Reference

#include <json.h>

Classes

class  closer
 

Public Types

enum class  integer : std::intmax_t
 
enum class  integer_u : std::uintmax_t
 
enum class  integer : std::intmax_t
 
enum class  integer_u : std::uintmax_t
 
using string = const char *
 
using number = double
 
using boolean = bool
 
using string = const char *
 
using number = double
 
using boolean = bool
 

Public Member Functions

void setenv (unsigned int index, void *val)
 
voidgetenv (unsigned int index) const
 
const Vector< void * > & getenvs () const
 
 json (FILE *stream) throw ()
 
 ~json () throw ()
 
FILEstream () const throw ()
 
jsonoperator<< (string) throw ()
 
jsonoperator<< (number) throw ()
 
jsonoperator<< (integer) throw ()
 
jsonoperator<< (integer_u) throw ()
 
jsonoperator<< (boolean) throw ()
 
jsonoperator<< (std::nullptr_t) throw ()
 
jsonoperator<< (_context_t) throw ()
 
 operator bool () const throw ()
 
bool good () const throw ()
 
bool eof () const throw ()
 
void setenv (unsigned int index, void *val)
 
voidgetenv (unsigned int index) const
 
const Vector< void * > & getenvs () const
 
 json (FILE *stream) throw ()
 
 ~json () throw ()
 
FILEstream () const throw ()
 
jsonoperator<< (string) throw ()
 
jsonoperator<< (number) throw ()
 
jsonoperator<< (integer) throw ()
 
jsonoperator<< (integer_u) throw ()
 
jsonoperator<< (boolean) throw ()
 
jsonoperator<< (std::nullptr_t) throw ()
 
jsonoperator<< (_context_t) throw ()
 
 operator bool () const throw ()
 
bool good () const throw ()
 
bool eof () const throw ()
 

Static Public Member Functions

static void flat (json &) throw ()
 
static void close (json &) throw ()
 
static void object (json &) throw ()
 
static void array (json &) throw ()
 
static void item (json &) throw ()
 
static void flat (json &) throw ()
 
static void close (json &) throw ()
 
static void object (json &) throw ()
 
static void array (json &) throw ()
 
static void item (json &) throw ()
 

Public Attributes

 CLASS_NEW_DELETE
 

Static Public Attributes

static const std::nullptr_t null = nullptr
 

Private Types

typedef void(* _context_t) (json &)
 
typedef void(* _context_t) (json &)
 

Private Member Functions

 json (const json &)
 
jsonoperator= (const json &)
 
void context (const char current) throw ()
 
void indent (const int d=0) throw ()
 
void push_context (const char, const char) throw ()
 
void pop_context () throw ()
 
 json (const json &)
 
jsonoperator= (const json &)
 
void context (const char current) throw ()
 
void indent (const int d=0) throw ()
 
void push_context (const char, const char) throw ()
 
void pop_context () throw ()
 

Private Attributes

FILE *const _stream
 
char _contexts [128]
 
char * _context
 
char * _flatten
 
Vector< void * > _env
 

Detailed Description

Definition at line 41 of file json.h.

Member Typedef Documentation

◆ _context_t [1/2]

typedef void(* graphite2::json::_context_t) (json &)
private

Definition at line 47 of file json.h.

◆ _context_t [2/2]

typedef void(* graphite2::json::_context_t) (json &)
private

Definition at line 47 of file json.h.

◆ boolean [1/2]

Definition at line 68 of file json.h.

◆ boolean [2/2]

Definition at line 68 of file json.h.

◆ number [1/2]

using graphite2::json::number = double

Definition at line 65 of file json.h.

◆ number [2/2]

using graphite2::json::number = double

Definition at line 65 of file json.h.

◆ string [1/2]

Definition at line 64 of file json.h.

◆ string [2/2]

Definition at line 64 of file json.h.

Member Enumeration Documentation

◆ integer [1/2]

Definition at line 66 of file json.h.

◆ integer [2/2]

Definition at line 66 of file json.h.

◆ integer_u [1/2]

Definition at line 67 of file json.h.

◆ integer_u [2/2]

Definition at line 67 of file json.h.

Constructor & Destructor Documentation

◆ json() [1/4]

graphite2::json::json ( const json )
private

◆ json() [2/4]

graphite2::json::json ( FILE stream)
throw (
)
inline

Definition at line 114 of file json.h.

References fflush, good(), and s.

◆ ~json() [1/2]

graphite2::json::~json ( )
throw (
)
inline

Definition at line 123 of file json.h.

References _context, _contexts, and pop_context().

◆ json() [3/4]

graphite2::json::json ( const json )
private

◆ json() [4/4]

graphite2::json::json ( FILE stream)
throw (
)

◆ ~json() [2/2]

graphite2::json::~json ( )
throw (
)

Member Function Documentation

◆ array() [1/2]

◆ array() [2/2]

static void graphite2::json::array ( json )
throw (
)
static

◆ close() [1/2]

◆ close() [2/2]

static void graphite2::json::close ( json )
throw (
)
static

◆ context() [1/2]

void json::context ( const char  current)
throw (
)
inlineprivate

Definition at line 59 of file json.cpp.

References current, fprintf, and indent.

◆ context() [2/2]

void graphite2::json::context ( const char  current)
throw (
)
private

◆ eof() [1/2]

bool graphite2::json::eof ( ) const
throw (
)
inline

Definition at line 176 of file json.h.

References _stream, and feof.

◆ eof() [2/2]

bool graphite2::json::eof ( ) const
throw (
)

◆ flat() [1/2]

◆ flat() [2/2]

static void graphite2::json::flat ( json )
throw (
)
static

◆ getenv() [1/2]

void* graphite2::json::getenv ( unsigned int  index) const
inline

Definition at line 72 of file json.h.

References _env, and index.

◆ getenv() [2/2]

void* graphite2::json::getenv ( unsigned int  index) const
inline

Definition at line 72 of file json.h.

References _env, and index.

◆ getenvs() [1/2]

const Vector<void *>& graphite2::json::getenvs ( ) const
inline

Definition at line 73 of file json.h.

References _env.

◆ getenvs() [2/2]

const Vector<void *>& graphite2::json::getenvs ( ) const
inline

Definition at line 73 of file json.h.

References _env.

◆ good() [1/2]

bool graphite2::json::good ( ) const
throw (
)
inline

Definition at line 173 of file json.h.

References _stream, and ferror.

Referenced by json(), and operator bool().

◆ good() [2/2]

bool graphite2::json::good ( ) const
throw (
)

◆ indent() [1/2]

void json::indent ( const int  d = 0)
throw (
)
private

Definition at line 67 of file json.cpp.

References d, and fprintf.

Referenced by pop_context().

◆ indent() [2/2]

void graphite2::json::indent ( const int  d = 0)
throw (
)
private

◆ item() [1/2]

void json::item ( json j)
throw (
)
static

◆ item() [2/2]

static void graphite2::json::item ( json )
throw (
)
static

◆ object() [1/2]

◆ object() [2/2]

static void graphite2::json::object ( json )
throw (
)
static

◆ operator bool() [1/2]

graphite2::json::operator bool ( ) const
throw (
)
inline

Definition at line 170 of file json.h.

References good().

◆ operator bool() [2/2]

graphite2::json::operator bool ( ) const
throw (
)

◆ operator<<() [1/14]

json & graphite2::json::operator<< ( json::_context_t  ctxt)
throw (
)
inline

Definition at line 133 of file json.h.

◆ operator<<() [2/14]

json& graphite2::json::operator<< ( _context_t  )
throw (
)

◆ operator<<() [3/14]

json & json::operator<< ( json::boolean  b)
throw (
)

Definition at line 144 of file json.cpp.

References b, and fputs.

◆ operator<<() [4/14]

json& graphite2::json::operator<< ( boolean  )
throw (
)

◆ operator<<() [5/14]

json & json::operator<< ( json::integer  d)
throw (
)

Definition at line 142 of file json.cpp.

References d, FORMAT_INTMAX, fprintf, and intmax_t.

◆ operator<<() [6/14]

json& graphite2::json::operator<< ( integer  )
throw (
)

◆ operator<<() [7/14]

json & json::operator<< ( json::integer_u  d)
throw (
)

Definition at line 143 of file json.cpp.

References d, FORMAT_UINTMAX, fprintf, and uintmax_t.

◆ operator<<() [8/14]

json& graphite2::json::operator<< ( integer_u  )
throw (
)

◆ operator<<() [9/14]

json & json::operator<< ( json::number  f)
throw (
)

Definition at line 128 of file json.cpp.

References f, fprintf, fputs, and infinity.

◆ operator<<() [10/14]

json& graphite2::json::operator<< ( number  )
throw (
)

◆ operator<<() [11/14]

json & json::operator<< ( std::nullptr_t  )
throw (
)

Definition at line 145 of file json.cpp.

References fputs.

◆ operator<<() [12/14]

json& graphite2::json::operator<< ( std::nullptr_t  )
throw (
)

◆ operator<<() [13/14]

json & json::operator<< ( json::string  s)
throw (
)

Definition at line 118 of file json.cpp.

References fprintf, and s.

◆ operator<<() [14/14]

json& graphite2::json::operator<< ( string  )
throw (
)

◆ operator=() [1/2]

json& graphite2::json::operator= ( const json )
private

◆ operator=() [2/2]

json& graphite2::json::operator= ( const json )
private

◆ pop_context() [1/2]

void json::pop_context ( )
throw (
)
private

Definition at line 89 of file json.cpp.

References _context, _contexts, _flatten, _stream, assert(), fflush, and indent().

Referenced by ~json().

◆ pop_context() [2/2]

void graphite2::json::pop_context ( )
throw (
)
private

◆ push_context() [1/2]

void json::push_context ( const char  prefix,
const char  suffix 
)
throw (
)
inlineprivate

Definition at line 77 of file json.cpp.

References assert(), prefix, and suffix.

◆ push_context() [2/2]

void graphite2::json::push_context ( const char  ,
const char   
)
throw (
)
private

◆ setenv() [1/2]

void graphite2::json::setenv ( unsigned int  index,
void val 
)
inline

◆ setenv() [2/2]

void graphite2::json::setenv ( unsigned int  index,
void val 
)
inline

◆ stream() [1/2]

FILE * graphite2::json::stream ( ) const
throw (
)
inline

Definition at line 129 of file json.h.

References _stream.

Referenced by pdf-org.Obj::__str__(), pdf.Obj::__str__(), and gr_stop_logging().

◆ stream() [2/2]

FILE* graphite2::json::stream ( ) const
throw (
)

Member Data Documentation

◆ _context

char * graphite2::json::_context
private

Definition at line 51 of file json.h.

Referenced by pop_context(), and ~json().

◆ _contexts

char graphite2::json::_contexts
private

Definition at line 50 of file json.h.

Referenced by pop_context(), and ~json().

◆ _env

Vector< void * > graphite2::json::_env
private

Definition at line 54 of file json.h.

Referenced by getenv(), getenvs(), and setenv().

◆ _flatten

char * graphite2::json::_flatten
private

Definition at line 52 of file json.h.

Referenced by pop_context().

◆ _stream

FILE *const graphite2::json::_stream
private

Definition at line 49 of file json.h.

Referenced by eof(), good(), pop_context(), and stream().

◆ CLASS_NEW_DELETE

graphite2::json::CLASS_NEW_DELETE

Definition at line 98 of file json.h.

◆ null

const std::nullptr_t json::null = nullptr
static

Definition at line 69 of file json.h.


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