CBMC
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Protected Types | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
jsont Class Reference

#include <json.h>

+ Inheritance diagram for jsont:
+ Collaboration diagram for jsont:

Public Types

enum class   kindt {
  J_STRING , J_NUMBER , J_OBJECT , J_ARRAY ,
  J_TRUE , J_FALSE , J_NULL
}
 

Public Member Functions

 
 
 
 
 
 
 
 
  jsont ()
 
void  output (std::ostream &out) const
 
void  swap (jsont &other)
 
void  clear ()
 
 
 
const jsontoperator[] (const std::string &key) const
 
void  output_rec (std::ostream &, unsigned indent) const
  Recursive printing of the json object.
 

Static Public Member Functions

 
static void  output_key (std::ostream &out, const std::string &key)
 
static void  output_object (std::ostream &out, const objectt &object, unsigned indent)
  Basic handling of the printing of a JSON object.
 

Public Attributes

 
std::string  value
 

Static Public Attributes

 

Protected Types

typedef std::vector< jsontarrayt
 
typedef std::map< std::string, jsontobjectt
 

Protected Member Functions

 
  jsont (kindt _kind, std::string _value)
 
  jsont (kindt _kind, arrayt &&entries)
 
  jsont (kindt _kind, objectt &&objects)
 

Static Protected Member Functions

static void  escape_string (const std::string &, std::ostream &)
 

Protected Attributes

 
 

Detailed Description

Definition at line 26 of file json.h.

Member Typedef Documentation

◆  arrayt

typedef std::vector<jsont> jsont::arrayt
protected

Definition at line 29 of file json.h.

◆  objectt

typedef std::map<std::string, jsont> jsont::objectt
protected

Definition at line 30 of file json.h.

Member Enumeration Documentation

◆  kindt

Enumerator
J_STRING 
J_NUMBER 
J_OBJECT 
J_ARRAY 
J_TRUE 
J_FALSE 
J_NULL 

Definition at line 33 of file json.h.

Constructor & Destructor Documentation

◆  jsont() [1/5]

jsont::jsont ( )
inline

Definition at line 86 of file json.h.

◆  jsont() [2/5]

jsont::jsont ( kindt  _kind )
inlineexplicitprotected

Definition at line 140 of file json.h.

◆  jsont() [3/5]

jsont::jsont ( kindt  _kind,
std::string  _value 
)
inlineprotected

Definition at line 144 of file json.h.

◆  jsont() [4/5]

jsont::jsont ( kindt  _kind,
arrayt &&  entries 
)
inlineprotected

Definition at line 148 of file json.h.

◆  jsont() [5/5]

jsont::jsont ( kindt  _kind,
objectt &&  objects 
)
inlineprotected

Definition at line 152 of file json.h.

Member Function Documentation

◆  clear()

void jsont::clear ( )
inline

Definition at line 102 of file json.h.

◆  escape_string()

void jsont::escape_string ( const std::string &  src,
std::ostream &  out 
)
staticprotected

Definition at line 18 of file json.cpp.

◆  is_array()

bool jsont::is_array ( ) const
inline

Definition at line 61 of file json.h.

◆  is_boolean()

bool jsont::is_boolean ( ) const
inline

Definition at line 66 of file json.h.

◆  is_false()

bool jsont::is_false ( ) const
inline

Definition at line 76 of file json.h.

◆  is_null()

bool jsont::is_null ( ) const
inline

Definition at line 81 of file json.h.

◆  is_number()

bool jsont::is_number ( ) const
inline

Definition at line 51 of file json.h.

◆  is_object()

bool jsont::is_object ( ) const
inline

Definition at line 56 of file json.h.

◆  is_string()

bool jsont::is_string ( ) const
inline

Definition at line 46 of file json.h.

◆  is_true()

bool jsont::is_true ( ) const
inline

Definition at line 71 of file json.h.

◆  json_boolean()

static jsont jsont::json_boolean ( bool  value )
inlinestatic

Definition at line 97 of file json.h.

◆  make_array()

json_arrayt & jsont::make_array ( )
inline

Definition at line 418 of file json.h.

◆  make_object()

json_objectt & jsont::make_object ( )
inline

Definition at line 436 of file json.h.

◆  operator[]()

const jsont & jsont::operator[] ( const std::string &  key ) const
inline

Definition at line 114 of file json.h.

◆  output()

void jsont::output ( std::ostream &  out ) const
inline

Definition at line 90 of file json.h.

◆  output_key()

void jsont::output_key ( std::ostream &  out,
const std::string &  key 
)
static

Definition at line 154 of file json.cpp.

◆  output_object()

void jsont::output_object ( std::ostream &  out,
const objecttobject,
unsigned  indent 
)
static

Basic handling of the printing of a JSON object.

Dispatches to output_rec for most of the hard work.

Parameters
out The stream that the JSON object is to be printed to.
object The JSON object.
indent The indentation level.

Definition at line 132 of file json.cpp.

◆  output_rec()

void jsont::output_rec ( std::ostream &  out,
unsigned  indent 
) const

Recursive printing of the json object.

Parameters
out The stream object to have the json printed to.
indent The indentation level.

Definition at line 59 of file json.cpp.

◆  swap()

void jsont::swap ( jsontother )

Definition at line 161 of file json.cpp.

Member Data Documentation

◆  array

arrayt jsont::array
protected

Definition at line 135 of file json.h.

◆  kind

kindt jsont::kind

Definition at line 44 of file json.h.

◆  null_json_object

const jsont jsont::null_json_object
static

Definition at line 125 of file json.h.

◆  object

objectt jsont::object
protected

Definition at line 136 of file json.h.

◆  value

std::string jsont::value

Definition at line 132 of file json.h.


The documentation for this class was generated from the following files:
  • /home/runner/work/cbmc/cbmc/src/util/json.h
  • /home/runner/work/cbmc/cbmc/src/util/json.cpp

AltStyle によって変換されたページ (->オリジナル) /