CBMC
json.cpp File Reference
#include "json.h"
#include "structured_data.h"
#include <algorithm>
#include <ostream>
+ Include dependency graph for json.cpp:

Go to the source code of this file.

Functions

bool operator== (const jsont &left, const jsont &right)
 
jsont json_node (const structured_data_entryt &entry)
 
jsont to_json (const structured_datat &data)
 Convert the structured_datat into an json object. More...
 

Function Documentation

◆ json_node()

jsont json_node ( const structured_data_entryt entry)

Definition at line 210 of file json.cpp.

◆ operator==()

bool operator== ( const jsont left,
const jsont right 
)

Definition at line 169 of file json.cpp.

◆ to_json()

jsont to_json ( const structured_datat data)

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
dataThe structured data to convert.
Returns
The json object as specified.

Definition at line 225 of file json.cpp.