1 #ifndef BOOST_ARCHIVE_ITERATORS_INSERT_LINEBREAKS_HPP
2 #define BOOST_ARCHIVE_ITERATORS_INSERT_LINEBREAKS_HPP
4 // MS compatible compilers support #pragma once
5 #if defined(_MSC_VER) && (_MSC_VER >= 1020)
9 /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
10 // insert_linebreaks.hpp
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/config.hpp> // for BOOST_DEDUCED_TYPENAME
22 #if defined(BOOST_NO_STDC_NAMESPACE)
23 namespace std
{ using ::memcpy
; }
26 #include <boost/serialization/pfto.hpp>
28 #include <boost/iterator/iterator_adaptor.hpp>
29 #include <boost/iterator/iterator_traits.hpp>
35 /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
36 // insert line break every N characters
40 class CharType
= BOOST_DEDUCED_TYPENAME
boost::iterator_value
<Base
>::type
42 class insert_linebreaks
:
43 public iterator_adaptor
<
44 insert_linebreaks
<Base
, N
, CharType
>,
47 single_pass_traversal_tag
,
52 friend class boost::iterator_core_access
;
53 typedef iterator_adaptor
<
54 insert_linebreaks
<Base
, N
, CharType
>,
57 single_pass_traversal_tag
,
61 bool equal(const insert_linebreaks
<Base
, N
, CharType
> & rhs
) const {
63 // m_count == rhs.m_count
64 // && base_reference() == rhs.base_reference()
65 this->base_reference() == rhs
.base_reference()
75 ++(this->base_reference());
77 CharType
dereference() const {
80 return * (this->base_reference());
84 // make composible buy using templated constructor
86 insert_linebreaks(BOOST_PFTO_WRAPPER(T
) start
) :
87 super_t(Base(BOOST_MAKE_PFTO_WRAPPER(static_cast< T
>(start
)))),
90 // intel 7.1 doesn't like default copy constructor
91 insert_linebreaks(const insert_linebreaks
& rhs
) :
92 super_t(rhs
.base_reference()),
97 } // namespace iterators
98 } // namespace archive
101 #endif // BOOST_ARCHIVE_ITERATORS_INSERT_LINEBREAKS_HPP