#ifndef RSG_TEXT_OARCHIVE_HPP #define RSG_TEXT_OARCHIVE_HPP // MS compatible compilers support #pragma once #if defined(_MSC_VER) && (_MSC_VER >= 1020) # pragma once #endif #include #include #include #include template class rsg_text_oarchive_impl : // don't derive from text_oarchive !!! public boost::archive::text_oarchive_impl { typedef rsg_text_oarchive_impl derived_t; #ifndef BOOST_NO_MEMBER_TEMPLATE_FRIENDS public: #else friend class boost::archive::basic_text_oarchive >; friend class boost::archive::basic_text_oprimitive; friend class boost::archive::save_access; #endif public: rsg_text_oarchive_impl(std::ostream & os, unsigned int flags = 0) : boost::archive::text_oarchive_impl( os, flags | boost::archive::no_header // skip default header checking ) { // use our own header checking if (0 == (flags & boost::archive::no_header)){ os << "" << std::endl; this->boost::archive::basic_text_oarchive::init(); } } }; class rsg_text_oarchive : // don't derive from text_oarchive !!! public rsg_text_oarchive_impl { public: rsg_text_oarchive(std::ostream& os, unsigned int flags = 0) : rsg_text_oarchive_impl(os, flags) {} }; #include #include #include namespace boost { namespace archive { // explicitly instantiate for this type of text stream template class basic_text_oarchive ; template class basic_text_oprimitive ; template class text_oarchive_impl ; template class detail::archive_pointer_oserializer ; } // namespace archive } // namespace boost #define BOOST_ARCHIVE_CUSTOM_OARCHIVE_TYPES rsg_text_oarchive #endif // RSG_TEXT_OARCHIVE_HPP