4#include <snapshots.hpp>
34 return std::make_shared<writer>(std::make_shared<write_storage_t>());
37 static auto finalize(
const std::shared_ptr<writer>& w) {
43 return std::make_shared<reader>(buffer);
47 snapshot_input_file<snapshot::json> file(filename);
52 snapshot_output_file<snapshot::json> file(basename);
86 return std::make_shared<writer>(std::make_shared<write_storage_t>());
89 static auto finalize(
const std::shared_ptr<writer>& w) {
91 return w->storage->str();
95 return std::make_shared<reader>(std::make_shared<read_storage_t>(buffer));
99 snapshot_input_file<snapshot::binary> file(filename);
100 return file.read_as_string();
104 snapshot_output_file<snapshot::binary> file(basename);
109using snapshot_suites = boost::mpl::list<variant_snapshot_suite, buffered_snapshot_suite>;
An order-preserving dictionary of variants.
stores null, int64, uint64, double, bool, string, std::vector<variant>, and variant_object's.
boost::mpl::list< variant_snapshot_suite, buffered_snapshot_suite > snapshot_suites
std::shared_ptr< read_storage_t > storage
reader(const std::shared_ptr< read_storage_t > &storage)
std::shared_ptr< write_storage_t > storage
writer(const std::shared_ptr< write_storage_t > &storage)
std::istringstream read_storage_t
static void write_to_file(const std::string &basename, const snapshot_t &snapshot)
static auto get_reader(const snapshot_t &buffer)
std::ostringstream write_storage_t
static snapshot_t load_from_file(const std::string &filename)
static auto finalize(const std::shared_ptr< writer > &w)
reader(const snapshot_t &storage)
writer(const std::shared_ptr< write_storage_t > &storage)
std::shared_ptr< write_storage_t > storage
static void write_to_file(const std::string &basename, const snapshot_t &snapshot)
static snapshot_t load_from_file(const std::string &filename)
static auto get_reader(const snapshot_t &buffer)
static auto finalize(const std::shared_ptr< writer > &w)