123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116 |
- #ifndef BOOST_ARCHIVE_BASIC_TEXT_OARCHIVE_HPP
- #define BOOST_ARCHIVE_BASIC_TEXT_OARCHIVE_HPP
- #if defined(_MSC_VER) && (_MSC_VER >= 1020)
- # pragma once
- #endif
- #include <boost/assert.hpp>
- #include <boost/config.hpp>
- #include <boost/serialization/pfto.hpp>
- #include <boost/detail/workaround.hpp>
- #include <boost/archive/detail/common_oarchive.hpp>
- #include <boost/serialization/string.hpp>
- #include <boost/archive/detail/abi_prefix.hpp> // must be the last header
- #ifdef BOOST_MSVC
- # pragma warning(push)
- # pragma warning(disable : 4511 4512)
- #endif
- namespace boost {
- namespace archive {
- template<class Archive>
- class basic_text_oarchive :
- public detail::common_oarchive<Archive>
- {
- protected:
- #if BOOST_WORKAROUND(BOOST_MSVC, <= 1300) \
- || BOOST_WORKAROUND(__BORLANDC__,BOOST_TESTED_AT(0x560))
- public:
- #elif defined(BOOST_MSVC)
-
-
- friend detail::interface_oarchive<Archive>;
- #else
- friend class detail::interface_oarchive<Archive>;
- #endif
- enum {
- none,
- eol,
- space
- } delimiter;
- BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
- newtoken();
- void newline(){
- delimiter = eol;
- }
-
-
- typedef detail::common_oarchive<Archive> detail_common_oarchive;
- template<class T>
- void save_override(T & t, BOOST_PFTO int){
- this->detail_common_oarchive::save_override(t, 0);
- }
-
- void save_override(const object_id_type & t, int){
- this->This()->newline();
- this->detail_common_oarchive::save_override(t, 0);
- }
-
- void save_override(const class_id_optional_type & , int){}
- void save_override(const class_name_type & t, int){
- const std::string s(t);
- * this->This() << s;
- }
- BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
- init();
- basic_text_oarchive(unsigned int flags) :
- detail::common_oarchive<Archive>(flags),
- delimiter(none)
- {}
- ~basic_text_oarchive(){}
- };
- }
- }
- #ifdef BOOST_MSVC
- #pragma warning(pop)
- #endif
- #include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
- #endif
|