20 for(
const auto &
ch : src)
79 out << std::string(indent*2,
' ');
91 for(arrayt::const_iterator
a_it=
array.begin();
101 out << std::string((indent+1)*2,
' ');
106 a_it->output_rec(out, indent+1);
109 if(
array.back().is_object())
110 out <<
'\n' << std::string(indent*2,
' ');
137 for(objectt::const_iterator
o_it =
object.begin();
o_it !=
object.end();
140 if(
o_it !=
object.begin())
147 out << std::string((indent + 1) * 2,
' ');
150 o_it->second.output_rec(out, indent + 1);
165 other.
object.swap(
object);
202 [&](
const std::pair<std::string, jsont> &
pair) {
203 return right_object[pair.first] == pair.second;
221 return std::move(result);
227 if(data.
data().size() == 0)
235 return std::move(result);
ait supplies three of the four components needed: an abstract interpreter (in this case handling func...
static void escape_string(const std::string &, std::ostream &)
void output_rec(std::ostream &, unsigned indent) const
Recursive printing of the json object.
static void output_key(std::ostream &out, const std::string &key)
std::map< std::string, jsont > objectt
static const jsont null_json_object
static void output_object(std::ostream &out, const objectt &object, unsigned indent)
Basic handling of the printing of a JSON object.
A way of representing nested key/value data.
const std::map< labelt, structured_data_entryt > & data() const
jsont to_json(const structured_datat &data)
Convert the structured_datat into an json object.
bool operator==(const jsont &left, const jsont &right)
jsont json_node(const structured_data_entryt &entry)
#define UNREACHABLE
This should be used to mark dead code.
const std::map< labelt, structured_data_entryt > & children() const
jsont leaf_object() const