1 #ifndef BOOST_ARCHIVE_ITERATORS_UNESCAPE_HPP
2 #define BOOST_ARCHIVE_ITERATORS_UNESCAPE_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>
21 #include <boost/iterator/iterator_adaptor.hpp>
22 #include <boost/pointee.hpp>
28 /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
29 // class used by text archives to translate char strings to wchar_t
30 // strings of the currently selected locale
31 template<class Derived, class Base>
33 : public boost::iterator_adaptor<
34 unescape<Derived, Base>,
36 typename pointee<Base>::type,
37 single_pass_traversal_tag,
38 typename pointee<Base>::type
41 friend class boost::iterator_core_access;
42 typedef typename boost::iterator_adaptor<
43 unescape<Derived, Base>,
45 typename pointee<Base>::type,
46 single_pass_traversal_tag,
47 typename pointee<Base>::type
50 typedef unescape<Derived, Base> this_t;
52 typedef typename this_t::value_type value_type;
53 typedef typename this_t::reference reference;
55 value_type dereference_impl() {
57 m_current_value = static_cast<Derived *>(this)->drain();
60 return m_current_value;
63 reference dereference() const {
64 return const_cast<this_t *>(this)->dereference_impl();
67 value_type m_current_value;
71 ++(this->base_reference());
85 } // namespace iterators
86 } // namespace archive
89 #endif // BOOST_ARCHIVE_ITERATORS_UNESCAPE_HPP