44 template<
class t_struct>
48 bool rs =
ps.load_from_json(json_buff);
55 template<
class t_struct>
65 template<
class t_struct>
66 bool store_t_to_json(t_struct& str_in, std::string& json_buff,
size_t indent = 0,
bool insert_newlines =
true)
70 ps.dump_as_json(json_buff, indent, insert_newlines);
74 template<
class t_struct>
75 std::string
store_t_to_json(t_struct& str_in,
size_t indent = 0,
bool insert_newlines =
true)
77 std::string json_buff;
82 template<
class t_struct>
85 std::string json_buff;
90 template<
class t_struct>
94 bool rs =
ps.load_from_binary(binary_buff, limits);
101 template<
class t_struct>
107 template<
class t_struct>
117 template<
class t_struct>
122 return ps.store_to_binary(binary_buff, initial_buffer_size);
125 template<
class t_struct>
133 template<
class t_struct>
138 return ps.store_to_binary(binary_buff);
Definition byte_slice.h:69
A partial drop-in replacement for std::ostream.
Definition byte_stream.h:58
Definition portable_storage.h:46
Non-owning sequence of data. Does not deep copy.
Definition span.h:55
epee::serialization::portable_storage ps
Definition load_from_binary.cpp:40
bool load_file_to_string(const std::string &path_to_file, std::string &target_str, size_t max_size=1000000000)
Definition file_io_utils.cpp:105
bool save_string_to_file(const std::string &path_to_file, const std::string &str)
Definition file_io_utils.cpp:71
Definition keyvalue_serialization_overloads.h:49
bool store_t_to_binary(t_struct &str_in, byte_slice &binary_buff, size_t initial_buffer_size=8192)
Definition portable_storage_template_helper.h:118
bool store_t_to_json(t_struct &str_in, std::string &json_buff, size_t indent=0, bool insert_newlines=true)
Definition portable_storage_template_helper.h:66
bool store_t_to_json_file(t_struct &str_in, const std::string &fpath)
Definition portable_storage_template_helper.h:83
bool load_t_from_binary_file(t_struct &out, const std::string &binary_file)
Definition portable_storage_template_helper.h:108
bool load_t_from_json_file(t_struct &out, const std::string &json_file)
Definition portable_storage_template_helper.h:56
bool load_t_from_binary(t_struct &out, const epee::span< const uint8_t > binary_buff, const epee::serialization::portable_storage::limits_t *limits=NULL)
Definition portable_storage_template_helper.h:91
bool load_t_from_json(t_struct &out, const std::string &json_buff)
Definition portable_storage_template_helper.h:45
TODO: (mj-xmr) This will be reduced in an another PR.
Definition byte_slice.h:40
span< const T > strspan(const U &s) noexcept
make a span from a std::string
Definition span.h:183
Definition portable_storage.h:53