CBMC
Loading...
Searching...
No Matches
Classes | Functions
json.h File Reference
#include <vector>
#include <map>
#include <iosfwd>
#include <string>
#include "irep.h"
#include "range.h"
+ Include dependency graph for json.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class   jsont
 
class   json_arrayt
 
class   json_stringt
 
class   json_numbert
 
class   json_objectt
 
class   json_truet
 
class   json_falset
 
class   json_nullt
 

Functions

std::ostream &  operator<< (std::ostream &out, const jsont &src)
 
 
 
 
 
 
 
bool  operator== (const jsont &left, const jsont &right)
 
  Convert the structured_datat into an json object.
 

Function Documentation

◆  operator<<()

std::ostream & operator<< ( std::ostream &  out,
const jsontsrc 
)
inline

Definition at line 158 of file json.h.

◆  operator==()

bool operator== ( const jsontleft,
const jsontright 
)

Definition at line 169 of file json.cpp.

◆  to_json()

jsont to_json ( const structured_datatdata )

Convert the structured_datat into an json object.

For example, the structured data: structured_datat data{ {{labelt{{"my", "data"}}, structured_data_entryt::entry( {{labelt{{"my", "number"}}, structured_data_entryt::data_node(json_numbert("10"))}, {labelt{{"my", "string"}}, structured_data_entryt::data_node(json_stringt("hi"))}})}}};

Will produce:

{
"myData": {
"myNumber": 10
"myString": "hi"
}
}
Parameters
data The structured data to convert.
Returns
The json object as specified.

Definition at line 225 of file json.cpp.

◆  to_json_array() [1/2]

const json_arrayt & to_json_array ( const jsontjson )
inline

Definition at line 430 of file json.h.

◆  to_json_array() [2/2]

json_arrayt & to_json_array ( jsontjson )
inline

Definition at line 424 of file json.h.

◆  to_json_object() [1/2]

const json_objectt & to_json_object ( const jsontjson )
inline

Definition at line 448 of file json.h.

◆  to_json_object() [2/2]

json_objectt & to_json_object ( jsontjson )
inline

Definition at line 442 of file json.h.

◆  to_json_string() [1/2]

const json_stringt & to_json_string ( const jsontjson )
inline

Definition at line 460 of file json.h.

◆  to_json_string() [2/2]

json_stringt & to_json_string ( jsontjson )
inline

Definition at line 454 of file json.h.

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