40 template<
class t_stream>
42 template<
class t_stream>
44 template<
class t_stream>
45 void dump_as_json(t_stream& strm,
const std::string& v,
size_t indent,
bool insert_newlines);
46 template<
class t_stream>
47 void dump_as_json(t_stream& strm,
const int8_t& v,
size_t indent,
bool insert_newlines);
48 template<
class t_stream>
50 template<
class t_stream>
51 void dump_as_json(t_stream& strm,
const bool& v,
size_t indent,
bool insert_newlines);
52 template<
class t_stream,
class t_type>
53 void dump_as_json(t_stream& strm,
const t_type& v,
size_t indent,
bool insert_newlines);
54 template<
class t_stream>
60 return std::string(indent*2,
' ');
63 template<
class t_stream>
70 bool insert_newlines =
true)
74 template<
class t_type>
80 auto last_it = --
a.m_array.end();
81 for(
auto it =
a.m_array.begin(); it !=
a.m_array.end(); it++)
92 template<
class t_stream>
99 bool insert_newlines =
true)
103 template<
class visited_type>
110 template<
class t_stream>
114 boost::apply_visitor(aesv, ae);
117 template<
class t_stream>
121 boost::apply_visitor(sv, se);
124 template<
class t_stream>
125 void dump_as_json(t_stream& strm,
const std::string& v,
size_t indent,
bool insert_newlines)
130 template<
class t_stream>
133 strm << static_cast<int32_t>(v);
136 template<
class t_stream>
139 strm << static_cast<int32_t>(v);
142 template<
class t_stream>
143 void dump_as_json(t_stream& strm,
const bool& v,
size_t indent,
bool insert_newlines)
153 template<
class t_stream,
class t_type>
154 void dump_as_json(t_stream& strm,
const t_type& v,
size_t indent,
bool insert_newlines)
159 template<
class t_stream>
162 size_t local_indent = indent + 1;
163 std::string newline = insert_newlines ?
"\r\n" :
"";
164 strm <<
"{" << newline;
165 std::string indent_str =
make_indent(local_indent);
172 dump_as_json(strm, it->second, local_indent, insert_newlines);
std::string transform_to_escape_sequence(const std::string &src)
Definition parserse_base_utils.cpp:42
Definition keyvalue_serialization_overloads.h:49
std::string make_indent(size_t indent)
Definition portable_storage_to_json.h:58
void dump_as_json(t_stream &strm, const array_entry &ae, size_t indent, bool insert_newlines)
Definition portable_storage_to_json.h:111
boost::variant< uint64_t, uint32_t, uint16_t, uint8_t, int64_t, int32_t, int16_t, int8_t, double, bool, std::string, section, array_entry > storage_entry
Definition portable_storage_base.h:161
boost::make_recursive_variant< array_entry_t< section >, array_entry_t< uint64_t >, array_entry_t< uint32_t >, array_entry_t< uint16_t >, array_entry_t< uint8_t >, array_entry_t< int64_t >, array_entry_t< int32_t >, array_entry_t< int16_t >, array_entry_t< int8_t >, array_entry_t< double >, array_entry_t< bool >, array_entry_t< std::string >, array_entry_t< section >, array_entry_t< boost::recursive_variant_ > >::type array_entry
Definition portable_storage_base.h:159
TODO: (mj-xmr) This will be reduced in an another PR.
Definition byte_slice.h:40
const GenericPointer< typename T::ValueType > T2 T::AllocatorType & a
Definition pointer.h:1124
unsigned char uint8_t
Definition stdint.h:124
signed char int8_t
Definition stdint.h:121
Definition portable_storage_to_json.h:65
array_entry_store_to_json_visitor(t_stream &strm, size_t indent, bool insert_newlines=true)
Definition portable_storage_to_json.h:69
bool m_insert_newlines
Definition portable_storage_to_json.h:68
void operator()(const array_entry_t< t_type > &a)
Definition portable_storage_to_json.h:75
t_stream & m_strm
Definition portable_storage_to_json.h:66
size_t m_indent
Definition portable_storage_to_json.h:67
Definition portable_storage_base.h:83
Definition portable_storage_base.h:169
std::map< std::string, storage_entry > m_entries
Definition portable_storage_base.h:170
Definition portable_storage_to_json.h:94
size_t m_indent
Definition portable_storage_to_json.h:96
storage_entry_store_to_json_visitor(t_stream &strm, size_t indent, bool insert_newlines=true)
Definition portable_storage_to_json.h:98
t_stream & m_strm
Definition portable_storage_to_json.h:95
bool m_insert_newlines
Definition portable_storage_to_json.h:97
void operator()(const visited_type &v)
Definition portable_storage_to_json.h:104