Skip to content
Browse files

v1_32_0

  • Loading branch information...
1 parent 727d410 commit a26a3885fcca00a6dd7d0bf547f5bebb5c08ec51 @jwiegley jwiegley committed Dec 23, 2010
Showing with 19,708 additions and 28 deletions.
  1. +57 −8 Jamfile
  2. +8 −3 Jamfile.v2
  3. +2 −1 Jamrules
  4. 0 LICENSE_1_0.txt
  5. 0 README
  6. 0 boost-build.jam
  7. +7 −2 boost.css
  8. BIN boost.png
  9. +47 −0 boost/algorithm/minmax.hpp
  10. +551 −0 boost/algorithm/minmax_element.hpp
  11. +30 −0 boost/algorithm/string.hpp
  12. +187 −0 boost/algorithm/string/case_conv.hpp
  13. +308 −0 boost/algorithm/string/classification.hpp
  14. +266 −0 boost/algorithm/string/collection_traits.hpp
  15. +83 −0 boost/algorithm/string/compare.hpp
  16. +81 −0 boost/algorithm/string/concept.hpp
  17. +31 −0 boost/algorithm/string/config.hpp
  18. +35 −0 boost/algorithm/string/constants.hpp
  19. +60 −0 boost/algorithm/string/detail/case_conv.hpp
  20. +186 −0 boost/algorithm/string/detail/classification.hpp
  21. +621 −0 boost/algorithm/string/detail/collection_traits.hpp
  22. +205 −0 boost/algorithm/string/detail/find_format.hpp
  23. +260 −0 boost/algorithm/string/detail/find_format_all.hpp
  24. +71 −0 boost/algorithm/string/detail/find_format_store.hpp
  25. +86 −0 boost/algorithm/string/detail/find_iterator.hpp
  26. +528 −0 boost/algorithm/string/detail/finder.hpp
  27. +120 −0 boost/algorithm/string/detail/finder_regex.hpp
  28. +81 −0 boost/algorithm/string/detail/formatter.hpp
  29. +60 −0 boost/algorithm/string/detail/formatter_regex.hpp
  30. +76 −0 boost/algorithm/string/detail/predicate.hpp
  31. +160 −0 boost/algorithm/string/detail/replace_storage.hpp
  32. +197 −0 boost/algorithm/string/detail/sequence.hpp
  33. +94 −0 boost/algorithm/string/detail/trim.hpp
  34. +104 −0 boost/algorithm/string/detail/util.hpp
  35. +826 −0 boost/algorithm/string/erase.hpp
  36. +329 −0 boost/algorithm/string/find.hpp
  37. +263 −0 boost/algorithm/string/find_format.hpp
  38. +367 −0 boost/algorithm/string/find_iterator.hpp
  39. +264 −0 boost/algorithm/string/finder.hpp
  40. +92 −0 boost/algorithm/string/formatter.hpp
  41. +179 −0 boost/algorithm/string/iter_find.hpp
  42. +296 −0 boost/algorithm/string/iterator_range.hpp
  43. +377 −0 boost/algorithm/string/predicate.hpp
  44. +41 −0 boost/algorithm/string/predicate_facade.hpp
  45. +491 −0 boost/algorithm/string/regex.hpp
  46. +89 −0 boost/algorithm/string/regex_find_format.hpp
  47. +910 −0 boost/algorithm/string/replace.hpp
  48. +192 −0 boost/algorithm/string/sequence_traits.hpp
  49. +163 −0 boost/algorithm/string/split.hpp
  50. +84 −0 boost/algorithm/string/std/list_traits.hpp
  51. +100 −0 boost/algorithm/string/std/rope_traits.hpp
  52. +83 −0 boost/algorithm/string/std/slist_traits.hpp
  53. +51 −0 boost/algorithm/string/std/string_traits.hpp
  54. +25 −0 boost/algorithm/string/std_containers_traits.hpp
  55. +385 −0 boost/algorithm/string/trim.hpp
  56. +32 −0 boost/algorithm/string/yes_no_type.hpp
  57. +22 −0 boost/algorithm/string_regex.hpp
  58. +5 −9 boost/aligned_storage.hpp
  59. +3 −5 boost/any.hpp
  60. +56 −0 boost/archive/add_facet.hpp
  61. +118 −0 boost/archive/archive_exception.hpp
  62. +119 −0 boost/archive/basic_archive.hpp
  63. +128 −0 boost/archive/basic_binary_iarchive.hpp
  64. +128 −0 boost/archive/basic_binary_iprimitive.hpp
  65. +115 −0 boost/archive/basic_binary_oarchive.hpp
  66. +121 −0 boost/archive/basic_binary_oprimitive.hpp
  67. +73 −0 boost/archive/basic_text_iarchive.hpp
  68. +127 −0 boost/archive/basic_text_iprimitive.hpp
  69. +125 −0 boost/archive/basic_text_oarchive.hpp
  70. +151 −0 boost/archive/basic_text_oprimitive.hpp
  71. +68 −0 boost/archive/basic_xml_archive.hpp
  72. +105 −0 boost/archive/basic_xml_iarchive.hpp
  73. +106 −0 boost/archive/basic_xml_oarchive.hpp
  74. +89 −0 boost/archive/binary_iarchive.hpp
  75. +81 −0 boost/archive/binary_oarchive.hpp
  76. +82 −0 boost/archive/binary_wiarchive.hpp
  77. +76 −0 boost/archive/binary_woarchive.hpp
  78. +88 −0 boost/archive/codecvt_null.hpp
  79. +80 −0 boost/archive/detail/archive_pointer_iserializer.hpp
  80. +53 −0 boost/archive/detail/archive_pointer_oserializer.hpp
  81. +94 −0 boost/archive/detail/basic_iarchive.hpp
  82. +86 −0 boost/archive/detail/basic_iserializer.hpp
  83. +91 −0 boost/archive/detail/basic_oarchive.hpp
  84. +73 −0 boost/archive/detail/basic_oserializer.hpp
  85. +52 −0 boost/archive/detail/basic_pointer_iserializer.hpp
  86. +54 −0 boost/archive/detail/basic_pointer_oserializer.hpp
  87. +45 −0 boost/archive/detail/basic_serializer.hpp
  88. +54 −0 boost/archive/detail/basic_serializer_map.hpp
  89. +94 −0 boost/archive/detail/common_iarchive.hpp
  90. +77 −0 boost/archive/detail/common_oarchive.hpp
  91. +120 −0 boost/archive/detail/interface_iarchive.hpp
  92. +119 −0 boost/archive/detail/interface_oarchive.hpp
  93. +535 −0 boost/archive/detail/iserializer.hpp
  94. +145 −0 boost/archive/detail/known_archive_types.hpp
  95. +39 −0 boost/archive/detail/known_archive_types_fwd.hpp
  96. +557 −0 boost/archive/detail/oserializer.hpp
  97. +203 −0 boost/archive/detail/polymorphic_iarchive_impl.hpp
  98. +203 −0 boost/archive/detail/polymorphic_oarchive_impl.hpp
  99. +230 −0 boost/archive/dinkumware.hpp
  100. +47 −0 boost/archive/impl/archive_pointer_iserializer.ipp
  101. +47 −0 boost/archive/impl/archive_pointer_oserializer.ipp
  102. +150 −0 boost/archive/impl/basic_binary_iprimitive.ipp
  103. +119 −0 boost/archive/impl/basic_binary_oprimitive.ipp
  104. +44 −0 boost/archive/impl/basic_text_iarchive.ipp
  105. +118 −0 boost/archive/impl/basic_text_iprimitive.ipp
  106. +100 −0 boost/archive/impl/basic_text_oprimitive.ipp
  107. +214 −0 boost/archive/impl/basic_xml_grammar.hpp
  108. +94 −0 boost/archive/impl/basic_xml_iarchive.ipp
  109. +179 −0 boost/archive/impl/basic_xml_oarchive.ipp
  110. +91 −0 boost/archive/impl/text_iarchive_impl.ipp
  111. +85 −0 boost/archive/impl/text_oarchive_impl.ipp
  112. +98 −0 boost/archive/impl/text_wiarchive_impl.ipp
  113. +84 −0 boost/archive/impl/text_woarchive_impl.ipp
  114. +178 −0 boost/archive/impl/xml_iarchive_impl.ipp
  115. +111 −0 boost/archive/impl/xml_oarchive_impl.ipp
  116. +177 −0 boost/archive/impl/xml_wiarchive_impl.ipp
  117. +176 −0 boost/archive/impl/xml_woarchive_impl.ipp
  118. +68 −0 boost/archive/iterators/base64_exception.hpp
  119. +106 −0 boost/archive/iterators/base64_from_binary.hpp
  120. +115 −0 boost/archive/iterators/binary_from_base64.hpp
  121. +104 −0 boost/archive/iterators/dataflow.hpp
  122. +80 −0 boost/archive/iterators/dataflow_exception.hpp
  123. +98 −0 boost/archive/iterators/escape.hpp
  124. +81 −0 boost/archive/iterators/head_iterator.hpp
  125. +101 −0 boost/archive/iterators/insert_linebreaks.hpp
  126. +94 −0 boost/archive/iterators/istream_iterator.hpp
  127. +131 −0 boost/archive/iterators/mb_from_wchar.hpp
  128. +83 −0 boost/archive/iterators/ostream_iterator.hpp
  129. +188 −0 boost/archive/iterators/remove_whitespace.hpp
  130. +168 −0 boost/archive/iterators/transform_width.hpp
  131. +93 −0 boost/archive/iterators/unescape.hpp
  132. +129 −0 boost/archive/iterators/wchar_from_mb.hpp
  133. +125 −0 boost/archive/iterators/xml_escape.hpp
  134. +118 −0 boost/archive/iterators/xml_unescape.hpp
  135. +49 −0 boost/archive/iterators/xml_unescape_exception.hpp
  136. +40 −0 boost/archive/polymorphic_binary_iarchive.hpp
  137. +40 −0 boost/archive/polymorphic_binary_oarchive.hpp
  138. +140 −0 boost/archive/polymorphic_iarchive.hpp
  139. +134 −0 boost/archive/polymorphic_oarchive.hpp
  140. +40 −0 boost/archive/polymorphic_text_iarchive.hpp
  141. +40 −0 boost/archive/polymorphic_text_oarchive.hpp
