31#include <boost/variant.hpp>
37#define PORTABLE_STORAGE_SIGNATUREA 0x01011101
38#define PORTABLE_STORAGE_SIGNATUREB 0x01020101
39#define PORTABLE_STORAGE_FORMAT_VER 1
41#define PORTABLE_RAW_SIZE_MARK_MASK 0x03
42#define PORTABLE_RAW_SIZE_MARK_BYTE 0
43#define PORTABLE_RAW_SIZE_MARK_WORD 1
44#define PORTABLE_RAW_SIZE_MARK_DWORD 2
45#define PORTABLE_RAW_SIZE_MARK_INT64 3
47#ifndef MAX_STRING_LEN_POSSIBLE
48#define MAX_STRING_LEN_POSSIBLE 2000000000
52#define SERIALIZE_TYPE_INT64 1
53#define SERIALIZE_TYPE_INT32 2
54#define SERIALIZE_TYPE_INT16 3
55#define SERIALIZE_TYPE_INT8 4
56#define SERIALIZE_TYPE_UINT64 5
57#define SERIALIZE_TYPE_UINT32 6
58#define SERIALIZE_TYPE_UINT16 7
59#define SERIALIZE_TYPE_UINT8 8
60#define SERIALIZE_TYPE_DOUBLE 9
61#define SERIALIZE_TYPE_STRING 10
62#define SERIALIZE_TYPE_BOOL 11
63#define SERIALIZE_TYPE_OBJECT 12
64#define SERIALIZE_TYPE_ARRAY 13
66#define SERIALIZE_FLAG_ARRAY 0x80
81 template<
class t_entry_type>
118 return (t_entry_type*)&(*(
m_it++));
130 m_array.push_back(std::move(v));
144 typedef boost::make_recursive_variant<
161 typedef 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;
section * hsection
Definition portable_storage_base.h:174
std::string binarybuffer
Definition portable_storage_base.h:163
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
array_entry * harray
Definition portable_storage_base.h:175
TODO: (mj-xmr) This will be reduced in an another PR.
Definition byte_slice.h:40
Definition binary_utils.h:36
Definition portable_storage_base.h:83
t_entry_type * get_next_val()
Definition portable_storage_base.h:114
void reserve(size_t n)
Definition portable_storage_base.h:134
array_entry_t()
Definition portable_storage_base.h:84
t_entry_type * get_first_val()
Definition portable_storage_base.h:100
entry_container< t_entry_type >::type::const_iterator m_it
Definition portable_storage_base.h:140
const t_entry_type * get_first_val() const
Definition portable_storage_base.h:94
t_entry_type & insert_first_val(t_entry_type &&v)
Definition portable_storage_base.h:121
array_entry_t & operator=(const array_entry_t &other)
Definition portable_storage_base.h:87
t_entry_type & insert_next_value(t_entry_type &&v)
Definition portable_storage_base.h:128
const t_entry_type * get_next_val() const
Definition portable_storage_base.h:107
entry_container< t_entry_type >::type m_array
Definition portable_storage_base.h:139
array_entry_t(const array_entry_t &other)
Definition portable_storage_base.h:85
std::deque< bool > type
Definition portable_storage_base.h:76
static void reserve(type &t, size_t n)
Definition portable_storage_base.h:76
Definition portable_storage_base.h:75
static void reserve(type &t, size_t n)
Definition portable_storage_base.h:75
std::vector< T > type
Definition portable_storage_base.h:75
Definition portable_storage_base.h:169
std::map< std::string, storage_entry > m_entries
Definition portable_storage_base.h:170