1 #ifndef PORTABLE_BINARY_IARCHIVE_HPP 2 #define PORTABLE_BINARY_IARCHIVE_HPP 10 #pragma warning( push ) 11 #pragma warning( disable : 4244 ) 25 #include <boost/version.hpp> 26 #include <boost/serialization/string.hpp> 27 #include <boost/serialization/item_version_type.hpp> 28 #include <boost/archive/archive_exception.hpp> 29 #include <boost/archive/basic_binary_iprimitive.hpp> 30 #include <boost/archive/detail/common_iarchive.hpp> 31 #include <boost/archive/detail/register_archive.hpp> 34 #include <boost/archive/impl/basic_binary_iprimitive.ipp> 36 namespace boost {
namespace archive {
42 public boost::archive::archive_exception
49 boost::archive::archive_exception(
boost::archive::archive_exception::other_exception),
52 virtual const char *
what( )
const throw( )
54 const char *msg =
"programmer error";
57 msg =
"integer cannot be represented";
60 msg = boost::archive::archive_exception::what();
73 public boost::archive::basic_binary_iprimitive<
74 portable_binary_iarchive,
75 std::istream::char_type,
76 std::istream::traits_type
78 public boost::archive::detail::common_iarchive<
79 portable_binary_iarchive
82 typedef boost::archive::basic_binary_iprimitive<
84 std::istream::char_type,
85 std::istream::traits_type
87 typedef boost::archive::detail::common_iarchive<
90 #ifndef BOOST_NO_MEMBER_TEMPLATE_FRIENDS 93 friend archive_base_t;
94 friend primitive_base_t;
95 friend class boost::archive::detail::interface_iarchive<
98 friend class boost::archive::load_access;
113 void load(boost::serialization::item_version_type & t){
115 load_impl(l,
sizeof(boost::serialization::item_version_type));
117 t = boost::serialization::item_version_type(l);
119 void load(boost::archive::version_type & t){
121 load_impl(l,
sizeof(boost::archive::version_type));
123 t = boost::archive::version_type(l);
125 void load(boost::archive::class_id_type & t){
127 load_impl(l,
sizeof(boost::archive::class_id_type));
129 t = boost::archive::class_id_type(static_cast<int>(l));
134 #ifndef BOOST_NO_STD_WSTRING 155 typedef boost::archive::detail::common_iarchive<portable_binary_iarchive>
157 #if BOOST_VERSION > 105800 160 this->detail_common_iarchive::load_override(t);
164 void load_override(boost::archive::class_id_optional_type &){}
168 this->detail_common_iarchive::load_override(t, 0);
170 void load_override(boost::archive::class_name_type & t,
int);
175 void init(
unsigned int flags);
180 0 != (flags &
boost::archive::no_codecvt)
182 archive_base_t(flags),
189 std::basic_streambuf<
190 std::istream::char_type,
191 std::istream::traits_type
197 0 != (flags &
boost::archive::no_codecvt)
199 archive_base_t(flags),
209 #ifdef BOOST_SERIALIZATION_REGISTER_ARCHIVE 210 BOOST_SERIALIZATION_REGISTER_ARCHIVE(portable_binary_iarchive)
214 #define BOOST_ARCHIVE_CUSTOM_IARCHIVE_TYPES portable_binary_iarchive 229 #include <boost/predef/other/endian.h> 230 #include <boost/serialization/throw_exception.hpp> 231 #include <boost/archive/archive_exception.hpp> 233 namespace boost {
namespace archive {
245 bool negative = (size < 0);
250 boost::serialization::throw_exception(
254 char * cptr =
reinterpret_cast<char *
>(& l);
255 #if BOOST_ENDIAN_BIG_BYTE 258 this->primitive_base_t::load_binary(cptr, size);
260 #if BOOST_ENDIAN_BIG_BYTE 271 #if BOOST_VERSION > 105800 274 boost::archive::class_name_type & t
277 cn.reserve(BOOST_SERIALIZATION_MAX_KEY_SIZE);
279 if(cn.size() > (BOOST_SERIALIZATION_MAX_KEY_SIZE - 1))
280 boost::serialization::throw_exception(
281 boost::archive::archive_exception(
282 boost::archive::archive_exception::invalid_class_name)
286 t.t[cn.size()] =
'\0';
291 boost::archive::class_name_type & t,
int 294 cn.reserve(BOOST_SERIALIZATION_MAX_KEY_SIZE);
296 if(cn.size() > (BOOST_SERIALIZATION_MAX_KEY_SIZE - 1))
297 boost::serialization::throw_exception(
298 boost::archive::archive_exception(
299 boost::archive::archive_exception::invalid_class_name)
303 t.t[cn.size()] =
'\0';
309 if(0 == (flags & boost::archive::no_header)){
312 *
this >> file_signature;
313 if(file_signature != boost::archive::BOOST_ARCHIVE_SIGNATURE())
314 boost::serialization::throw_exception(
315 boost::archive::archive_exception(
316 boost::archive::archive_exception::invalid_signature
321 boost::archive::library_version_type input_library_version;
322 *
this >> input_library_version;
335 #if BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3205)) 336 this->set_library_version(input_library_version);
341 boost::archive::detail::basic_iarchive::set_library_version(
342 input_library_version
359 template class archive_serializer_map<portable_binary_iarchive>;
371 #if defined(_MSC_VER) 372 #pragma warning( pop ) 375 #endif // PORTABLE_BINARY_IARCHIVE_HPP void load_override(T &t, int)
void load(unsigned char &t)
void load(boost::serialization::item_version_type &t)
portable_binary_iarchive_exception(exception_code c=incompatible_integer_size)
void load_override(boost::archive::class_id_optional_type &, int)
void load(std::wstring &t)
boost::archive::detail::common_iarchive< portable_binary_iarchive > detail_common_iarchive
void reverse_bytes(signed char size, char *address)
void load(boost::archive::class_id_type &t)
declaration and default definition for the functions used the API
void load(Archive &a, std::unordered_map< h_key, hval > &x, const boost::serialization::version_type ver)
void load_impl(boost::intmax_t &l, char maxsize)
virtual const char * what() const
portable_binary_iarchive(std::istream &is, unsigned flags=0)
void load(boost::archive::version_type &t)
void load(std::string &t)
void * memcpy(void *a, const void *b, size_t c)
portable_binary_iarchive(std::basic_streambuf< std::istream::char_type, std::istream::traits_type > &bsb, unsigned int flags)
enum boost::archive::portable_binary_iarchive_exception::exception_code m_exception_code
void init(unsigned int flags)