Sorry, we could not display the entire diff because too many files (10,257) changed.
View
65 Jamfile 100755 → 100644
@@ -1,7 +1,6 @@
-#~ Copyright 2003, Rene Rivera.
-#~ Use, modification and distribution are subject to the
-#~ Boost Software License, Version 1.0. (See accompanying file
-#~ LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+#~ Copyright 2003-2004, Rene Rivera.
+#~ Distributed under the Boost Software License, Version 1.0.
+#~ (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
if --help in $(ARGV)
{
@@ -14,32 +13,62 @@ Usage:
Options:
--help This message.
+
-sTOOLS=<toolsets> Indicates the tools to build with.
+
+ --layout=<layout> Determines what kind of build layout to use. This
+ allows one to control the naming of the resulting
+ libraries, and the locations of the installed
+ files. Default is 'versioned'. Possible values:
+
+ versioned - Uses the Boost standard names
+ which include version number for Boost the
+ release and version and name of the
+ compiler as part of the library names. Also
+ installs the includes to a versioned
+ sub-directory.
+
+ system - Builds an install without the
+ Boost standard names, and does not install
+ includes to a versioned sub-directory. This
+ is intended for system integrators to build
+ for packaging of distributions.
Locations:
--prefix=PREFIX Install architecture independent files here.
Default; C:\\Boost on Win32
Default; /usr/local on Unix. Linux, etc.
+
--exec-prefix=EPREFIX Install architecture dependent files here.
Default; PREFIX
+
--libdir=DIR Install libraries here.
Default; EPREFIX/lib
+
--includedir=DIR Install source headers here.
Default; PREFIX/include
+
--builddir=DIR Build in this location instead of building
within the distribution tree. Recomended!
+
--stagedir=DIR When staging only, stage to the location.
Default; ./stage
Features:
+ --with-<library> Build, stage, or install the specified <library>
+ If used, teh default becomes to only build
+ indicated libraries.
+
--without-<library> Do not build, stage, or install the specified
<library>. By default all libraries attempt to build.
+
--with-python-root[=PYTHON_ROOT]
Build Boost.Python libraries with the Python
devel packages located at PYTHON_ROOT.
Default PYTHON_ROOT; C:\\tools\\python on Win32.
Default PYTHON_ROOT; /usr/local on Unix, Linux, etc.
Default PYTHON_ROOT; /usr on Cygwin.
+
--with-pydebug Build Boost.Python libraries using the
Python debug runtime.
" ;
@@ -63,6 +92,11 @@ if stage in $(ARGV)
with-install = ;
}
+# what kind of layout are we doing?
+local layout = [ MATCH "^--layout=(.*)" : $(ARGV) ] ;
+layout ?= versioned ;
+layout-$(layout) = true ;
+
# possible stage only location
local stage-locate = [ MATCH "^--stagedir=(.*)" : $(ARGV) ] ;
stage-locate ?= stage ;
@@ -102,6 +136,20 @@ if --with-pydebug in $(ARGV)
# libraries to disable building, etc.
local without-libraries = [ MATCH "^--without-(.*)" : $(ARGV) ] ;
+# libraries to enable
+local with-libraries ;
+for local arg in $(ARGV)
+{
+ switch $(arg)
+ {
+ case --with-python-root=* : local _ ;
+ case --with-pydebug : local _ ;
+
+ case --with-* :
+ with-libraries += [ MATCH "^--with-(.*)" : $(arg) ] ;
+ }
+}
+
#
project-root ;
@@ -115,13 +163,14 @@ version-tag = $(version-tag:J="_") ;
#
install-subinclude
[ MATCH ^(.*build[/\\:]$(JAMFILE))$ : [ glob-tree $(BOOST_ROOT)/libs : $(JAMFILE) ] ]
- : <exclude>$(without-libraries) ;
+ : <exclude>$(without-libraries) <include>$(with-libraries) ;
local lib-sources = [ install-sources lib ] ;
if $(lib-sources)
{
local gNOWARN_INCOMPATIBLE_BUILDS = TRUE ;
+ local gUNVERSIONED_VARIANT_TAG = [ cond $(layout-system) : TRUE ] ;
local lib-build =
debug release
@@ -145,7 +194,7 @@ if $(lib-sources)
$(lib-build)
[ unless $(with-install) $(with-stage) : <suppress>true ]
] ;
- if ! $(gIN_LIB_INCLUDE)
+ if ! $(gIN_LIB_INCLUDE) && $(layout-versioned)
{
local unversioned-files ;
if $(with-install) || $(with-stage)
@@ -187,10 +236,10 @@ if $(lib-sources)
}
}
-stage $(include-locate:D=)/boost-$(version-tag)
+stage [ cond $(layout-versioned) : $(include-locate:D=)/boost-$(version-tag) : $(include-locate:D=) ]
:
[ glob-tree $(BOOST_ROOT)/boost/compatibility/cpp_c_headers : c* ]
- [ glob-tree $(BOOST_ROOT)/boost : *.hpp *.ipp *.h ]
+ [ glob-tree $(BOOST_ROOT)/boost : *.hpp *.ipp *.h *.inc ]
:
<locate>$(include-locate:D)
<tree-subdirs>$(BOOST_ROOT)
View
11 Jamfile.v2 100755 → 100644
@@ -10,9 +10,14 @@
project boost
- : requirements <include>.
- : usage-requirements <include>.
+ : requirements <include>$(BOOST_ROOT)
+ # disable auto-linking for all targets here,
+ # primarily because it caused troubles with V2
+ <define>BOOST_ALL_NO_LIB=1
+ : usage-requirements <include>$(BOOST_ROOT)
+ : build-dir bin.v2
;
+
build-project libs/test/build ;
build-project libs/date_time/build ;
@@ -24,4 +29,4 @@ build-project libs/graph/build ;
build-project libs/python/build ;
build-project libs/thread/build ;
build-project libs/filesystem/build ;
-
+build-project libs/program_options/build ;
View
3 Jamrules 100755 → 100644
@@ -11,4 +11,5 @@ project boost ;
path-global BOOST_ROOT : . ;
# The current version of Boost.
-BOOST_VERSION ?= 1.31.0 ;
+BOOST_VERSION ?= 1.32.0 ;
+
View
0 LICENSE_1_0.txt 100755 → 100644
File mode changed.
View
0 README 100755 → 100644
File mode changed.
View
0 boost-build.jam 100755 → 100644
File mode changed.
View
9 boost.css 100755 → 100644
@@ -23,11 +23,16 @@ BODY
PRE
{
MARGIN-LEFT: 2em;
- FONT-FAMILY: Courier;
+ FONT-FAMILY: Courier,
+ monospace;
}
CODE
{
- FONT-FAMILY: Courier;
+ FONT-FAMILY: Courier,
+ monospace;
+}
+CODE.as_pre
+{
white-space: pre;
}
.index
View
BIN boost.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
47 boost/algorithm/minmax.hpp
@@ -0,0 +1,47 @@
+// (C) Copyright Herve Bronnimann 2004.
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+/*
+ Revision history:
+ 1 July 2004
+ Split the code into two headers to lessen dependence on
+ Boost.tuple. (Herve)
+ 26 June 2004
+ Added the code for the boost minmax library. (Herve)
+*/
+
+#ifndef BOOST_ALGORITHM_MINMAX_HPP
+#define BOOST_ALGORITHM_MINMAX_HPP
+
+/* PROPOSED STANDARD EXTENSIONS:
+ *
+ * minmax(a, b)
+ * Effect: (b<a) ? std::make_pair(b,a) : std::make_pair(a,b);
+ *
+ * minmax(a, b, comp)
+ * Effect: comp(b,a) ? std::make_pair(b,a) : std::make_pair(a,b);
+ *
+ */
+
+#include <boost/tuple/tuple.hpp> // for using pairs with boost::cref
+#include <boost/ref.hpp>
+
+namespace boost {
+
+ template <typename T>
+ tuple< T const&, T const& >
+ minmax(T const& a, T const& b) {
+ return (b<a) ? make_tuple(cref(b),cref(a)) : make_tuple(cref(a),cref(b));
+ }
+
+ template <typename T, class BinaryPredicate>
+ tuple< T const&, T const& >
+ minmax(T const& a, T const& b, BinaryPredicate comp) {
+ return comp(b,a) ? make_tuple(cref(b),cref(a)) : make_tuple(cref(a),cref(b));
+ }
+
+} // namespace boost
+
+#endif // BOOST_ALGORITHM_MINMAX_HPP
View
551 boost/algorithm/minmax_element.hpp
@@ -0,0 +1,551 @@
+// (C) Copyright Herve Bronnimann 2004.
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+/*
+ Revision history:
+ 1 July 2004
+ Split the code into two headers to lessen dependence on
+ Boost.tuple. (Herve)
+ 26 June 2004
+ Added the code for the boost minmax library. (Herve)
+*/
+
+#ifndef BOOST_ALGORITHM_MINMAX_ELEMENT_HPP
+#define BOOST_ALGORITHM_MINMAX_ELEMENT_HPP
+
+/* PROPOSED STANDARD EXTENSIONS:
+ *
+ * minmax_element(first, last)
+ * Effect: std::make_pair( std::min_element(first, last),
+ * std::max_element(first, last) );
+ *
+ * minmax_element(first, last, comp)
+ * Effect: std::make_pair( std::min_element(first, last, comp),
+ * std::max_element(first, last, comp) );
+ */
+
+#include <utility> // for std::pair and std::make_pair
+
+namespace boost {
+
+ namespace detail { // for obtaining a uniform version of minmax_element
+ // that compiles with VC++ 6.0 -- avoid the iterator_traits by
+ // having comparison object over iterator, not over dereferenced value
+
+ template <typename Iterator>
+ struct less_over_iter {
+ bool operator()(Iterator const& it1,
+ Iterator const& it2) const { return *it1 < *it2; }
+ };
+
+ template <typename Iterator, class BinaryPredicate>
+ struct binary_pred_over_iter {
+ explicit binary_pred_over_iter(BinaryPredicate const& p ) : m_p( p ) {}
+ bool operator()(Iterator const& it1,
+ Iterator const& it2) const { return m_p(*it1, *it2); }
+ private:
+ BinaryPredicate m_p;
+ };
+
+ // common base for the two minmax_element overloads
+
+ template <typename ForwardIter, class Compare >
+ std::pair<ForwardIter,ForwardIter>
+ basic_minmax_element(ForwardIter first, ForwardIter last, Compare comp)
+ {
+ if (first == last)
+ return std::make_pair(last,last);
+
+ ForwardIter min_result = first;
+ ForwardIter max_result = first;
+
+ // if only one element
+ ForwardIter second = first; ++second;
+ if (second == last)
+ return std::make_pair(min_result, max_result);
+
+ // treat first pair separately (only one comparison for first two elements)
+ ForwardIter potential_min_result = last;
+ if (comp(first, second))
+ max_result = second;
+ else {
+ min_result = second;
+ potential_min_result = first;
+ }
+
+ // then each element by pairs, with at most 3 comparisons per pair
+ first = ++second; if (first != last) ++second;
+ while (second != last) {
+ if (comp(first, second)) {
+ if (comp(first, min_result)) {
+ min_result = first;
+ potential_min_result = last;
+ }
+ if (comp(max_result, second))
+ max_result = second;
+ } else {
+ if (comp(second, min_result)) {
+ min_result = second;
+ potential_min_result = first;
+ }
+ if (comp(max_result, first))
+ max_result = first;
+ }
+ first = ++second;
+ if (first != last) ++second;
+ }
+
+ // if odd number of elements, treat last element
+ if (first != last) { // odd number of elements
+ if (comp(first, min_result))
+ min_result = first, potential_min_result = last;
+ else if (comp(max_result, first))
+ max_result = first;
+ }
+
+ // resolve min_result being incorrect with one extra comparison
+ // (in which case potential_min_result is necessarily the correct result)
+ if (potential_min_result != last
+ && !comp(min_result, potential_min_result))
+ min_result = potential_min_result;
+
+ return std::make_pair(min_result,max_result);
+ }
+
+ } // namespace detail
+
+ template <typename ForwardIter>
+ std::pair<ForwardIter,ForwardIter>
+ minmax_element(ForwardIter first, ForwardIter last)
+ {
+ return detail::basic_minmax_element(first, last,
+ detail::less_over_iter<ForwardIter>() );
+ }
+
+ template <typename ForwardIter, class BinaryPredicate>
+ std::pair<ForwardIter,ForwardIter>
+ minmax_element(ForwardIter first, ForwardIter last, BinaryPredicate comp)
+ {
+ return detail::basic_minmax_element(first, last,
+ detail::binary_pred_over_iter<ForwardIter,BinaryPredicate>(comp) );
+ }
+
+}
+
+/* PROPOSED BOOST EXTENSIONS
+ * In the description below, [rfirst,rlast) denotes the reversed range
+ * of [first,last). Even though the iterator type of first and last may
+ * be only a Forward Iterator, it is possible to explain the semantics
+ * by assuming that it is a Bidirectional Iterator. In the sequel,
+ * reverse(ForwardIterator&) returns the reverse_iterator adaptor.
+ * This is not how the functions would be implemented!
+ *
+ * first_min_element(first, last)
+ * Effect: std::min_element(first, last);
+ *
+ * first_min_element(first, last, comp)
+ * Effect: std::min_element(first, last, comp);
+ *
+ * last_min_element(first, last)
+ * Effect: reverse( std::min_element(reverse(last), reverse(first)) );
+ *
+ * last_min_element(first, last, comp)
+ * Effect: reverse( std::min_element(reverse(last), reverse(first), comp) );
+ *
+ * first_max_element(first, last)
+ * Effect: std::max_element(first, last);
+ *
+ * first_max_element(first, last, comp)
+ * Effect: max_element(first, last);
+ *
+ * last_max_element(first, last)
+ * Effect: reverse( std::max_element(reverse(last), reverse(first)) );
+ *
+ * last_max_element(first, last, comp)
+ * Effect: reverse( std::max_element(reverse(last), reverse(first), comp) );
+ *
+ * first_min_first_max_element(first, last)
+ * Effect: std::make_pair( first_min_element(first, last),
+ * first_max_element(first, last) );
+ *
+ * first_min_first_max_element(first, last, comp)
+ * Effect: std::make_pair( first_min_element(first, last, comp),
+ * first_max_element(first, last, comp) );
+ *
+ * first_min_last_max_element(first, last)
+ * Effect: std::make_pair( first_min_element(first, last),
+ * last_max_element(first, last) );
+ *
+ * first_min_last_max_element(first, last, comp)
+ * Effect: std::make_pair( first_min_element(first, last, comp),
+ * last_max_element(first, last, comp) );
+ *
+ * last_min_first_max_element(first, last)
+ * Effect: std::make_pair( last_min_element(first, last),
+ * first_max_element(first, last) );
+ *
+ * last_min_first_max_element(first, last, comp)
+ * Effect: std::make_pair( last_min_element(first, last, comp),
+ * first_max_element(first, last, comp) );
+ *
+ * last_min_last_max_element(first, last)
+ * Effect: std::make_pair( last_min_element(first, last),
+ * last_max_element(first, last) );
+ *
+ * last_min_last_max_element(first, last, comp)
+ * Effect: std::make_pair( last_min_element(first, last, comp),
+ * last_max_element(first, last, comp) );
+ */
+
+namespace boost {
+
+ // Min_element and max_element variants
+
+ namespace detail { // common base for the overloads
+
+ template <typename ForwardIter, class BinaryPredicate>
+ ForwardIter
+ basic_first_min_element(ForwardIter first, ForwardIter last,
+ BinaryPredicate comp)
+ {
+ if (first == last) return last;
+ ForwardIter min_result = first;
+ while (++first != last)
+ if (comp(first, min_result))
+ min_result = first;
+ return min_result;
+ }
+
+ template <typename ForwardIter, class BinaryPredicate>
+ ForwardIter
+ basic_last_min_element(ForwardIter first, ForwardIter last,
+ BinaryPredicate comp)
+ {
+ if (first == last) return last;
+ ForwardIter min_result = first;
+ while (++first != last)
+ if (!comp(min_result, first))
+ min_result = first;
+ return min_result;
+ }
+
+ template <typename ForwardIter, class BinaryPredicate>
+ ForwardIter
+ basic_first_max_element(ForwardIter first, ForwardIter last,
+ BinaryPredicate comp)
+ {
+ if (first == last) return last;
+ ForwardIter max_result = first;
+ while (++first != last)
+ if (comp(max_result, first))
+ max_result = first;
+ return max_result;
+ }
+
+ template <typename ForwardIter, class BinaryPredicate>
+ ForwardIter
+ basic_last_max_element(ForwardIter first, ForwardIter last,
+ BinaryPredicate comp)
+ {
+ if (first == last) return last;
+ ForwardIter max_result = first;
+ while (++first != last)
+ if (!comp(first, max_result))
+ max_result = first;
+ return max_result;
+ }
+
+ } // namespace detail
+
+ template <typename ForwardIter>
+ ForwardIter
+ first_min_element(ForwardIter first, ForwardIter last)
+ {
+ return detail::basic_first_min_element(first, last,
+ detail::less_over_iter<ForwardIter>() );
+ }
+
+ template <typename ForwardIter, class BinaryPredicate>
+ ForwardIter
+ first_min_element(ForwardIter first, ForwardIter last, BinaryPredicate comp)
+ {
+ return detail::basic_first_min_element(first, last,
+ detail::binary_pred_over_iter<ForwardIter,BinaryPredicate>(comp) );
+ }
+
+ template <typename ForwardIter>
+ ForwardIter
+ last_min_element(ForwardIter first, ForwardIter last)
+ {
+ return detail::basic_last_min_element(first, last,
+ detail::less_over_iter<ForwardIter>() );
+ }
+
+ template <typename ForwardIter, class BinaryPredicate>
+ ForwardIter
+ last_min_element(ForwardIter first, ForwardIter last, BinaryPredicate comp)
+ {
+ return detail::basic_last_min_element(first, last,
+ detail::binary_pred_over_iter<ForwardIter,BinaryPredicate>(comp) );
+ }
+
+ template <typename ForwardIter>
+ ForwardIter
+ first_max_element(ForwardIter first, ForwardIter last)
+ {
+ return detail::basic_first_max_element(first, last,
+ detail::less_over_iter<ForwardIter>() );
+ }
+
+ template <typename ForwardIter, class BinaryPredicate>
+ ForwardIter
+ first_max_element(ForwardIter first, ForwardIter last, BinaryPredicate comp)
+ {
+ return detail::basic_first_max_element(first, last,
+ detail::binary_pred_over_iter<ForwardIter,BinaryPredicate>(comp) );
+ }
+
+ template <typename ForwardIter>
+ ForwardIter
+ last_max_element(ForwardIter first, ForwardIter last)
+ {
+ return detail::basic_last_max_element(first, last,
+ detail::less_over_iter<ForwardIter>() );
+ }
+
+ template <typename ForwardIter, class BinaryPredicate>
+ ForwardIter
+ last_max_element(ForwardIter first, ForwardIter last, BinaryPredicate comp)
+ {
+ return detail::basic_last_max_element(first, last,
+ detail::binary_pred_over_iter<ForwardIter,BinaryPredicate>(comp) );
+ }
+
+
+ // Minmax_element variants -- comments removed
+
+ namespace detail {
+
+ template <typename ForwardIter, class BinaryPredicate>
+ std::pair<ForwardIter,ForwardIter>
+ basic_first_min_last_max_element(ForwardIter first, ForwardIter last,
+ BinaryPredicate comp)
+ {
+ if (first == last)
+ return std::make_pair(last,last);
+
+ ForwardIter min_result = first;
+ ForwardIter max_result = first;
+
+ ForwardIter second = ++first;
+ if (second == last)
+ return std::make_pair(min_result, max_result);
+
+ if (comp(second, min_result))
+ min_result = second;
+ else
+ max_result = second;
+
+ first = ++second; if (first != last) ++second;
+ while (second != last) {
+ if (!comp(second, first)) {
+ if (comp(first, min_result))
+ min_result = first;
+ if (!comp(second, max_result))
+ max_result = second;
+ } else {
+ if (comp(second, min_result))
+ min_result = second;
+ if (!comp(first, max_result))
+ max_result = first;
+ }
+ first = ++second; if (first != last) ++second;
+ }
+
+ if (first != last) {
+ if (comp(first, min_result))
+ min_result = first;
+ else if (!comp(first, max_result))
+ max_result = first;
+ }
+
+ return std::make_pair(min_result, max_result);
+ }
+
+ template <typename ForwardIter, class BinaryPredicate>
+ std::pair<ForwardIter,ForwardIter>
+ basic_last_min_first_max_element(ForwardIter first, ForwardIter last,
+ BinaryPredicate comp)
+ {
+ if (first == last) return std::make_pair(last,last);
+
+ ForwardIter min_result = first;
+ ForwardIter max_result = first;
+
+ ForwardIter second = ++first;
+ if (second == last)
+ return std::make_pair(min_result, max_result);
+
+ if (comp(max_result, second))
+ max_result = second;
+ else
+ min_result = second;
+
+ first = ++second; if (first != last) ++second;
+ while (second != last) {
+ if (comp(first, second)) {
+ if (!comp(min_result, first))
+ min_result = first;
+ if (comp(max_result, second))
+ max_result = second;
+ } else {
+ if (!comp(min_result, second))
+ min_result = second;
+ if (comp(max_result, first))
+ max_result = first;
+ }
+ first = ++second; if (first != last) ++second;
+ }
+
+ if (first != last) {
+ if (!comp(min_result, first))
+ min_result = first;
+ else if (comp(max_result, first))
+ max_result = first;
+ }
+
+ return std::make_pair(min_result, max_result);
+ }
+
+ template <typename ForwardIter, class BinaryPredicate>
+ std::pair<ForwardIter,ForwardIter>
+ basic_last_min_last_max_element(ForwardIter first, ForwardIter last,
+ BinaryPredicate comp)
+ {
+ if (first == last) return std::make_pair(last,last);
+
+ ForwardIter min_result = first;
+ ForwardIter max_result = first;
+
+ ForwardIter second = first; ++second;
+ if (second == last)
+ return std::make_pair(min_result,max_result);
+
+ ForwardIter potential_max_result = last;
+ if (comp(first, second))
+ max_result = second;
+ else {
+ min_result = second;
+ potential_max_result = second;
+ }
+
+ first = ++second; if (first != last) ++second;
+ while (second != last) {
+ if (comp(first, second)) {
+ if (!comp(min_result, first))
+ min_result = first;
+ if (!comp(second, max_result)) {
+ max_result = second;
+ potential_max_result = last;
+ }
+ } else {
+ if (!comp(min_result, second))
+ min_result = second;
+ if (!comp(first, max_result)) {
+ max_result = first;
+ potential_max_result = second;
+ }
+ }
+ first = ++second;
+ if (first != last) ++second;
+ }
+
+ if (first != last) {
+ if (!comp(min_result, first))
+ min_result = first;
+ if (!comp(first, max_result)) {
+ max_result = first;
+ potential_max_result = last;
+ }
+ }
+
+ if (potential_max_result != last
+ && !comp(potential_max_result, max_result))
+ max_result = potential_max_result;
+
+ return std::make_pair(min_result,max_result);
+ }
+
+ } // namespace detail
+
+ template <typename ForwardIter>
+ inline std::pair<ForwardIter,ForwardIter>
+ first_min_first_max_element(ForwardIter first, ForwardIter last)
+ {
+ return minmax_element(first, last);
+ }
+
+ template <typename ForwardIter, class BinaryPredicate>
+ inline std::pair<ForwardIter,ForwardIter>
+ first_min_first_max_element(ForwardIter first, ForwardIter last,
+ BinaryPredicate comp)
+ {
+ return minmax_element(first, last, comp);
+ }
+
+ template <typename ForwardIter>
+ std::pair<ForwardIter,ForwardIter>
+ first_min_last_max_element(ForwardIter first, ForwardIter last)
+ {
+ return detail::basic_first_min_last_max_element(first, last,
+ detail::less_over_iter<ForwardIter>() );
+ }
+
+ template <typename ForwardIter, class BinaryPredicate>
+ inline std::pair<ForwardIter,ForwardIter>
+ first_min_last_max_element(ForwardIter first, ForwardIter last,
+ BinaryPredicate comp)
+ {
+ return detail::basic_first_min_last_max_element(first, last,
+ detail::binary_pred_over_iter<ForwardIter,BinaryPredicate>(comp) );
+ }
+
+ template <typename ForwardIter>
+ std::pair<ForwardIter,ForwardIter>
+ last_min_first_max_element(ForwardIter first, ForwardIter last)
+ {
+ return detail::basic_last_min_first_max_element(first, last,
+ detail::less_over_iter<ForwardIter>() );
+ }
+
+ template <typename ForwardIter, class BinaryPredicate>
+ inline std::pair<ForwardIter,ForwardIter>
+ last_min_first_max_element(ForwardIter first, ForwardIter last,
+ BinaryPredicate comp)
+ {
+ return detail::basic_last_min_first_max_element(first, last,
+ detail::binary_pred_over_iter<ForwardIter,BinaryPredicate>(comp) );
+ }
+
+ template <typename ForwardIter>
+ std::pair<ForwardIter,ForwardIter>
+ last_min_last_max_element(ForwardIter first, ForwardIter last)
+ {
+ return detail::basic_last_min_last_max_element(first, last,
+ detail::less_over_iter<ForwardIter>() );
+ }
+
+ template <typename ForwardIter, class BinaryPredicate>
+ inline std::pair<ForwardIter,ForwardIter>
+ last_min_last_max_element(ForwardIter first, ForwardIter last,
+ BinaryPredicate comp)
+ {
+ return detail::basic_last_min_last_max_element(first, last,
+ detail::binary_pred_over_iter<ForwardIter,BinaryPredicate>(comp) );
+ }
+
+} // namespace boost
+
+#endif // BOOST_ALGORITHM_MINMAX_ELEMENT_HPP
View
30 boost/algorithm/string.hpp
@@ -0,0 +1,30 @@
+// Boost string_algo library string_algo.hpp header file ---------------------------//
+
+// Copyright Pavol Droba 2002-2004. Use, modification and
+// distribution is subject to the Boost Software License, Version
+// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// See http://www.boost.org for updates, documentation, and revision history.
+
+#ifndef BOOST_STRING_ALGO_HPP
+#define BOOST_STRING_ALGO_HPP
+
+/*! \file
+ Cumulative include for string_algo library
+*/
+
+#include <boost/algorithm/string/std_containers_traits.hpp>
+#include <boost/algorithm/string/iterator_range.hpp>
+#include <boost/algorithm/string/trim.hpp>
+#include <boost/algorithm/string/case_conv.hpp>
+#include <boost/algorithm/string/predicate.hpp>
+#include <boost/algorithm/string/find.hpp>
+#include <boost/algorithm/string/split.hpp>
+#include <boost/algorithm/string/replace.hpp>
+#include <boost/algorithm/string/erase.hpp>
+#include <boost/algorithm/string/classification.hpp>
+#include <boost/algorithm/string/find_iterator.hpp>
+
+
+#endif // BOOST_STRING_ALGO_HPP
View
187 boost/algorithm/string/case_conv.hpp
@@ -0,0 +1,187 @@
+// Boost string_algo library case_conv.hpp header file ---------------------------//
+
+// Copyright Pavol Droba 2002-2003. Use, modification and
+// distribution is subject to the Boost Software License, Version
+// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// See http://www.boost.org for updates, documentation, and revision history.
+
+#ifndef BOOST_STRING_CASE_CONV_HPP
+#define BOOST_STRING_CASE_CONV_HPP
+
+#include <boost/algorithm/string/config.hpp>
+#include <algorithm>
+#include <locale>
+#include <boost/iterator/transform_iterator.hpp>
+#include <boost/algorithm/string/collection_traits.hpp>
+#include <boost/algorithm/string/detail/case_conv.hpp>
+
+/*! \file
+ Defines sequence case-conversion algorithms.
+ Algorithms convert each element in the input sequence to the
+ desired case using provided locales.
+*/
+
+namespace boost {
+ namespace algorithm {
+
+// to_lower -----------------------------------------------//
+
+ //! Convert to lower case
+ /*!
+ Each element of the input sequence is converted to lower
+ case. The result is a copy of the input converted to lower case.
+ It is returned as a sequence or copied to the output iterator.
+
+ \param Output An output iterator to which the result will be copied
+ \param Input An input collection
+ \param Loc A locale used for conversion
+ \return
+ An output iterator pointing just after the last inserted character or
+ a copy of the input
+
+ \note The second variant of this function provides the strong exception-safety guarantee
+
+ */
+ template<typename OutputIteratorT, typename CollectionT>
+ inline OutputIteratorT
+ to_lower_copy(
+ OutputIteratorT Output,
+ const CollectionT& Input,
+ const std::locale& Loc=std::locale())
+ {
+ return std::transform(
+ begin(Input),
+ end(Input),
+ Output,
+ detail::to_lowerF<
+ typename value_type_of<CollectionT>::type >(Loc));
+ }
+
+ //! Convert to lower case
+ /*!
+ \overload
+ */
+ template<typename SequenceT>
+ inline SequenceT to_lower_copy(
+ const SequenceT& Input,
+ const std::locale& Loc=std::locale())
+ {
+ return SequenceT(
+ make_transform_iterator(
+ begin(Input),
+ detail::to_lowerF<
+ typename value_type_of<SequenceT>::type >(Loc)),
+ make_transform_iterator(
+ end(Input),
+ detail::to_lowerF<
+ typename value_type_of<SequenceT>::type >(Loc)));
+ }
+
+ //! Convert to lower case
+ /*!
+ Each element of the input sequence is converted to lower
+ case. The input sequence is modified in-place.
+
+ \param Input A collection
+ \param Loc a locale used for conversion
+ */
+ template<typename MutableCollectionT>
+ inline void to_lower(
+ MutableCollectionT& Input,
+ const std::locale& Loc=std::locale())
+ {
+ std::transform(
+ begin(Input),
+ end(Input),
+ begin(Input),
+ detail::to_lowerF<
+ typename value_type_of<MutableCollectionT>::type >(Loc));
+ }
+
+// to_upper -----------------------------------------------//
+
+ //! Convert to upper case
+ /*!
+ Each element of the input sequence is converted to upper
+ case. The result is a copy of the input converted to upper case.
+ It is returned as a sequence or copied to the output iterator
+
+ \param Output An output iterator to which the result will be copied
+ \param Input An input collection
+ \param Loc A locale used for conversion
+ \return
+ An output iterator pointing just after the last inserted character or
+ a copy of the input
+
+ \note The second variant of this function provides the strong exception-safety guarantee
+ */
+ template<typename OutputIteratorT, typename CollectionT>
+ inline OutputIteratorT
+ to_upper_copy(
+ OutputIteratorT Output,
+ const CollectionT& Input,
+ const std::locale& Loc=std::locale())
+ {
+ return std::transform(
+ begin(Input),
+ end(Input),
+ Output,
+ detail::to_upperF<
+ typename value_type_of<CollectionT>::type >(Loc));
+ }
+
+ //! Convert to upper case
+ /*!
+ \overload
+ */
+ template<typename SequenceT>
+ inline SequenceT to_upper_copy(
+ const SequenceT& Input,
+ const std::locale& Loc=std::locale())
+ {
+ return SequenceT(
+ make_transform_iterator(
+ begin(Input),
+ detail::to_upperF<
+ typename value_type_of<SequenceT>::type >(Loc)),
+ make_transform_iterator(
+ end(Input),
+ detail::to_upperF<
+ typename value_type_of<SequenceT>::type >(Loc)));
+
+ }
+
+ //! Convert to upper case
+ /*!
+ Each element of the input sequence is converted to upper
+ case. The input sequence is modified in-place.
+
+ \param Input An input collection
+ \param Loc a locale used for conversion
+ */
+ template<typename MutableCollectionT>
+ inline void to_upper(
+ MutableCollectionT& Input,
+ const std::locale& Loc=std::locale())
+ {
+ std::transform(
+ begin(Input),
+ end(Input),
+ begin(Input),
+ detail::to_upperF<
+ typename value_type_of<MutableCollectionT>::type >(Loc));
+ }
+
+ } // namespace algorithm
+
+ // pull names to the boost namespace
+ using algorithm::to_lower;
+ using algorithm::to_lower_copy;
+ using algorithm::to_upper;
+ using algorithm::to_upper_copy;
+
+} // namespace boost
+
+#endif // BOOST_STRING_CASE_CONV_HPP
View
308 boost/algorithm/string/classification.hpp
@@ -0,0 +1,308 @@
+// Boost string_algo library classification.hpp header file ---------------------------//
+
+// Copyright Pavol Droba 2002-2003. Use, modification and
+// distribution is subject to the Boost Software License, Version
+// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// See http://www.boost.org for updates, documentation, and revision history.
+
+#ifndef BOOST_STRING_CLASSIFICATION_HPP
+#define BOOST_STRING_CLASSIFICATION_HPP
+
+#include <algorithm>
+#include <locale>
+#include <boost/algorithm/string/detail/classification.hpp>
+#include <boost/algorithm/string/predicate_facade.hpp>
+
+/*! \file
+ Classification predicates are included in the library to give
+ some more convenience when using algorithms like \c trim() and \c all().
+ They wrap functionality of STL classification functions ( e.g. \c std::isspace() )
+ into generic functors.
+*/
+
+namespace boost {
+ namespace algorithm {
+
+// classification functor generator -------------------------------------//
+
+ //! is_classified predicate
+ /*!
+ Construct the \c is_classified predicate. This predicate holds if the input is
+ of specified \c std::ctype category.
+
+ \param Type A \c std::ctype category
+ \param Loc A locale used for classification
+ \return An instance of the \c is_classified predicate
+ */
+ inline detail::is_classifiedF
+ is_classified(std::ctype_base::mask Type, const std::locale& Loc=std::locale())
+ {
+ return detail::is_classifiedF(Type, Loc);
+ }
+
+ //! is_space predicate
+ /*!
+ Construct the \c is_classified predicate for the \c ctype_base::space category.
+
+ \param Loc A locale used for classification
+ \return An instance of the \c is_classified predicate
+ */
+ inline detail::is_classifiedF
+ is_space(const std::locale& Loc=std::locale())
+ {
+ return detail::is_classifiedF(std::ctype_base::space, Loc);
+ }
+
+ //! is_alnum predicate
+ /*!
+ Construct the \c is_classified predicate for the \c ctype_base::alnum category.
+
+ \param Loc A locale used for classification
+ \return An instance of the \c is_classified predicate
+ */
+ inline detail::is_classifiedF
+ is_alnum(const std::locale& Loc=std::locale())
+ {
+ return detail::is_classifiedF(std::ctype_base::alnum, Loc);
+ }
+
+ //! is_alpha predicate
+ /*!
+ Construct the \c is_classified predicate for the \c ctype_base::alpha category.
+
+ \param Loc A locale used for classification
+ \return An instance of the \c is_classified predicate
+ */
+ inline detail::is_classifiedF
+ is_alpha(const std::locale& Loc=std::locale())
+ {
+ return detail::is_classifiedF(std::ctype_base::alpha, Loc);
+ }
+
+ //! is_cntrl predicate
+ /*!
+ Construct the \c is_classified predicate for the \c ctype_base::cntrl category.
+
+ \param Loc A locale used for classification
+ \return An instance of the \c is_classified predicate
+ */
+ inline detail::is_classifiedF
+ is_cntrl(const std::locale& Loc=std::locale())
+ {
+ return detail::is_classifiedF(std::ctype_base::cntrl, Loc);
+ }
+
+ //! is_digit predicate
+ /*!
+ Construct the \c is_classified predicate for the \c ctype_base::digit category.
+
+ \param Loc A locale used for classification
+ \return An instance of the \c is_classified predicate
+ */
+ inline detail::is_classifiedF
+ is_digit(const std::locale& Loc=std::locale())
+ {
+ return detail::is_classifiedF(std::ctype_base::digit, Loc);
+ }
+
+ //! is_graph predicate
+ /*!
+ Construct the \c is_classified predicate for the \c ctype_base::graph category.
+
+ \param Loc A locale used for classification
+ \return An instance of the \c is_classified predicate
+ */
+ inline detail::is_classifiedF
+ is_graph(const std::locale& Loc=std::locale())
+ {
+ return detail::is_classifiedF(std::ctype_base::graph, Loc);
+ }
+
+ //! is_lower predicate
+ /*!
+ Construct the \c is_classified predicate for the \c ctype_base::lower category.
+
+ \param Loc A locale used for classification
+ \return An instance of \c is_classified predicate
+ */
+ inline detail::is_classifiedF
+ is_lower(const std::locale& Loc=std::locale())
+ {
+ return detail::is_classifiedF(std::ctype_base::lower, Loc);
+ }
+
+ //! is_print predicate
+ /*!
+ Construct the \c is_classified predicate for the \c ctype_base::print category.
+
+ \param Loc A locale used for classification
+ \return An instance of the \c is_classified predicate
+ */
+ inline detail::is_classifiedF
+ is_print(const std::locale& Loc=std::locale())
+ {
+ return detail::is_classifiedF(std::ctype_base::print, Loc);
+ }
+
+ //! is_punct predicate
+ /*!
+ Construct the \c is_classified predicate for the \c ctype_base::punct category.
+
+ \param Loc A locale used for classification
+ \return An instance of the \c is_classified predicate
+ */
+ inline detail::is_classifiedF
+ is_punct(const std::locale& Loc=std::locale())
+ {
+ return detail::is_classifiedF(std::ctype_base::punct, Loc);
+ }
+
+ //! is_upper predicate
+ /*!
+ Construct the \c is_classified predicate for the \c ctype_base::upper category.
+
+ \param Loc A locale used for classification
+ \return An instance of the \c is_classified predicate
+ */
+ inline detail::is_classifiedF
+ is_upper(const std::locale& Loc=std::locale())
+ {
+ return detail::is_classifiedF(std::ctype_base::upper, Loc);
+ }
+
+ //! is_xdigit predicate
+ /*!
+ Construct the \c is_classified predicate for the \c ctype_base::xdigit category.
+
+ \param Loc A locale used for classification
+ \return An instance of the \c is_classified predicate
+ */
+ inline detail::is_classifiedF
+ is_xdigit(const std::locale& Loc=std::locale())
+ {
+ return detail::is_classifiedF(std::ctype_base::xdigit, Loc);
+ }
+
+ //! is_any_of predicate
+ /*!
+ Construct the \c is_any_of predicate. The predicate holds if the input
+ is included in the specified set of characters.
+
+ \param Set A set of characters to be recognized
+ \return An instance of the \c is_any_of predicate
+ */
+ template<typename ContainerT>
+ inline detail::is_any_ofF<
+ BOOST_STRING_TYPENAME value_type_of<ContainerT>::type>
+ is_any_of( const ContainerT& Set )
+ {
+ return detail::is_any_ofF<
+ BOOST_STRING_TYPENAME value_type_of<ContainerT>::type>(Set);
+ }
+
+ //! is_from_range predicate
+ /*!
+ Construct the \c is_from_range predicate. The predicate holds if the input
+ is included in the specified range. (i.e. From <= Ch <= To )
+
+ \param From The start of the range
+ \param To The end of the range
+ \return An instance of the \c is_from_range predicate
+ */
+ template<typename CharT>
+ inline detail::is_from_rangeF<CharT> is_from_range(CharT From, CharT To)
+ {
+ return detail::is_from_rangeF<CharT>(From,To);
+ }
+
+ // predicate combinators ---------------------------------------------------//
+
+ //! predicate 'and' composition predicate
+ /*!
+ Construct the \c class_and predicate. This predicate can be used
+ to logically combine two classification predicates. \c class_and holds,
+ if both predicates return true.
+
+ \param Pred1 The first predicate
+ \param Pred2 The second predicate
+ \return An instance of the \c class_and predicate
+ */
+ template<typename Pred1T, typename Pred2T>
+ inline detail::pred_andF<Pred1T, Pred2T>
+ operator&&(
+ const predicate_facade<Pred1T>& Pred1,
+ const predicate_facade<Pred2T>& Pred2 )
+ {
+ // Doing the static_cast with the pointer instead of the reference
+ // is a workaround for some compilers which have problems with
+ // static_cast's of template references, i.e. CW8. /grafik/
+ return detail::pred_andF<Pred1T,Pred2T>(
+ *static_cast<const Pred1T*>(&Pred1),
+ *static_cast<const Pred2T*>(&Pred2) );
+ }
+
+ //! predicate 'or' composition predicate
+ /*!
+ Construct the \c class_or predicate. This predicate can be used
+ to logically combine two classification predicates. \c class_or holds,
+ if one of the predicates return true.
+
+ \param Pred1 The first predicate
+ \param Pred2 The second predicate
+ \return An instance of the \c class_or predicate
+ */
+ template<typename Pred1T, typename Pred2T>
+ inline detail::pred_orF<Pred1T, Pred2T>
+ operator||(
+ const predicate_facade<Pred1T>& Pred1,
+ const predicate_facade<Pred2T>& Pred2 )
+ {
+ // Doing the static_cast with the pointer instead of the reference
+ // is a workaround for some compilers which have problems with
+ // static_cast's of template references, i.e. CW8. /grafik/
+ return detail::pred_orF<Pred1T,Pred2T>(
+ *static_cast<const Pred1T*>(&Pred1),
+ *static_cast<const Pred2T*>(&Pred2));
+ }
+
+ //! predicate negation operator
+ /*!
+ Construct the \c class_not predicate. This predicate represents a negation.
+ \c class_or holds if of the predicates return false.
+
+ \param Pred The predicate to be negated
+ \return An instance of the \c class_not predicate
+ */
+ template<typename PredT>
+ inline detail::pred_notF<PredT>
+ operator!( const predicate_facade<PredT>& Pred )
+ {
+ // Doing the static_cast with the pointer instead of the reference
+ // is a workaround for some compilers which have problems with
+ // static_cast's of template references, i.e. CW8. /grafik/
+ return detail::pred_notF<PredT>(*static_cast<const PredT*>(&Pred));
+ }
+
+ } // namespace algorithm
+
+ // pull names to the boost namespace
+ using algorithm::is_classified;
+ using algorithm::is_space;
+ using algorithm::is_alnum;
+ using algorithm::is_alpha;
+ using algorithm::is_cntrl;
+ using algorithm::is_digit;
+ using algorithm::is_graph;
+ using algorithm::is_lower;
+ using algorithm::is_upper;
+ using algorithm::is_print;
+ using algorithm::is_punct;
+ using algorithm::is_xdigit;
+ using algorithm::is_any_of;
+ using algorithm::is_from_range;
+
+} // namespace boost
+
+#endif // BOOST_STRING_PREDICATE_HPP
View
266 boost/algorithm/string/collection_traits.hpp
@@ -0,0 +1,266 @@
+// Boost string_algo library collection_traits.hpp header file -------------//
+
+// Copyright Pavol Droba 2002-2003. Use, modification and
+// distribution is subject to the Boost Software License, Version
+// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// (C) Copyright Thorsten Ottosen 2002-2003. Use, modification and
+// distribution is subject to the Boost Software License, Version
+// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// (C) Copyright Jeremy Siek 2001. Use, modification and
+// distribution is subject to the Boost Software License, Version
+// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// Original idea of container traits was proposed by Jeremy Siek and
+// Thorsten Ottosen. This implementation is lightweighted version
+// of container_traits adapter for usage with string_algo library
+
+#ifndef BOOST_STRING_COLLECTION_TRAITS_HPP
+#define BOOST_STRING_COLLECTION_TRAITS_HPP
+
+#include <boost/algorithm/string/config.hpp>
+#include <boost/type_traits/is_array.hpp>
+#include <boost/type_traits/is_pointer.hpp>
+#include <boost/mpl/eval_if.hpp>
+
+// Implementation
+#include <boost/algorithm/string/detail/collection_traits.hpp>
+
+/*! \file
+ Defines collection_traits class and related free-standing functions.
+ This facility is used to unify the access to different types of collections.
+ It allows the algorithms in the library to work with STL collections, c-style
+ array, null-terminated c-strings (and more) using the same interface.
+*/
+
+namespace boost {
+ namespace algorithm {
+
+// collection_traits template class -----------------------------------------//
+
+ //! collection_traits class
+ /*!
+ Collection traits provide uniform access to different types of
+ collections. This functionality allows to write generic algorithms
+ which work with several different kinds of collections.
+
+ Currently following collection types are supported:
+ - containers with STL compatible container interface ( see ContainerConcept )
+ ( i.e. \c std::vector<>, \c std::list<>, \c std::string<> ... )
+ - c-style array
+ ( \c char[10], \c int[15] ... )
+ - null-terminated c-strings
+ ( \c char*, \c wchar_T* )
+ - std::pair of iterators
+ ( i.e \c std::pair<vector<int>::iterator,vector<int>::iterator> )
+
+ Collection traits provide an external collection interface operations.
+ All are accessible using free-standing functions.
+
+ The following operations are supported:
+ - \c size()
+ - \c empty()
+ - \c begin()
+ - \c end()
+
+ Container traits have somewhat limited functionality on compilers not
+ supporting partial template specialization and partial template ordering.
+ */
+ template< typename T >
+ struct collection_traits
+ {
+ private:
+ typedef BOOST_STRING_TYPENAME ::boost::mpl::eval_if<
+ ::boost::algorithm::detail::is_pair<T>,
+ detail::pair_container_traits_selector<T>,
+ BOOST_STRING_TYPENAME ::boost::mpl::eval_if<
+ ::boost::is_array<T>,
+ detail::array_container_traits_selector<T>,
+ BOOST_STRING_TYPENAME ::boost::mpl::eval_if<
+ ::boost::is_pointer<T>,
+ detail::pointer_container_traits_selector<T>,
+ detail::default_container_traits_selector<T>
+ >
+ >
+ >::type container_helper_type;
+ public:
+ //! Function type
+ typedef container_helper_type function_type;
+ //! Value type
+ typedef BOOST_STRING_TYPENAME
+ container_helper_type::value_type value_type;
+ //! Size type
+ typedef BOOST_STRING_TYPENAME
+ container_helper_type::size_type size_type;
+ //! Iterator type
+ typedef BOOST_STRING_TYPENAME
+ container_helper_type::iterator iterator;
+ //! Const iterator type
+ typedef BOOST_STRING_TYPENAME
+ container_helper_type::const_iterator const_iterator;
+ //! Result iterator type ( iterator of const_iterator, depending on the constness of the container )
+ typedef BOOST_STRING_TYPENAME
+ container_helper_type::result_iterator result_iterator;
+ //! Difference type
+ typedef BOOST_STRING_TYPENAME
+ container_helper_type::difference_type difference_type;
+
+ }; // 'collection_traits'
+
+// collection_traits metafunctions -----------------------------------------//
+
+ //! Container value_type trait
+ /*!
+ Extract the type of elements contained in a container
+ */
+ template< typename C >
+ struct value_type_of
+ {
+ typedef BOOST_STRING_TYPENAME collection_traits<C>::value_type type;
+ };
+
+ //! Container difference trait
+ /*!
+ Extract the container's difference type
+ */
+ template< typename C >
+ struct difference_type_of
+ {
+ typedef BOOST_STRING_TYPENAME collection_traits<C>::difference_type type;
+ };
+
+ //! Container iterator trait
+ /*!
+ Extract the container's iterator type
+ */
+ template< typename C >
+ struct iterator_of
+ {
+ typedef BOOST_STRING_TYPENAME collection_traits<C>::iterator type;
+ };
+
+ //! Container const_iterator trait
+ /*!
+ Extract the container's const_iterator type
+ */
+ template< typename C >
+ struct const_iterator_of
+ {
+ typedef BOOST_STRING_TYPENAME collection_traits<C>::const_iterator type;
+ };
+
+
+ //! Container result_iterator
+ /*!
+ Extract the container's result_iterator type. This type maps to \c C::iterator
+ for mutable container and \c C::const_iterator for const containers.
+ */
+ template< typename C >
+ struct result_iterator_of
+ {
+ typedef BOOST_STRING_TYPENAME collection_traits<C>::result_iterator type;
+ };
+
+// collection_traits related functions -----------------------------------------//
+
+ //! Free-standing size() function
+ /*!
+ Get the size of the container. Uses collection_traits.
+ */
+ template< typename C >
+ inline BOOST_STRING_TYPENAME collection_traits<C>::size_type
+ size( const C& c )
+ {
+ return collection_traits<C>::function_type::size( c );
+ }
+
+ //! Free-standing empty() function
+ /*!
+ Check whether the container is empty. Uses container traits.
+ */
+ template< typename C >
+ inline bool empty( const C& c )
+ {
+ return collection_traits<C>::function_type::empty( c );
+ }
+
+#ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
+
+ //! Free-standing begin() function
+ /*!
+ Get the begin iterator of the container. Uses collection_traits.
+ */
+ template< typename C >
+ inline BOOST_STRING_TYPENAME collection_traits<C>::iterator
+ begin( C& c )
+ {
+ return collection_traits<C>::function_type::begin( c );
+ }
+
+ //! Free-standing begin() function
+ /*!
+ \overload
+ */
+ template< typename C >
+ inline BOOST_STRING_TYPENAME collection_traits<C>::const_iterator
+ begin( const C& c )
+ {
+ return collection_traits<C>::function_type::begin( c );
+ }
+
+ //! Free-standing end() function
+ /*!
+ Get the begin iterator of the container. Uses collection_traits.
+ */
+ template< typename C >
+ inline BOOST_STRING_TYPENAME collection_traits<C>::iterator
+ end( C& c )
+ {
+ return collection_traits<C>::function_type::end( c );
+ }
+
+ //! Free-standing end() function
+ /*!
+ \overload
+ */
+ template< typename C >
+ inline BOOST_STRING_TYPENAME collection_traits<C>::const_iterator
+ end( const C& c )
+ {
+ return collection_traits<C>::function_type::end( c );
+ }
+
+#else // BOOST_NO_FUNCTION_TEMPLATE_ORDERING
+
+ //! Free-standing begin() function
+ /*!
+ \overload
+ */
+ template< typename C >
+ inline BOOST_STRING_TYPENAME collection_traits<C>::result_iterator
+ begin( C& c )
+ {
+ return collection_traits<C>::function_type::begin( c );
+ }
+
+ //! Free-standing end() function
+ /*!
+ \overload
+ */
+ template< typename C >
+ inline BOOST_STRING_TYPENAME collection_traits<C>::result_iterator
+ end( C& c )
+ {
+ return collection_traits<C>::function_type::end( c );
+ }
+
+#endif // BOOST_NO_FUNCTION_TEMPLATE_ORDERING
+
+ } // namespace algorithm
+} // namespace boost
+
+#endif // BOOST_STRING_COLLECTION_TRAITS_HPP
View
83 boost/algorithm/string/compare.hpp
@@ -0,0 +1,83 @@
+// Boost string_algo library compare.hpp header file -------------------------//
+
+// Copyright Pavol Droba 2002-2003. Use, modification and
+// distribution is subject to the Boost Software License, Version
+// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// See http://www.boost.org for updates, documentation, and revision history.
+
+#ifndef BOOST_STRING_COMPARE_HPP
+#define BOOST_STRING_COMPARE_HPP
+
+#include <boost/algorithm/string/config.hpp>
+#include <locale>
+
+/*! \file
+ Defines element comparison predicates. Many algorithms in this library can
+ take an additional argument with a predicate used to compare elements.
+ This makes it possible, for instance, to have case insensitive versions
+ of the algorithms.
+*/
+
+namespace boost {
+ namespace algorithm {
+
+ // is_equal functor -----------------------------------------------//
+
+ //! is_equal functor
+ /*!
+ Standard STL equal_to only handle comparison between arguments
+ of the same type. This is a less restrictive version which wraps operator ==.
+ */
+ struct is_equal
+ {
+ //! Function operator
+ /*!
+ Compare two operands for equality
+ */
+ template< typename T1, typename T2 >
+ bool operator ()( const T1& Arg1, const T2& Arg2 ) const
+ {
+ return Arg1==Arg2;
+ }
+ };
+
+ //! case insensitive version of is_equal
+ /*!
+ Case insensitive comparison predicate. Comparison is done using
+ specified locales.
+ */
+ struct is_iequal
+ {
+ //! Constructor
+ /*!
+ \param Loc locales used for comparison
+ */
+ is_iequal( const std::locale& Loc=std::locale() ) :
+ m_Loc( Loc ) {}
+
+ //! Function operator
+ /*!
+ Compare two operands. Case is ignored.
+ */
+ template< typename T1, typename T2 >
+ bool operator ()( const T1& Arg1, const T2& Arg2 ) const
+ {
+ return std::toupper(Arg1,m_Loc)==std::toupper(Arg2,m_Loc);
+ }
+
+ private:
+ std::locale m_Loc;
+ };
+
+ } // namespace algorithm
+
+ // pull names to the boost namespace
+ using algorithm::is_equal;
+ using algorithm::is_iequal;
+
+} // namespace boost
+
+
+#endif // BOOST_STRING_COMPARE_HPP
View
81 boost/algorithm/string/concept.hpp
@@ -0,0 +1,81 @@
+// Boost string_algo library concept.hpp header file ---------------------------//
+
+// Copyright Pavol Droba 2002-2003. Use, modification and
+// distribution is subject to the Boost Software License, Version
+// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// See http://www.boost.org for updates, documentation, and revision history.
+
+#ifndef BOOST_STRING_CONCEPT_HPP
+#define BOOST_STRING_CONCEPT_HPP
+
+#include <boost/concept_check.hpp>
+#include <boost/algorithm/string/iterator_range.hpp>
+#include <boost/algorithm/string/collection_traits.hpp>
+
+/*! \file
+ Defines concepts used in string_algo library
+*/
+
+namespace boost {
+ namespace algorithm {
+
+ //! Finder concept
+ /*!
+ Defines the Finder concept. Finder is a functor which selects
+ an arbitrary part of a string. Search is performed on
+ the range specified by starting and ending iterators.
+
+ Result of the find operation must be convertible to iterator_range.
+ */
+ template<typename FinderT, typename IteratorT>
+ struct FinderConcept
+ {
+ private:
+ typedef iterator_range<IteratorT> range;
+ public:
+ void constraints()
+ {
+ // Operation
+ r=(*pF)(i,i);
+ }
+ private:
+ range r;
+ IteratorT i;
+ FinderT* pF;
+ }; // Finder_concept
+
+
+ //! Formatter concept
+ /*!
+ Defines the Formatter concept. Formatter is a functor, which
+ takes a result from a finder operation and transforms it
+ in a specific way.
+
+ Result must be a container supported by container_traits,
+ or a reference to it.
+ */
+ template<typename FormatterT, typename FinderT, typename IteratorT>
+ struct FormatterConcept
+ {
+ public:
+ void constraints()
+ {
+ // Operation
+ begin((*pFo)( (*pF)(i,i) ));
+ end((*pFo)( (*pF)(i,i) ));
+ }
+ private:
+ IteratorT i;
+ FinderT* pF;
+ FormatterT *pFo;
+ }; // FormatterConcept;
+
+ } // namespace algorithm
+} // namespace boost
+
+
+
+
+#endif // BOOST_STRING_CONCEPT_HPP
View
31 boost/algorithm/string/config.hpp
@@ -0,0 +1,31 @@
+// Boost string_algo library config.hpp header file ---------------------------//
+
+// Copyright Pavol Droba 2002-2003. Use, modification and
+// distribution is subject to the Boost Software License, Version
+// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// See http://www.boost.org for updates, documentation, and revision history.
+
+#ifndef BOOST_STRING_CONFIG_HPP
+#define BOOST_STRING_CONFIG_HPP
+
+#include <boost/config.hpp>
+#include <boost/detail/workaround.hpp>
+
+#ifdef BOOST_STRING_DEDUCED_TYPENAME
+# error "macro already defined!"
+#endif
+
+#ifdef __BORLANDC__
+#define BOOST_STRING_TYPENAME
+#else
+#define BOOST_STRING_TYPENAME BOOST_DEDUCED_TYPENAME
+#endif
+
+// Metrowerks workaround
+#if BOOST_WORKAROUND(__MWERKS__, <= 0x3003) // 8.x
+#pragma parse_func_templ off
+#endif
+
+#endif // BOOST_STRING_CONFIG_HPP
View
35 boost/algorithm/string/constants.hpp
@@ -0,0 +1,35 @@
+// Boost string_algo library constants.hpp header file ---------------------------//
+
+// Copyright Pavol Droba 2002-2003. Use, modification and
+// distribution is subject to the Boost Software License, Version
+// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// See http://www.boost.org for updates, documentation, and revision history.
+
+#ifndef BOOST_STRING_CONSTANTS_HPP
+#define BOOST_STRING_CONSTANTS_HPP
+
+namespace boost {
+ namespace algorithm {
+
+ //! Token compression mode
+ /*!
+ Specifies token compression mode for the token_finder.
+ */
+ enum token_compress_mode_type
+ {
+ token_compress_on, //!< Compress adjacent tokens
+ token_compress_off //!< Do not compress adjacent tokens
+ };
+
+ } // namespace algorithm
+
+ // pull the names to the boost namespace
+ using algorithm::token_compress_on;
+ using algorithm::token_compress_off;
+
+} // namespace boost
+
+#endif // BOOST_STRING_CONSTANTS_HPP
+
View
60 boost/algorithm/string/detail/case_conv.hpp
@@ -0,0 +1,60 @@
+// Boost string_algo library string_funct.hpp header file ---------------------------//
+
+// Copyright Pavol Droba 2002-2003. Use, modification and
+// distribution is subject to the Boost Software License, Version
+// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// See http://www.boost.org for updates, documentation, and revision history.
+
+#ifndef BOOST_STRING_CASE_CONV_DETAIL_HPP
+#define BOOST_STRING_CASE_CONV_DETAIL_HPP
+
+#include <boost/algorithm/string/config.hpp>
+#include <locale>
+#include <functional>
+
+namespace boost {
+ namespace algorithm {
+ namespace detail {
+
+// case conversion functors -----------------------------------------------//
+
+ // a tolower functor
+ template<typename CharT>
+ struct to_lowerF : public std::unary_function<CharT, CharT>
+ {
+ // Constructor
+ to_lowerF( const std::locale& Loc ) : m_Loc( Loc ) {}
+
+ // Operation
+ CharT operator ()( CharT Ch ) const
+ {
+ return std::tolower( Ch, m_Loc );
+ }
+ private:
+ const std::locale& m_Loc;
+ };
+
+ // a toupper functor
+ template<typename CharT>
+ struct to_upperF : public std::unary_function<CharT, CharT>
+ {
+ // Constructor
+ to_upperF( const std::locale& Loc ) : m_Loc( Loc ) {}
+
+ // Operation
+ CharT operator ()( CharT Ch ) const
+ {
+ return std::toupper( Ch, m_Loc );
+ }
+ private:
+ const std::locale& m_Loc;
+ };
+
+ } // namespace detail
+ } // namespace algorithm
+} // namespace boost
+
+
+#endif // BOOST_STRING_CASE_CONV_DETAIL_HPP
View
186 boost/algorithm/string/detail/classification.hpp
@@ -0,0 +1,186 @@
+// Boost string_algo library classification.hpp header file ---------------------------//
+
+// Copyright Pavol Droba 2002-2003. Use, modification and
+// distribution is subject to the Boost Software License, Version
+// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// See http://www.boost.org for updates, documentation, and revision history.
+
+#ifndef BOOST_STRING_CLASSIFICATION_DETAIL_HPP
+#define BOOST_STRING_CLASSIFICATION_DETAIL_HPP
+
+#include <boost/algorithm/string/config.hpp>
+#include <algorithm>
+#include <functional>
+#include <locale>
+#include <set>
+#include <boost/algorithm/string/collection_traits.hpp>
+#include <boost/algorithm/string/predicate_facade.hpp>
+#include <boost/type_traits/remove_const.hpp>
+
+namespace boost {
+ namespace algorithm {
+ namespace detail {
+
+// classification functors -----------------------------------------------//
+
+ // is_classified functor
+ struct is_classifiedF :
+ public predicate_facade<is_classifiedF>
+ {
+ // Boost.Lambda support
+ template <class Args> struct sig { typedef bool type; };
+
+ // Constructor from a locale
+ is_classifiedF(std::ctype_base::mask Type, std::locale const & Loc = std::locale()) :
+ m_Type(Type), m_Locale(Loc) {}
+
+ // Operation
+ template<typename CharT>
+ bool operator()( CharT Ch ) const
+ {
+ return std::use_facet< std::ctype<CharT> >(m_Locale).is( m_Type, Ch );
+ }
+
+ private:
+ const std::ctype_base::mask m_Type;
+ const std::locale m_Locale;
+ };
+
+ // is_any_of functor
+ /*
+ returns true if the value is from the specified set
+ */
+ template<typename CharT>
+ struct is_any_ofF :
+ public predicate_facade<is_any_ofF<CharT> >
+ {
+ // Boost.Lambda support
+ template <class Args> struct sig { typedef bool type; };
+
+ // Constructor
+ template< typename SeqT >
+ is_any_ofF( const SeqT& Seq ) :
+ m_Set( begin(Seq), end(Seq) ) {}
+
+ // Operation
+ template<typename Char2T>
+ bool operator()( Char2T Ch ) const
+ {
+ return m_Set.find(Ch)!=m_Set.end();
+ }
+
+ private:
+ // set cannot operate on const value-type
+ typedef typename remove_const<CharT>::type set_value_type;
+ std::set<set_value_type> m_Set;
+ };
+
+ // is_from_range functor
+ /*
+ returns true if the value is from the specified range.
+ (i.e. x>=From && x>=To)
+ */
+ template<typename CharT>
+ struct is_from_rangeF :
+ public predicate_facade< is_from_rangeF<CharT> >
+ {
+ // Boost.Lambda support
+ template <class Args> struct sig { typedef bool type; };
+
+ // Constructor
+ is_from_rangeF( CharT From, CharT To ) : m_From(From), m_To(To) {}
+
+ // Operation
+ template<typename Char2T>
+ bool operator()( Char2T Ch ) const
+ {
+ return ( m_From <= Ch ) && ( Ch <= m_To );
+ }
+
+ private:
+ CharT m_From;
+ CharT m_To;
+ };
+
+ // class_and composition predicate
+ template<typename Pred1T, typename Pred2T>
+ struct pred_andF :
+ public predicate_facade< pred_andF<Pred1T,Pred2T> >
+ {
+ public:
+
+ // Boost.Lambda support
+ template <class Args> struct sig { typedef bool type; };
+
+ // Constructor
+ pred_andF( Pred1T Pred1, Pred2T Pred2 ) :
+ m_Pred1(Pred1), m_Pred2(Pred2) {}
+
+ // Operation
+ template<typename CharT>
+ bool operator()( CharT Ch ) const
+ {
+ return m_Pred1(Ch) && m_Pred2(Ch);
+ }
+
+ private:
+ Pred1T m_Pred1;
+ Pred2T m_Pred2;
+ };
+
+ // class_or composition predicate
+ template<typename Pred1T, typename Pred2T>
+ struct pred_orF :
+ public predicate_facade< pred_orF<Pred1T,Pred2T> >
+ {
+ public:
+ // Boost.Lambda support
+ template <class Args> struct sig { typedef bool type; };
+
+ // Constructor
+ pred_orF( Pred1T Pred1, Pred2T Pred2 ) :
+ m_Pred1(Pred1), m_Pred2(Pred2) {}
+
+ // Operation
+ template<typename CharT>
+ bool operator()( CharT Ch ) const
+ {
+ return m_Pred1(Ch) || m_Pred2(Ch);
+ }
+
+ private:
+ Pred1T m_Pred1;
+ Pred2T m_Pred2;
+ };
+
+ // class_not composition predicate
+ template< typename PredT >
+ struct pred_notF :
+ public predicate_facade< pred_notF<PredT> >
+ {
+ public:
+ // Boost.Lambda support
+ template <class Args> struct sig { typedef bool type; };
+
+ // Constructor
+ pred_notF( PredT Pred ) : m_Pred(Pred) {}
+
+ // Operation
+ template<typename CharT>
+ bool operator()( CharT Ch ) const
+ {
+ return !m_Pred(Ch);
+ }
+
+ private:
+ PredT m_Pred;
+ };
+
+ } // namespace detail
+ } // namespace algorithm
+} // namespace boost
+
+
+#endif // BOOST_STRING_CLASSIFICATION_DETAIL_HPP
View
621 boost/algorithm/string/detail/collection_traits.hpp
@@ -0,0 +1,621 @@
+// Boost string_algo library collection_traits.hpp header file -----------------------//
+
+// Copyright Pavol Droba 2002-2003. Use, modification and
+// distribution is subject to the Boost Software License, Version
+// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// See http://www.boost.org for updates, documentation, and revision history.
+
+#ifndef BOOST_STRING_DETAIL_COLLECTION_TRAITS_HPP
+#define BOOST_STRING_DETAIL_COLLECTION_TRAITS_HPP
+
+#include <boost/algorithm/string/config.hpp>
+#include <cstddef>
+#include <string>
+#include <boost/type_traits/is_array.hpp>
+#include <boost/type_traits/is_pointer.hpp>
+#include <boost/type_traits/is_const.hpp>
+#include <boost/type_traits/is_convertible.hpp>
+#include <boost/type_traits/remove_pointer.hpp>
+#include <boost/type_traits/remove_cv.hpp>
+#include <boost/mpl/eval_if.hpp>
+#include <boost/mpl/identity.hpp>
+#include <boost/mpl/vector.hpp>
+#include <boost/mpl/fold.hpp>
+#include <boost/detail/iterator.hpp>
+#include <boost/algorithm/string/yes_no_type.hpp>
+
+// Container traits implementation ---------------------------------------------------------
+
+namespace boost {
+ namespace algorithm {
+ namespace detail {
+
+// Default collection traits -----------------------------------------------------------------
+
+ // Default collection helper
+ /*
+ Wraps std::container compliant containers
+ */
+ template< typename ContainerT >
+ struct default_container_traits
+ {
+ typedef BOOST_STRING_TYPENAME ContainerT::value_type value_type;
+ typedef BOOST_STRING_TYPENAME ContainerT::iterator iterator;
+ typedef BOOST_STRING_TYPENAME ContainerT::const_iterator const_iterator;
+ typedef BOOST_STRING_TYPENAME
+ ::boost::mpl::if_< ::boost::is_const<ContainerT>,
+ const_iterator,
+ iterator
+ >::type result_iterator;
+ typedef BOOST_STRING_TYPENAME ContainerT::difference_type difference_type;
+ typedef BOOST_STRING_TYPENAME ContainerT::size_type size_type;
+
+ // static operations
+ template< typename C >
+ static size_type size( const C& c )
+ {
+ return c.size();
+ }
+
+ template< typename C >
+ static bool empty( const C& c )
+ {
+ return c.empty();
+ }
+
+#ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
+
+ template< typename C >
+ static iterator begin( C& c )
+ {
+ return c.begin();
+ }
+
+ template< typename C >
+ static const_iterator begin( const C& c )
+ {
+ return c.begin();
+ }
+
+ template< typename C >
+ static iterator end( C& c )
+ {
+ return c.end();
+ }
+
+ template< typename C >
+ static const_iterator end( const C& c )
+ {
+ return c.end();
+ }
+
+#else // BOOST_NO_FUNCTION_TEMPLATE_ORDERING
+
+ template< typename C >
+ static result_iterator begin( C& c )
+ {
+ return c.begin();
+ }
+
+ template< typename C >
+ static result_iterator end( C& c )
+ {
+ return c.end();
+ }
+
+#endif // BOOST_NO_FUNCTION_TEMPLATE_ORDERING
+
+ };
+
+ template<typename T>
+ struct default_container_traits_selector</