1 #ifndef BOOST_ARCHIVE_ITERATORS_XML_ESCAPE_HPP
2 #define BOOST_ARCHIVE_ITERATORS_XML_ESCAPE_HPP
4 // MS compatible compilers support #pragma once
9 /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
12 // (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
13 // Use, modification and distribution is subject to the Boost Software
14 // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
15 // http://www.boost.org/LICENSE_1_0.txt)
17 // See http://www.boost.org for updates, documentation, and revision history.
19 #include <boost/assert.hpp>
20 #include <boost/serialization/pfto.hpp>
21 #include <boost/archive/iterators/escape.hpp>
27 /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
28 // insert escapes into xml text
32 : public escape<xml_escape<Base>, Base>
34 friend class boost::iterator_core_access;
36 typedef escape<xml_escape<Base>, Base> super_t;
39 char fill(const char * & bstart, const char * & bend);
40 wchar_t fill(const wchar_t * & bstart, const wchar_t * & bend);
43 xml_escape(BOOST_PFTO_WRAPPER(T) start) :
44 super_t(Base(BOOST_MAKE_PFTO_WRAPPER(static_cast< T >(start))))
46 // intel 7.1 doesn't like default copy constructor
47 xml_escape(const xml_escape & rhs) :
48 super_t(rhs.base_reference())
53 char xml_escape<Base>::fill(
54 const char * & bstart,
57 char current_value = * this->base_reference();
58 switch(current_value){
86 wchar_t xml_escape<Base>::fill(
87 const wchar_t * & bstart,
88 const wchar_t * & bend
90 wchar_t current_value = * this->base_reference();
91 switch(current_value){
113 return current_value;
118 } // namespace iterators
119 } // namespace archive
122 #endif // BOOST_ARCHIVE_ITERATORS_XML_ESCAPE_HPP