123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126 |
- #include <ostream>
- #include <cstddef> // NULL
- #include <cstring>
- #include <boost/config.hpp>
- #if defined(BOOST_NO_STDC_NAMESPACE) && ! defined(__LIBCOMO__)
- namespace std{
- using ::strlen;
- }
- #endif
- #ifndef BOOST_NO_CWCHAR
- #include <cwchar>
- #ifdef BOOST_NO_STDC_NAMESPACE
- namespace std{ using ::wcslen; }
- #endif
- #endif
- #include <boost/archive/basic_binary_oprimitive.hpp>
- #include <boost/core/no_exceptions_support.hpp>
- namespace boost {
- namespace archive {
- template<class Archive, class Elem, class Tr>
- BOOST_ARCHIVE_OR_WARCHIVE_DECL void
- basic_binary_oprimitive<Archive, Elem, Tr>::init()
- {
-
-
-
-
- this->This()->save(static_cast<unsigned char>(sizeof(int)));
- this->This()->save(static_cast<unsigned char>(sizeof(long)));
- this->This()->save(static_cast<unsigned char>(sizeof(float)));
- this->This()->save(static_cast<unsigned char>(sizeof(double)));
-
- this->This()->save(int(1));
- }
- template<class Archive, class Elem, class Tr>
- BOOST_ARCHIVE_OR_WARCHIVE_DECL void
- basic_binary_oprimitive<Archive, Elem, Tr>::save(const char * s)
- {
- std::size_t l = std::strlen(s);
- this->This()->save(l);
- save_binary(s, l);
- }
- template<class Archive, class Elem, class Tr>
- BOOST_ARCHIVE_OR_WARCHIVE_DECL void
- basic_binary_oprimitive<Archive, Elem, Tr>::save(const std::string &s)
- {
- std::size_t l = static_cast<std::size_t>(s.size());
- this->This()->save(l);
- save_binary(s.data(), l);
- }
- #ifndef BOOST_NO_CWCHAR
- #ifndef BOOST_NO_INTRINSIC_WCHAR_T
- template<class Archive, class Elem, class Tr>
- BOOST_ARCHIVE_OR_WARCHIVE_DECL void
- basic_binary_oprimitive<Archive, Elem, Tr>::save(const wchar_t * ws)
- {
- std::size_t l = std::wcslen(ws);
- this->This()->save(l);
- save_binary(ws, l * sizeof(wchar_t) / sizeof(char));
- }
- #endif
- #ifndef BOOST_NO_STD_WSTRING
- template<class Archive, class Elem, class Tr>
- BOOST_ARCHIVE_OR_WARCHIVE_DECL void
- basic_binary_oprimitive<Archive, Elem, Tr>::save(const std::wstring &ws)
- {
- std::size_t l = ws.size();
- this->This()->save(l);
- save_binary(ws.data(), l * sizeof(wchar_t) / sizeof(char));
- }
- #endif
- #endif
- template<class Archive, class Elem, class Tr>
- BOOST_ARCHIVE_OR_WARCHIVE_DECL
- basic_binary_oprimitive<Archive, Elem, Tr>::basic_binary_oprimitive(
- std::basic_streambuf<Elem, Tr> & sb,
- bool no_codecvt
- ) :
- #ifndef BOOST_NO_STD_LOCALE
- m_sb(sb),
- codecvt_null_facet(1),
- locale_saver(m_sb),
- archive_locale(sb.getloc(), & codecvt_null_facet)
- {
- if(! no_codecvt){
- m_sb.pubsync();
- m_sb.pubimbue(archive_locale);
- }
- }
- #else
- m_sb(sb)
- {}
- #endif
- template<class Archive, class Elem, class Tr>
- BOOST_ARCHIVE_OR_WARCHIVE_DECL
- basic_binary_oprimitive<Archive, Elem, Tr>::~basic_binary_oprimitive(){}
- }
- }
|