31 #include <boost/variant.hpp> 32 #include <boost/any.hpp> 37 #define PORTABLE_STORAGE_SIGNATUREA 0x01011101 38 #define PORTABLE_STORAGE_SIGNATUREB 0x01020101 // bender's nightmare 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 //do not let string be so big 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_DUOBLE 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>
111 return (t_entry_type*)&(*(
m_it++));
137 typedef boost::make_recursive_variant<
154 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;
t_entry_type & insert_first_val(const t_entry_type &v)
const t_entry_type * get_next_val() const
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
t_entry_type * get_first_val()
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
entry_container< t_entry_type >::type::const_iterator m_it
entry_container< t_entry_type >::type m_array
static void reserve(type &t, size_t n)
t_entry_type & insert_next_value(const t_entry_type &v)
array_entry_t(const array_entry_t &other)
const t_entry_type * get_first_val() const
std::map< std::string, storage_entry > m_entries
t_entry_type * get_next_val()