40 template<
class pack_value,
class t_stream>
43 pack_value v = (*((pack_value*)&pv)) << 2;
45 strm.write((
const char*)&v,
sizeof(pack_value));
46 return sizeof(pack_value);
50 PRAGMA_GCC(
"GCC diagnostic ignored \"-Wstrict-aliasing\"")
52 PRAGMA_GCC(
"GCC diagnostic ignored \"-Wtautological-constant-out-of-range-compare\"")
54 template<
class t_stream>
65 }
else if(val <= 1073741823)
76 template<
class t_stream>
81 strm.write((
const char*)v.data(), v.size());
85 template<
class t_stream>
90 template<
class t_pod_type>
94 m_strm.write((
const char*)&type, 1);
96 for(
const t_pod_type& x: arr_pod.
m_array)
97 m_strm.write((
const char*)&x,
sizeof(t_pod_type));
115 m_strm.write((
const char*)&type, 1);
124 m_strm.write((
const char*)&type, 1);
133 m_strm.write((
const char*)&type, 1);
141 template<
class t_stream>
146 template<
class pod_type>
149 m_strm.write((
const char*)&type, 1);
150 m_strm.write((
const char*)&v,
sizeof(pod_type));
167 m_strm.write((
const char*)&type, 1);
174 m_strm.write((
const char*)&type, 1);
186 template<
class t_stream>
190 return boost::apply_visitor(aesv, ae);
193 template<
class t_stream>
197 return boost::apply_visitor(sv, se);
200 template<
class t_stream>
203 typedef std::map<std::string, storage_entry>::value_type section_pair;
205 for(
const section_pair& se: sec.
m_entries)
207 CHECK_AND_ASSERT_THROW_MES(se.first.size() < std::numeric_limits<uint8_t>::max(),
"storage_entry_name is too long: " << se.first.size() <<
", val: " << se.first);
209 strm.write((
const char*)&len,
sizeof(len));
210 strm.write(se.first.data(), size_t(len));
#define CHECK_AND_ASSERT_THROW_MES(expr, message)
storage_entry_store_visitor(t_stream &strm)
bool operator()(const int64_t &v)
bool operator()(const array_entry_t< int8_t > &v)
#define PORTABLE_RAW_SIZE_MARK_BYTE
PRAGMA_WARNING_PUSH size_t pack_varint(t_stream &strm, size_t val)
bool operator()(const array_entry_t< section > &arr_sec)
#define PORTABLE_RAW_SIZE_MARK_WORD
#define SERIALIZE_TYPE_INT32
#define SERIALIZE_TYPE_INT16
bool operator()(const double &v)
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
bool operator()(const array_entry_t< uint64_t > &v)
bool operator()(const int32_t &v)
#define SERIALIZE_TYPE_STRING
#define SERIALIZE_TYPE_INT64
bool operator()(const array_entry_t< array_entry > &arra_ar)
#define SERIALIZE_TYPE_OBJECT
#define SERIALIZE_TYPE_UINT32
#define SERIALIZE_TYPE_UINT64
#define SERIALIZE_TYPE_BOOL
bool operator()(const array_entry_t< double > &v)
bool operator()(const int16_t &v)
bool operator()(const array_entry_t< int64_t > &v)
bool operator()(const array_entry_t< std::string > &arr_str)
#define SERIALIZE_TYPE_UINT16
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
bool operator()(const uint8_t &v)
bool operator()(const section &v)
#define SERIALIZE_FLAG_ARRAY
PRAGMA_WARNING_POP bool put_string(t_stream &strm, const std::string &v)
bool pack_pod_type(uint8_t type, const pod_type &v)
bool pack_entry_to_buff(t_stream &strm, const array_entry &ae)
bool operator()(const bool &v)
bool operator()(const std::string &v)
unsigned __int64 uint64_t
#define SERIALIZE_TYPE_ARRAY
bool operator()(const array_entry_t< int16_t > &v)
#define SERIALIZE_TYPE_INT8
bool operator()(const array_entry_t< bool > &v)
entry_container< t_entry_type >::type m_array
#define SERIALIZE_TYPE_UINT8
bool pack_pod_array_type(uint8_t contained_type, const array_entry_t< t_pod_type > &arr_pod)
bool operator()(const array_entry_t< uint8_t > &v)
#define PORTABLE_RAW_SIZE_MARK_DWORD
size_t pack_varint_t(t_stream &strm, uint8_t type_or, size_t &pv)
#define PORTABLE_RAW_SIZE_MARK_INT64
array_entry_store_visitor(t_stream &strm)
#define SERIALIZE_TYPE_DUOBLE
bool operator()(const array_entry &v)
bool operator()(const array_entry_t< int32_t > &v)
bool operator()(const uint32_t &v)
std::map< std::string, storage_entry > m_entries
bool operator()(const int8_t &v)
bool operator()(const array_entry_t< uint32_t > &v)
bool operator()(const uint64_t &v)
bool operator()(const uint16_t &v)
bool operator()(const array_entry_t< uint16_t > &v)