sl@0: #ifndef BOOST_ARCHIVE_TEXT_WOARCHIVE_HPP sl@0: #define BOOST_ARCHIVE_TEXT_WOARCHIVE_HPP sl@0: sl@0: // MS compatible compilers support #pragma once sl@0: #if defined(_MSC_VER) && (_MSC_VER >= 1020) sl@0: # pragma once sl@0: #endif sl@0: sl@0: /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 sl@0: // text_woarchive.hpp sl@0: sl@0: // (C) Copyright 2002 Robert Ramey - http://www.rrsd.com . sl@0: // Use, modification and distribution is subject to the Boost Software sl@0: // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at sl@0: // http://www.boost.org/LICENSE_1_0.txt) sl@0: sl@0: // See http://www.boost.org for updates, documentation, and revision history. sl@0: sl@0: #include sl@0: sl@0: #ifdef BOOST_NO_STD_WSTREAMBUF sl@0: #error "wide char i/o not supported on this platform" sl@0: #else sl@0: sl@0: #include sl@0: #include // size_t sl@0: sl@0: #if defined(BOOST_NO_STDC_NAMESPACE) sl@0: namespace std{ sl@0: using ::size_t; sl@0: } // namespace std sl@0: #endif sl@0: sl@0: #include sl@0: #include sl@0: #include sl@0: sl@0: #include // must be the last header sl@0: sl@0: namespace boost { sl@0: namespace archive { sl@0: sl@0: template sl@0: class text_woarchive_impl : sl@0: public basic_text_oprimitive, sl@0: public basic_text_oarchive sl@0: { sl@0: #ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS sl@0: public: sl@0: #else sl@0: friend class detail::interface_oarchive; sl@0: friend class basic_text_oarchive; sl@0: friend class save_access; sl@0: protected: sl@0: #endif sl@0: template sl@0: void save(const T & t){ sl@0: this->newtoken(); sl@0: basic_text_oprimitive::save(t); sl@0: } sl@0: BOOST_WARCHIVE_DECL(void) sl@0: save(const char * t); sl@0: #ifndef BOOST_NO_INTRINSIC_WCHAR_T sl@0: BOOST_WARCHIVE_DECL(void) sl@0: save(const wchar_t * t); sl@0: #endif sl@0: BOOST_WARCHIVE_DECL(void) sl@0: save(const std::string &s); sl@0: #ifndef BOOST_NO_STD_WSTRING sl@0: BOOST_WARCHIVE_DECL(void) sl@0: save(const std::wstring &ws); sl@0: #endif sl@0: text_woarchive_impl(std::wostream & os, unsigned int flags) : sl@0: basic_text_oprimitive( sl@0: os, sl@0: 0 != (flags & no_codecvt) sl@0: ), sl@0: basic_text_oarchive(flags) sl@0: { sl@0: if(0 == (flags & no_header)) sl@0: basic_text_oarchive::init(); sl@0: } sl@0: public: sl@0: void save_binary(const void *address, std::size_t count){ sl@0: put(L'\n'); sl@0: this->end_preamble(); sl@0: #if ! defined(__MWERKS__) sl@0: this->basic_text_oprimitive::save_binary( sl@0: #else sl@0: this->basic_text_oprimitive::save_binary( sl@0: #endif sl@0: address, sl@0: count sl@0: ); sl@0: put(L'\n'); sl@0: this->delimiter = this->none; sl@0: } sl@0: sl@0: }; sl@0: sl@0: // we use the following because we can't use sl@0: // typedef text_oarchive_impl > text_oarchive; sl@0: sl@0: // do not derive from this class. If you want to extend this functionality sl@0: // via inhertance, derived from text_oarchive_impl instead. This will sl@0: // preserve correct static polymorphism. sl@0: class text_woarchive : sl@0: public text_woarchive_impl sl@0: { sl@0: public: sl@0: text_woarchive(std::wostream & os, unsigned int flags = 0) : sl@0: text_woarchive_impl(os, flags) sl@0: {} sl@0: ~text_woarchive(){} sl@0: }; sl@0: sl@0: } // namespace archive sl@0: } // namespace boost sl@0: sl@0: // required by smart_cast for compilers not implementing sl@0: // partial template specialization sl@0: BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION(boost::archive::text_woarchive) sl@0: sl@0: #include // pops abi_suffix.hpp pragmas sl@0: sl@0: #endif // BOOST_NO_STD_WSTREAMBUF sl@0: #endif // BOOST_ARCHIVE_TEXT_WOARCHIVE_HPP