1
// Boost string_algo library formatter.hpp header file ---------------------------//
3
// Copyright Pavol Droba 2002-2003.
5
// Distributed under the Boost Software License, Version 1.0.
6
// (See accompanying file LICENSE_1_0.txt or copy at
7
// http://www.boost.org/LICENSE_1_0.txt)
9
// See http://www.boost.org for updates, documentation, and revision history.
11
#ifndef BOOST_STRING_FORMATTER_DETAIL_HPP
12
#define BOOST_STRING_FORMATTER_DETAIL_HPP
15
#include <boost/range/iterator_range.hpp>
16
#include <boost/range/begin.hpp>
17
#include <boost/range/end.hpp>
18
#include <boost/range/const_iterator.hpp>
20
#include <boost/algorithm/string/detail/util.hpp>
22
// generic replace functors -----------------------------------------------//
28
// const format functor ----------------------------------------------------//
30
// constant format functor
31
template<typename RangeT>
35
typedef BOOST_STRING_TYPENAME
36
range_const_iterator<RangeT>::type format_iterator;
37
typedef iterator_range<format_iterator> result_type;
41
const_formatF(const RangeT& Format) :
42
m_Format(::boost::begin(Format), ::boost::end(Format)) {}
45
#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
46
template<typename Range2T>
47
result_type& operator()(const Range2T&)
53
template<typename Range2T>
54
const result_type& operator()(const Range2T&) const
63
// identity format functor ----------------------------------------------------//
65
// identity format functor
66
template<typename RangeT>
67
struct identity_formatF
70
template< typename Range2T >
71
const RangeT& operator()(const Range2T& Replace) const
73
return RangeT(::boost::begin(Replace), ::boost::end(Replace));
77
// empty format functor ( used by erase ) ------------------------------------//
79
// empty format functor
80
template< typename CharT >
83
template< typename ReplaceT >
84
empty_container<CharT> operator()(const ReplaceT&) const
86
return empty_container<CharT>();
91
} // namespace algorithm
94
#endif // BOOST_STRING_FORMATTER_DETAIL_HPP