sl@0: #ifndef BOOST_ARCHIVE_XML_OARCHIVE_HPP sl@0: #define BOOST_ARCHIVE_XML_OARCHIVE_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: // xml_oarchive.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: #include // size_t sl@0: #include 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 xml_oarchive_impl : sl@0: public basic_text_oprimitive, sl@0: public basic_xml_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_xml_oarchive; sl@0: friend class save_access; sl@0: protected: sl@0: #endif sl@0: void end_preamble(){ sl@0: basic_xml_oarchive::end_preamble(); sl@0: } sl@0: template sl@0: void save(const T & t){ sl@0: basic_text_oprimitive::save(t); sl@0: } sl@0: BOOST_ARCHIVE_DECL(void) sl@0: save(const char * t); sl@0: #ifndef BOOST_NO_INTRINSIC_WCHAR_T sl@0: BOOST_ARCHIVE_DECL(void) sl@0: save(const wchar_t * t); sl@0: #endif sl@0: BOOST_ARCHIVE_DECL(void) sl@0: save(const std::string &s); sl@0: #ifndef BOOST_NO_STD_WSTRING sl@0: BOOST_ARCHIVE_DECL(void) sl@0: save(const std::wstring &ws); sl@0: #endif sl@0: BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) sl@0: xml_oarchive_impl(std::ostream & os, unsigned int flags); sl@0: ~xml_oarchive_impl(){} sl@0: public: sl@0: void save_binary(const void *address, std::size_t count){ 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: this->indent_next = true; sl@0: } sl@0: }; sl@0: sl@0: // we use the following because we can't use sl@0: // typedef xml_oarchive_impl > xml_oarchive; sl@0: sl@0: // do not derive from this class. If you want to extend this functionality sl@0: // via inhertance, derived from xml_oarchive_impl instead. This will sl@0: // preserve correct static polymorphism. sl@0: class xml_oarchive : sl@0: public xml_oarchive_impl sl@0: { sl@0: public: sl@0: xml_oarchive(std::ostream & os, unsigned int flags = 0) : sl@0: xml_oarchive_impl(os, flags) sl@0: {} sl@0: ~xml_oarchive(){} 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::xml_oarchive) sl@0: sl@0: #include // pops abi_suffix.hpp pragmas sl@0: sl@0: #endif // BOOST_ARCHIVE_XML_OARCHIVE_HPP