Statistics
| Revision:

root / tmp / org.txm.statsengine.r.core.win32 / res / win32 / library / BH / include / boost / archive / xml_oarchive.hpp @ 2486

History | View | Annotate | Download (4 kB)

1 2486 sjacqu01
#ifndef BOOST_ARCHIVE_XML_OARCHIVE_HPP
2 2486 sjacqu01
#define BOOST_ARCHIVE_XML_OARCHIVE_HPP
3 2486 sjacqu01
4 2486 sjacqu01
// MS compatible compilers support #pragma once
5 2486 sjacqu01
#if defined(_MSC_VER)
6 2486 sjacqu01
# pragma once
7 2486 sjacqu01
#endif
8 2486 sjacqu01
9 2486 sjacqu01
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
10 2486 sjacqu01
// xml_oarchive.hpp
11 2486 sjacqu01
12 2486 sjacqu01
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
13 2486 sjacqu01
// Use, modification and distribution is subject to the Boost Software
14 2486 sjacqu01
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
15 2486 sjacqu01
// http://www.boost.org/LICENSE_1_0.txt)
16 2486 sjacqu01
17 2486 sjacqu01
//  See http://www.boost.org for updates, documentation, and revision history.
18 2486 sjacqu01
19 2486 sjacqu01
#include <ostream>
20 2486 sjacqu01
21 2486 sjacqu01
#include <cstddef> // size_t
22 2486 sjacqu01
#include <boost/config.hpp>
23 2486 sjacqu01
#if defined(BOOST_NO_STDC_NAMESPACE)
24 2486 sjacqu01
namespace std{
25 2486 sjacqu01
    using ::size_t;
26 2486 sjacqu01
} // namespace std
27 2486 sjacqu01
#endif
28 2486 sjacqu01
29 2486 sjacqu01
#include <boost/archive/detail/auto_link_archive.hpp>
30 2486 sjacqu01
#include <boost/archive/basic_text_oprimitive.hpp>
31 2486 sjacqu01
#include <boost/archive/basic_xml_oarchive.hpp>
32 2486 sjacqu01
#include <boost/archive/detail/register_archive.hpp>
33 2486 sjacqu01
#include <boost/serialization/item_version_type.hpp>
34 2486 sjacqu01
35 2486 sjacqu01
#include <boost/archive/detail/abi_prefix.hpp> // must be the last header
36 2486 sjacqu01
37 2486 sjacqu01
#ifdef BOOST_MSVC
38 2486 sjacqu01
#  pragma warning(push)
39 2486 sjacqu01
#  pragma warning(disable : 4511 4512)
40 2486 sjacqu01
#endif
41 2486 sjacqu01
42 2486 sjacqu01
namespace boost {
43 2486 sjacqu01
namespace archive {
44 2486 sjacqu01
45 2486 sjacqu01
namespace detail {
46 2486 sjacqu01
    template<class Archive> class interface_oarchive;
47 2486 sjacqu01
} // namespace detail
48 2486 sjacqu01
49 2486 sjacqu01
template<class Archive>
50 2486 sjacqu01
class BOOST_SYMBOL_VISIBLE xml_oarchive_impl :
51 2486 sjacqu01
    public basic_text_oprimitive<std::ostream>,
52 2486 sjacqu01
    public basic_xml_oarchive<Archive>
53 2486 sjacqu01
{
54 2486 sjacqu01
#ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
55 2486 sjacqu01
public:
56 2486 sjacqu01
#else
57 2486 sjacqu01
protected:
58 2486 sjacqu01
    #if BOOST_WORKAROUND(BOOST_MSVC, < 1500)
59 2486 sjacqu01
        // for some inexplicable reason insertion of "class" generates compile erro
60 2486 sjacqu01
        // on msvc 7.1
61 2486 sjacqu01
        friend detail::interface_oarchive<Archive>;
62 2486 sjacqu01
        friend basic_xml_oarchive<Archive>;
63 2486 sjacqu01
        friend save_access;
64 2486 sjacqu01
    #else
65 2486 sjacqu01
        friend class detail::interface_oarchive<Archive>;
66 2486 sjacqu01
        friend class basic_xml_oarchive<Archive>;
67 2486 sjacqu01
        friend class save_access;
68 2486 sjacqu01
    #endif
69 2486 sjacqu01
#endif
70 2486 sjacqu01
    //void end_preamble(){
71 2486 sjacqu01
    //    basic_xml_oarchive<Archive>::end_preamble();
72 2486 sjacqu01
    //}
73 2486 sjacqu01
    template<class T>
74 2486 sjacqu01
    void save(const T & t){
75 2486 sjacqu01
        basic_text_oprimitive<std::ostream>::save(t);
76 2486 sjacqu01
    }
77 2486 sjacqu01
    void
78 2486 sjacqu01
    save(const version_type & t){
79 2486 sjacqu01
        save(static_cast<const unsigned int>(t));
80 2486 sjacqu01
    }
81 2486 sjacqu01
    void
82 2486 sjacqu01
    save(const boost::serialization::item_version_type & t){
83 2486 sjacqu01
        save(static_cast<const unsigned int>(t));
84 2486 sjacqu01
    }
85 2486 sjacqu01
    BOOST_ARCHIVE_DECL void
86 2486 sjacqu01
    save(const char * t);
87 2486 sjacqu01
    #ifndef BOOST_NO_INTRINSIC_WCHAR_T
88 2486 sjacqu01
    BOOST_ARCHIVE_DECL void
89 2486 sjacqu01
    save(const wchar_t * t);
90 2486 sjacqu01
    #endif
91 2486 sjacqu01
    BOOST_ARCHIVE_DECL void
92 2486 sjacqu01
    save(const std::string &s);
93 2486 sjacqu01
    #ifndef BOOST_NO_STD_WSTRING
94 2486 sjacqu01
    BOOST_ARCHIVE_DECL void
95 2486 sjacqu01
    save(const std::wstring &ws);
96 2486 sjacqu01
    #endif
97 2486 sjacqu01
    BOOST_ARCHIVE_DECL
98 2486 sjacqu01
    xml_oarchive_impl(std::ostream & os, unsigned int flags);
99 2486 sjacqu01
    ~xml_oarchive_impl(){}
100 2486 sjacqu01
public:
101 2486 sjacqu01
    void save_binary(const void *address, std::size_t count){
102 2486 sjacqu01
        this->end_preamble();
103 2486 sjacqu01
        #if ! defined(__MWERKS__)
104 2486 sjacqu01
        this->basic_text_oprimitive<std::ostream>::save_binary(
105 2486 sjacqu01
        #else
106 2486 sjacqu01
        this->basic_text_oprimitive::save_binary(
107 2486 sjacqu01
        #endif
108 2486 sjacqu01
            address,
109 2486 sjacqu01
            count
110 2486 sjacqu01
        );
111 2486 sjacqu01
        this->indent_next = true;
112 2486 sjacqu01
    }
113 2486 sjacqu01
};
114 2486 sjacqu01
115 2486 sjacqu01
// we use the following because we can't use
116 2486 sjacqu01
// typedef xml_oarchive_impl<xml_oarchive_impl<...> > xml_oarchive;
117 2486 sjacqu01
118 2486 sjacqu01
// do not derive from this class.  If you want to extend this functionality
119 2486 sjacqu01
// via inhertance, derived from xml_oarchive_impl instead.  This will
120 2486 sjacqu01
// preserve correct static polymorphism.
121 2486 sjacqu01
class BOOST_SYMBOL_VISIBLE xml_oarchive :
122 2486 sjacqu01
    public xml_oarchive_impl<xml_oarchive>
123 2486 sjacqu01
{
124 2486 sjacqu01
public:
125 2486 sjacqu01
    xml_oarchive(std::ostream & os, unsigned int flags = 0) :
126 2486 sjacqu01
        xml_oarchive_impl<xml_oarchive>(os, flags)
127 2486 sjacqu01
    {}
128 2486 sjacqu01
    ~xml_oarchive(){}
129 2486 sjacqu01
};
130 2486 sjacqu01
131 2486 sjacqu01
} // namespace archive
132 2486 sjacqu01
} // namespace boost
133 2486 sjacqu01
134 2486 sjacqu01
// required by export
135 2486 sjacqu01
BOOST_SERIALIZATION_REGISTER_ARCHIVE(boost::archive::xml_oarchive)
136 2486 sjacqu01
137 2486 sjacqu01
#ifdef BOOST_MSVC
138 2486 sjacqu01
#pragma warning(pop)
139 2486 sjacqu01
#endif
140 2486 sjacqu01
141 2486 sjacqu01
#include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
142 2486 sjacqu01
143 2486 sjacqu01
#endif // BOOST_ARCHIVE_XML_OARCHIVE_HPP