1 #ifndef PORTABLE_BINARY_OARCHIVE_HPP
2 #define PORTABLE_BINARY_OARCHIVE_HPP
10 #pragma warning( push )
11 #pragma warning( disable : 4244 )
25 #include <boost/version.hpp>
26 #include <boost/serialization/string.hpp>
27 #include <boost/archive/archive_exception.hpp>
28 #include <boost/archive/basic_binary_oprimitive.hpp>
29 #include <boost/archive/detail/common_oarchive.hpp>
30 #include <boost/archive/detail/register_archive.hpp>
33 #include <boost/archive/impl/basic_binary_oprimitive.ipp>
35 namespace boost {
namespace archive {
41 public boost::archive::archive_exception
48 boost::archive::archive_exception(
boost::archive::archive_exception::other_exception),
51 virtual const char *
what( )
const throw( )
53 const char *msg =
"programmer error";
56 msg =
"cannot be both big and little endian";
59 msg = boost::archive::archive_exception::what();
73 public boost::archive::basic_binary_oprimitive<
74 portable_binary_oarchive,
75 std::ostream::char_type,
76 std::ostream::traits_type
78 public boost::archive::detail::common_oarchive<
79 portable_binary_oarchive
82 typedef boost::archive::basic_binary_oprimitive<
84 std::ostream::char_type,
85 std::ostream::traits_type
87 typedef boost::archive::detail::common_oarchive<
90 #ifndef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
93 friend archive_base_t;
94 friend primitive_base_t;
95 friend class boost::archive::detail::interface_oarchive<
98 friend class boost::archive::save_access;
116 #ifndef BOOST_NO_STD_WSTRING
134 void save(
const unsigned char & t){
140 typedef boost::archive::detail::common_oarchive<portable_binary_oarchive>
142 #if BOOST_VERSION > 105800
145 this->detail_common_oarchive::save_override(t);
148 void save_override(
const boost::archive::class_name_type & t){
154 const boost::archive::class_id_optional_type &
159 this->detail_common_oarchive::save_override(t, 0);
168 const boost::archive::class_id_optional_type & ,
int
172 void init(
unsigned int flags);
177 0 != (flags &
boost::archive::no_codecvt)
179 archive_base_t(flags),
186 std::basic_streambuf<
187 std::ostream::char_type,
188 std::ostream::traits_type
194 0 != (flags &
boost::archive::no_codecvt)
196 archive_base_t(flags),
206 #ifdef BOOST_SERIALIZATION_REGISTER_ARCHIVE
207 BOOST_SERIALIZATION_REGISTER_ARCHIVE(portable_binary_oarchive)
211 #define BOOST_ARCHIVE_CUSTOM_OARCHIVE_TYPES portable_binary_oarchive
224 #include <boost/predef/other/endian.h>
226 namespace boost {
namespace archive {
233 signed char size = 0;
241 bool negative = (l < 0);
253 static_cast<signed char>(negative ? -size : size)
260 char * cptr =
reinterpret_cast<char *
>(& ll);
261 #if BOOST_ENDIAN_BIG_BYTE
269 this->primitive_base_t::save_binary(cptr, size);
275 boost::serialization::throw_exception(
279 if(0 == (flags & boost::archive::no_header)){
282 boost::archive::BOOST_ARCHIVE_SIGNATURE()
284 *
this << file_signature;
286 const boost::archive::library_version_type v{};
295 save(
static_cast<unsigned char>(
m_flags >> CHAR_BIT));
304 template class archive_serializer_map<portable_binary_oarchive>;
316 #if defined(_MSC_VER)
317 #pragma warning( pop )
virtual const char * what() const
enum boost::archive::portable_binary_oarchive_exception::exception_code m_exception_code
portable_binary_oarchive_exception(exception_code c=invalid_flags)
void save(const unsigned char &t)
void save(const std::wstring &t)
void save_override(const boost::archive::class_name_type &t, int)
void save_impl(const boost::intmax_t l, const char maxsize)
void save(const double &t)
portable_binary_oarchive(std::basic_streambuf< std::ostream::char_type, std::ostream::traits_type > &bsb, unsigned int flags)
void save_override(T &t, int)
void init(unsigned int flags)
void save(const std::string &t)
portable_binary_oarchive(std::ostream &os, unsigned flags=endian_little)
boost::archive::detail::common_oarchive< portable_binary_oarchive > detail_common_oarchive
void save_override(const boost::archive::class_id_optional_type &, int)
void save(const float &t)
void reverse_bytes(signed char size, char *address)
void save(Archive &a, const std::unordered_map< h_key, hval > &x, const boost::serialization::version_type ver)
declaration and default definition for the functions used the API