Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r63603 - in sandbox/SOC/2009/unicode: boost/iterator boost/unicode boost/unicode/detail libs/unicode/doc libs/unicode/example libs/unicode/test/unicode
From: loufoque_at_[hidden]
Date: 2010-07-04 12:36:08


Author: mgaunard
Date: 2010-07-04 12:36:05 EDT (Sun, 04 Jul 2010)
New Revision: 63603
URL: http://svn.boost.org/trac/boost/changeset/63603

Log:
converting unicode library to use same naming conventions as boost.range 1.43+
Added:
   sandbox/SOC/2009/unicode/boost/unicode/detail/
   sandbox/SOC/2009/unicode/boost/unicode/detail/cat.hpp (contents, props changed)
Removed:
   sandbox/SOC/2009/unicode/boost/unicode/converter_def.hpp
Text files modified:
   sandbox/SOC/2009/unicode/boost/iterator/convert_iterator.hpp | 223 +++++++++++++++++++++++++++++++++------
   sandbox/SOC/2009/unicode/boost/iterator/converter_concept.hpp | 4
   sandbox/SOC/2009/unicode/boost/iterator/segment_iterator.hpp | 130 ++++++++++++++++++----
   sandbox/SOC/2009/unicode/boost/iterator/segmenter_concept.hpp | 4
   sandbox/SOC/2009/unicode/boost/unicode/cat.hpp | 149 +++++++++++++-------------
   sandbox/SOC/2009/unicode/boost/unicode/combining.hpp | 28 ----
   sandbox/SOC/2009/unicode/boost/unicode/compose.hpp | 7
   sandbox/SOC/2009/unicode/boost/unicode/graphemes.hpp | 116 +++-----------------
   sandbox/SOC/2009/unicode/boost/unicode/utf.hpp | 111 +++----------------
   sandbox/SOC/2009/unicode/libs/unicode/doc/Jamfile.v2 | 10 +
   sandbox/SOC/2009/unicode/libs/unicode/doc/users_manual.qbk | 20 +-
   sandbox/SOC/2009/unicode/libs/unicode/example/characters.cpp | 8
   sandbox/SOC/2009/unicode/libs/unicode/example/convert.cpp | 8
   sandbox/SOC/2009/unicode/libs/unicode/example/search.cpp | 4
   sandbox/SOC/2009/unicode/libs/unicode/example/source_input.cpp | 4
   sandbox/SOC/2009/unicode/libs/unicode/test/unicode/range_test.hpp | 15 --
   sandbox/SOC/2009/unicode/libs/unicode/test/unicode/test_compose.cpp | 15 +-
   sandbox/SOC/2009/unicode/libs/unicode/test/unicode/test_utf.cpp | 6
   18 files changed, 453 insertions(+), 409 deletions(-)

Modified: sandbox/SOC/2009/unicode/boost/iterator/convert_iterator.hpp
==============================================================================
--- sandbox/SOC/2009/unicode/boost/iterator/convert_iterator.hpp (original)
+++ sandbox/SOC/2009/unicode/boost/iterator/convert_iterator.hpp 2010-07-04 12:36:05 EDT (Sun, 04 Jul 2010)
@@ -305,36 +305,22 @@
 }
 
 template<typename Range, typename Converter>
-BOOST_CONCEPT_REQUIRES(
- ((SinglePassRangeConcept<Range>))
- ((ConverterConcept<Converter>))
- ((Convertible<typename range_value<Range>::type, typename Converter::input_type>)),
- (iterator_range<
- convert_iterator<typename range_iterator<const Range>::type, Converter>
- >)
-) converted(const Range& range, Converter p)
-{
- return boost::make_iterator_range(
- make_convert_iterator(boost::begin(range), boost::end(range), boost::begin(range), p),
- make_convert_iterator(boost::begin(range), boost::end(range), boost::end(range), p)
- );
-}
-
-template<typename Range, typename Converter>
-BOOST_CONCEPT_REQUIRES(
- ((SinglePassRangeConcept<Range>))
- ((ConverterConcept<Converter>))
- ((Convertible<typename range_value<Range>::type, typename Converter::input_type>)),
- (iterator_range<
- convert_iterator<typename range_iterator<Range>::type, Converter>
- >)
-) converted(Range& range, Converter p)
+struct converted_range : boost::iterator_range<
+ boost::convert_iterator<
+ typename boost::range_iterator<Range>::type,
+ Converter
+ >
+>
 {
- return boost::make_iterator_range(
- make_convert_iterator(boost::begin(range), boost::end(range), boost::begin(range), p),
- make_convert_iterator(boost::begin(range), boost::end(range), boost::end(range), p)
- );
-}
+ typedef boost::convert_iterator<
+ typename boost::range_iterator<Range>::type,
+ Converter
+ > Iterator;
+
+ converted_range(Iterator begin, Iterator end) : boost::iterator_range<Iterator>(begin, end)
+ {
+ }
+};
 
 template<typename Range, typename Converter, typename OutputIterator>
 BOOST_CONCEPT_REQUIRES(
@@ -360,16 +346,179 @@
     return out;
 }
 
-template<typename OutputIterator, typename OneManyConverter>
-BOOST_CONCEPT_REQUIRES(
- ((OneManyConverterConcept<OneManyConverter>))
- ((OutputIteratorConcept<OutputIterator, typename OneManyConverter::output_type>)),
- (convert_output_iterator<OutputIterator, OneManyConverter>)
-) converted_output(OutputIterator out, OneManyConverter p)
+namespace adaptors
 {
- return convert_output_iterator<OutputIterator, OneManyConverter>(out, p);
-}
+ template<typename Range, typename Converter>
+ BOOST_CONCEPT_REQUIRES(
+ ((SinglePassRangeConcept<Range>))
+ ((ConverterConcept<Converter>))
+ ((Convertible<typename range_value<Range>::type, typename Converter::input_type>)),
+ (converted_range<const Range, Converter>)
+ ) convert(const Range& range, Converter p)
+ {
+ return boost::converted_range<const Range, Converter>(
+ make_convert_iterator(boost::begin(range), boost::end(range), boost::begin(range), p),
+ make_convert_iterator(boost::begin(range), boost::end(range), boost::end(range), p)
+ );
+ }
+
+ template<typename Range, typename Converter>
+ BOOST_CONCEPT_REQUIRES(
+ ((SinglePassRangeConcept<Range>))
+ ((ConverterConcept<Converter>))
+ ((Convertible<typename range_value<Range>::type, typename Converter::input_type>)),
+ (converted_range<Range, Converter>)
+ ) convert(Range& range, Converter p)
+ {
+ return boost::converted_range<Range, Converter>(
+ make_convert_iterator(boost::begin(range), boost::end(range), boost::begin(range), p),
+ make_convert_iterator(boost::begin(range), boost::end(range), boost::end(range), p)
+ );
+ }
+
+ template<typename OutputIterator, typename OneManyConverter>
+ BOOST_CONCEPT_REQUIRES(
+ ((OneManyConverterConcept<OneManyConverter>))
+ ((OutputIteratorConcept<OutputIterator, typename OneManyConverter::output_type>)),
+ (convert_output_iterator<OutputIterator, OneManyConverter>)
+ ) convert_output(OutputIterator out, OneManyConverter p)
+ {
+ return convert_output_iterator<OutputIterator, OneManyConverter>(out, p);
+ }
+} // namespace adaptors
 
 } // namespace boost
 
+#ifdef BOOST_UNICODE_DOXYGEN_INVOKED
+/** Defines helper functions for usage of a \c \xmlonly<conceptname>Converter</conceptname>\endxmlonly.
+ * Helper functions provide a pseudo-variadic interface where they forward all the extra arguments to
+ * the constructor of the \c \xmlonly<conceptname>Converter</conceptname>\endxmlonly.
+ * \arg \c name Name of the type modelling the \c \xmlonly<conceptname>Converter</conceptname>\endxmlonly.
+ * \arg \c n Maximum number of optional arguments. */
+#define BOOST_CONVERTER_DEF(converter_name, convert_name) \
+/** Eagerly evaluates \c converter_name until the whole input
+ range \c range has been treated, copying the result to \c out and
+ returning the past-the-end output iterator. */ \
+template<typename Range, typename OutputIterator, typename... T> \
+OutputIterator \
+convert_name(const Range& range, OutputIterator out, const T&... ); \
+namespace adaptors \
+{ \
+ /** Lazily evalutes \c converter_name by returning a range
+ adapter that wraps the range \c range and converts it
+ step-by-step as the range is advanced. */ \
+ template<typename Range, typename... T> \
+ boost::segmented_range< \
+ Range, \
+ converter_name \
+ > \
+ convert_name(Range&& range, const T&...); \
+}
+#else
+#define BOOST_CONVERTER_DEF(converter_name, convert_name) \
+template<typename Range, typename OutputIterator> \
+OutputIterator convert_name(const Range& range, OutputIterator out) \
+{ \
+ return boost::convert(range, converter_name(), out); \
+} \
+template<typename Range, typename OutputIterator, typename T0> \
+OutputIterator \
+convert_name(const Range& range, OutputIterator out, const T0& t0) \
+{ \
+ return boost::convert(range, converter_name(t0), out); \
+} \
+namespace adaptors \
+{ \
+ template<typename Range> \
+ boost::converted_range< \
+ const Range, \
+ converter_name \
+ > \
+ convert_name(const Range& range) \
+ { \
+ return boost::adaptors::convert(range, converter_name()); \
+ } \
+ \
+ template<typename Range> \
+ boost::converted_range< \
+ Range, \
+ converter_name \
+ > \
+ convert_name(Range& range) \
+ { \
+ return boost::adaptors::convert(range, converter_name()); \
+ } \
+ \
+ template<typename Range, typename T0> \
+ boost::converted_range< \
+ const Range, \
+ converter_name \
+ > \
+ convert_name(const Range& range, const T0& t0) \
+ { \
+ return boost::adaptors::convert(range, converter_name(t0)); \
+ } \
+ \
+ template<typename Range, typename T0> \
+ boost::converted_range< \
+ Range, \
+ converter_name \
+ > \
+ convert_name(Range& range, const T0& t0) \
+ { \
+ return boost::adaptors::convert(range, converter_name(t0)); \
+ } \
+}
+#endif
+
+#ifdef BOOST_UNICODE_DOXYGEN_INVOKED
+/** Defines helper functions for usage of a \c \xmlonly<conceptname>OneManyConverter</conceptname>\endxmlonly.
+ * Helper functions provide a pseudo-variadic interface where they forward all the extra arguments to
+ * the constructor of the \c \xmlonly<conceptname>OneManyConverter</conceptname>\endxmlonly.
+ * \arg \c name Name of the type modelling the \c \xmlonly<conceptname>OneManyConverter</conceptname>\endxmlonly.
+ * \arg \c n Maximum number of optional arguments. */
+#define BOOST_ONEMANYCONVERTER_DEF(converter_name, convert_name) \
+BOOST_CONVERTER_DEF(converter_name, convert_name) \
+namespace adaptors \
+{ \
+ /** Lazily evalutes \c converter_name by returning an output
+ iterator that wraps \c out and converts every pushed element. */ \
+ template<typename OutputIterator, typename... T> \
+ boost::convert_output_iterator< \
+ OutputIterator, \
+ converter_name \
+ > \
+ convert_name##_output(OutputIterator out, const T&...); \
+}
+#else
+#define BOOST_ONEMANYCONVERTER_DEF(converter_name, convert_name) \
+BOOST_CONVERTER_DEF(converter_name, convert_name) \
+namespace adaptors \
+{ \
+ template<typename OutputIterator> \
+ boost::convert_output_iterator< \
+ OutputIterator, \
+ converter_name \
+ > \
+ convert_name##_output(OutputIterator out) \
+ { \
+ return boost::adaptors::convert_output(out, converter_name()); \
+ } \
+ \
+ template<typename OutputIterator, typename T0> \
+ boost::convert_output_iterator< \
+ OutputIterator, \
+ converter_name \
+ > \
+ convert_name##_output(OutputIterator out, const T0& t0) \
+ { \
+ return boost::adaptors::convert_output( \
+ out, \
+ converter_name(t0) \
+ ); \
+ } \
+}
+#endif
+
 #endif
+

Modified: sandbox/SOC/2009/unicode/boost/iterator/converter_concept.hpp
==============================================================================
--- sandbox/SOC/2009/unicode/boost/iterator/converter_concept.hpp (original)
+++ sandbox/SOC/2009/unicode/boost/iterator/converter_concept.hpp 2010-07-04 12:36:05 EDT (Sun, 04 Jul 2010)
@@ -9,7 +9,7 @@
 namespace boost
 {
 
-/** Concept checking class for the \c Converter concept */
+/** Concept checking class for the \c \xmlonly<conceptname>Converter</conceptname>\endxmlonly concept */
 template<typename X>
 struct ConverterConcept : DefaultConstructible<X>, CopyConstructible<X>
 {
@@ -33,7 +33,7 @@
     std::pair<in_type, out_type> p;
 };
 
-/** Concept checking class for the \c OneManyConverter concept */
+/** Concept checking class for the \c \xmlonly<conceptname>OneManyConverter</conceptname>\endxmlonly concept */
 template<typename X>
 struct OneManyConverterConcept : ConverterConcept<X>
 {

Modified: sandbox/SOC/2009/unicode/boost/iterator/segment_iterator.hpp
==============================================================================
--- sandbox/SOC/2009/unicode/boost/iterator/segment_iterator.hpp (original)
+++ sandbox/SOC/2009/unicode/boost/iterator/segment_iterator.hpp 2010-07-04 12:36:05 EDT (Sun, 04 Jul 2010)
@@ -223,37 +223,113 @@
 }
 
 template<typename Range, typename Segmenter>
-BOOST_CONCEPT_REQUIRES(
- ((SinglePassRangeConcept<Range>))
- ((SegmenterConcept<Segmenter>))
- ((Convertible<typename range_value<const Range>::type, typename Segmenter::input_type>)),
- (iterator_range<
- segment_iterator<typename range_iterator<const Range>::type, Segmenter>
- >)
-) segmented(const Range& range, Segmenter c)
+struct segmented_range : boost::iterator_range<
+ boost::segment_iterator<
+ typename boost::range_iterator<Range>::type,
+ Segmenter
+ >
+>
 {
- return boost::make_iterator_range(
- make_segment_iterator(boost::begin(range), boost::end(range), boost::begin(range), c),
- make_segment_iterator(boost::begin(range), boost::end(range), boost::end(range), c)
- );
-}
+ typedef boost::segment_iterator<
+ typename boost::range_iterator<Range>::type,
+ Segmenter
+ > Iterator;
+
+ segmented_range(Iterator begin, Iterator end) : boost::iterator_range<Iterator>(begin, end)
+ {
+ }
+};
 
-template<typename Range, typename Segmenter>
-BOOST_CONCEPT_REQUIRES(
- ((SinglePassRangeConcept<Range>))
- ((SegmenterConcept<Segmenter>))
- ((Convertible<typename range_value<Range>::type, typename Segmenter::input_type>)),
- (iterator_range<
- segment_iterator<typename range_iterator<Range>::type, Segmenter>
- >)
-) segmented(Range& range, Segmenter c)
+namespace adaptors
 {
- return boost::make_iterator_range(
- make_segment_iterator(boost::begin(range), boost::end(range), boost::begin(range), c),
- make_segment_iterator(boost::begin(range), boost::end(range), boost::end(range), c)
- );
-}
+ template<typename Range, typename Segmenter>
+ BOOST_CONCEPT_REQUIRES(
+ ((SinglePassRangeConcept<Range>))
+ ((SegmenterConcept<Segmenter>))
+ ((Convertible<typename range_value<const Range>::type, typename Segmenter::input_type>)),
+ (segmented_range<const Range, Segmenter>)
+ ) segment(const Range& range, Segmenter c)
+ {
+ return boost::segmented_range<const Range, Segmenter>(
+ make_segment_iterator(boost::begin(range), boost::end(range), boost::begin(range), c),
+ make_segment_iterator(boost::begin(range), boost::end(range), boost::end(range), c)
+ );
+ }
+
+ template<typename Range, typename Segmenter>
+ BOOST_CONCEPT_REQUIRES(
+ ((SinglePassRangeConcept<Range>))
+ ((SegmenterConcept<Segmenter>))
+ ((Convertible<typename range_value<Range>::type, typename Segmenter::input_type>)),
+ (segmented_range<Range, Segmenter>)
+ ) segment(Range& range, Segmenter c)
+ {
+ return boost::segmented_range<Range, Segmenter>(
+ make_segment_iterator(boost::begin(range), boost::end(range), boost::begin(range), c),
+ make_segment_iterator(boost::begin(range), boost::end(range), boost::end(range), c)
+ );
+ }
+} // namespace adaptors
     
 } // namespace boost
 
+#ifdef BOOST_UNICODE_DOXYGEN_INVOKED
+#define BOOST_SEGMENTER_DEF(segmenter_name, segment_name) \
+namespace adaptors \
+{ \
+ /** Adapts the range \c range into a range of ranges segmented by
+ \c segmenter_name, each subrange being a segment. */ \
+ template<typename Range, typename... T> \
+ boost::segmented_range< \
+ Range, \
+ segmenter_name \
+ > \
+ segment_name(Range&& range, const T&...); \
+}
+#else
+#define BOOST_SEGMENTER_DEF(segmenter_name, segment_name) \
+namespace adaptors \
+{ \
+ template<typename Range> \
+ boost::segmented_range< \
+ const Range, \
+ segmenter_name \
+ > \
+ segment_name(const Range& range) \
+ { \
+ return boost::adaptors::segment(range, segmenter_name()); \
+ } \
+ \
+ template<typename Range> \
+ boost::segmented_range< \
+ Range, \
+ segmenter_name \
+ > \
+ segment_name(Range& range) \
+ { \
+ return boost::adaptors::segment(range, segmenter_name()); \
+ } \
+ \
+ template<typename Range, typename T0> \
+ boost::segmented_range< \
+ const Range, \
+ segmenter_name \
+ > \
+ segment_name(const Range& range, const T0& t0) \
+ { \
+ return boost::adaptors::segment(range, segmenter_name(t0)); \
+ } \
+ \
+ template<typename Range, typename T0> \
+ boost::segmented_range< \
+ Range, \
+ segmenter_name \
+ > \
+ segment_name(Range& range, const T0& t0) \
+ { \
+ return boost::adaptors::segment(range, segmenter_name(t0)); \
+ } \
+}
+#endif
+
 #endif

Modified: sandbox/SOC/2009/unicode/boost/iterator/segmenter_concept.hpp
==============================================================================
--- sandbox/SOC/2009/unicode/boost/iterator/segmenter_concept.hpp (original)
+++ sandbox/SOC/2009/unicode/boost/iterator/segmenter_concept.hpp 2010-07-04 12:36:05 EDT (Sun, 04 Jul 2010)
@@ -7,7 +7,7 @@
 namespace boost
 {
 
-/** Concept checking class for the \c Segmenter concept */
+/** Concept checking class for the \c \xmlonly<conceptname>Segmenter</conceptname>\endxmlonly concept */
 template<typename X>
 struct SegmenterConcept : DefaultConstructible<X>, CopyConstructible<X>
 {
@@ -27,7 +27,7 @@
     in_type end;
 };
 
-/** Concept checking class for the \c BoundaryChecker concept */
+/** Concept checking class for the \c \xmlonly<conceptname>BoundaryChecker</conceptname>\endxmlonly concept */
 template<typename X>
 struct BoundaryCheckerConcept : DefaultConstructible<X>, CopyConstructible<X>
 {

Modified: sandbox/SOC/2009/unicode/boost/unicode/cat.hpp
==============================================================================
--- sandbox/SOC/2009/unicode/boost/unicode/cat.hpp (original)
+++ sandbox/SOC/2009/unicode/boost/unicode/cat.hpp 2010-07-04 12:36:05 EDT (Sun, 04 Jul 2010)
@@ -38,75 +38,74 @@
 namespace unicode
 {
 /** INTERNAL ONLY */
-#define BOOST_UNICODE_CAT_LIMITS_FWD(cv1, ref1, cv2, ref2) \
+#define BOOST_UNICODE_CAT_LIMITS_FWD(cv1, ref1, cv2, ref2) \
 /** Partitions the two input ranges into a total of four ranges,
    the two inner ranges requiring transformation to maintain a certain
- normalization form while concatenated. */ \
-template<typename Range1, typename Range2> \
-tuple< \
- sub_range<cv1 Range1>, \
- sub_range<cv1 Range1>, \
- sub_range<cv2 Range2>, \
- sub_range<cv2 Range2> \
-> \
-cat_limits(cv1 Range1 ref1 range1, cv2 Range2 ref2 range2) \
-{ \
- iterator_range< \
- convert_iterator< \
- typename range_iterator<cv2 Range2>::type, \
- utf_decoder \
- > \
- > decoded2 = utf_decoded(range2); \
-\
- char32 ch = *begin(decoded2); \
- if(ucd::get_combining_class(ch) != 0) \
- { \
- iterator_range< \
- convert_iterator< \
- typename range_iterator<cv1 Range1>::type, \
- utf_decoder \
- > \
- > decoded1 = utf_decoded(range1); \
-\
-\
- typename range_iterator<cv1 Range1>::type \
- new_end = combiner().rtl(boost::begin(decoded1), boost::end(decoded1)).base(); \
-\
- typename range_iterator<cv2 Range2>::type \
- new_begin = combiner().ltr(boost::begin(decoded2), boost::end(decoded2)).base(); \
-\
- return make_tuple( \
- make_iterator_range(boost::begin(range1), new_end), \
- make_iterator_range(new_end, boost::end(range1)), \
- make_iterator_range(boost::begin(range2), new_begin), \
- make_iterator_range(new_begin, boost::end(range2)) \
- ); \
- } \
-\
- return make_tuple( \
- range1, \
- make_iterator_range(boost::end(range1), boost::end(range1)), \
- make_iterator_range(boost::end(range2), boost::end(range2)), \
- range2 \
- ); \
+ normalization form while concatenated. */ \
+template<typename Range1, typename Range2> \
+tuple< \
+ sub_range<cv1 Range1>, \
+ sub_range<cv1 Range1>, \
+ sub_range<cv2 Range2>, \
+ sub_range<cv2 Range2> \
+> \
+cat_limits(cv1 Range1 ref1 range1, cv2 Range2 ref2 range2) \
+{ \
+ converted_range< \
+ cv2 Range2, \
+ utf_decoder \
+ > decoded2 = adaptors::utf_decode(range2); \
+ \
+ if(!empty(decoded2) \
+ && ucd::get_combining_class(*begin(decoded2)) != 0) \
+ { \
+ converted_range< \
+ cv1 Range1, \
+ utf_decoder \
+ > decoded1 = adaptors::utf_decode(range1); \
+ \
+ typename range_iterator<cv1 Range1>::type \
+ new_end = combiner().rtl( \
+ boost::begin(decoded1), \
+ boost::end(decoded1) \
+ ).base(); \
+ \
+ typename range_iterator<cv2 Range2>::type \
+ new_begin = combiner().ltr( \
+ boost::begin(decoded2), \
+ boost::end(decoded2) \
+ ).base(); \
+ \
+ return make_tuple( \
+ make_iterator_range(boost::begin(range1), new_end), \
+ make_iterator_range(new_end, boost::end(range1)), \
+ make_iterator_range(boost::begin(range2), new_begin), \
+ make_iterator_range(new_begin, boost::end(range2)) \
+ ); \
+ } \
+ \
+ return make_tuple( \
+ range1, \
+ make_iterator_range(boost::end(range1), boost::end(range1)), \
+ make_iterator_range(boost::end(range2), boost::end(range2)), \
+ range2 \
+ ); \
 }
 BOOST_UNICODE_FWD_2(BOOST_UNICODE_CAT_LIMITS_FWD)
 
 #ifdef BOOST_UNICODE_DOXYGEN_INVOKED
 /** INTERNAL ONLY */
-#define BOOST_UNICODE_COMPOSE_CONCAT_DEF(name, nf, convert, n) \
+#define BOOST_UNICODE_COMPOSE_CONCAT_DEF(name, nf, convert, n) \
 /** Concatenates two ranges of UTF code units and puts the result in \c out.
    Throws \c std::out_of_range if the input or resulting strings are not stream-safe.
    \pre \c Range1 and \c Range2 are in Normalized Form nf, have the same value type and are non-empty.
- \post \c out is in Normalized Form nf and is stream-safe. */ \
+ \post \c out is in Normalized Form nf and is stream-safe. */ \
 template<typename Range1, typename Range2, typename OutputIterator, typename... T> \
 OutputIterator name##_concat(const Range1& range1, const Range2& range2, OutputIterator out, const T&... args);
 #else
 #define BOOST_UNICODE_COMPOSE_CONCAT_DEF(name, nf, convert, n) \
 BOOST_PP_REPEAT(BOOST_PP_INC(n), BOOST_UNICODE_COMPOSE_CONCAT_DEF_A, (name)(convert))
-#endif
 
-/** INTERNAL ONLY */
 #define BOOST_UNICODE_COMPOSE_CONCAT_DEF_A(z, n, seq) \
 template<typename Range1, typename Range2, typename OutputIterator BOOST_PP_COMMA_IF(n) BOOST_PP_ENUM_PARAMS(n, typename T)> \
 OutputIterator BOOST_PP_CAT(BOOST_PP_SEQ_ELEM(0, seq), _concat)(const Range1& range1, const Range2& range2, OutputIterator out BOOST_PP_COMMA_IF(n) BOOST_PP_ENUM_BINARY_PARAMS(n, const T, & t)) \
@@ -120,49 +119,46 @@
     t = cat_limits(range1, range2); \
      \
     out = copy(t.get<0>(), out); \
- out = convert(boost::join(t.get<1>(), t.get<2>()), make_converted_converter(utf_decoder(), BOOST_PP_SEQ_ELEM(1, seq)(BOOST_PP_ENUM_PARAMS(n, t))), utf_encoded_out<typename range_value<const Range1>::type>(out)).base(); \
+ out = convert(boost::join(t.get<1>(), t.get<2>()), make_converted_converter(utf_decoder(), BOOST_PP_SEQ_ELEM(1, seq)(BOOST_PP_ENUM_PARAMS(n, t))), adaptors::utf_encode_output<typename range_value<const Range1>::type>(out)).base(); \
     return copy(t.get<3>(), out); \
 }
+#endif
 
 #ifdef BOOST_UNICODE_DOXYGEN_INVOKED
 /** INTERNAL ONLY */
-#define BOOST_UNICODE_COMPOSE_CONCATED_DEF(name, nf, convert, n) \
+#define BOOST_UNICODE_COMPOSE_CONCATED_DEF(name, nf, convert, n) \
 /** Concatenates two ranges of UTF code units and returns the result as a lazily
    evaluated range.
    Throws \c std::out_of_range if the input or resulting strings are not stream-safe.
    \pre \c Range1 and \c Range2 are in Normalized Form nf, have the same value type and are non-empty.
- \return Lazy stream-safe range in Normalized Form nf. */ \
+ \return Lazy stream-safe range in Normalized Form nf. */ \
 template<typename Range1, typename Range2, typename... T> \
-detail::unspecified<void> name##_concated(const Range1& range1, const Range2& range2, const T&... args);
+detail::unspecified<void> name##_concat(const Range1& range1, const Range2& range2, const T&... args);
 #else
 #define BOOST_UNICODE_COMPOSE_CONCATED_DEF(name, nf, convert, n) \
 BOOST_PP_REPEAT(BOOST_PP_INC(n), BOOST_UNICODE_COMPOSE_CONCATED_DEF_A, (name)(convert))
-#endif
 
-/** INTERNAL ONLY */
 #define BOOST_UNICODE_COMPOSE_CONCATED_DEF_A(z, n, seq) \
 template<typename Range1, typename Range2 BOOST_PP_COMMA_IF(n) BOOST_PP_ENUM_PARAMS(n, typename T)> \
 joined_range< \
     sub_range<const Range1>, \
     joined_range< \
- iterator_range< \
- convert_iterator< \
- joined_range< \
- sub_range<const Range1>, \
- sub_range<const Range2> \
- >, \
- converted_converter< \
- utf_decoder, \
- multi_converter< \
- BOOST_PP_SEQ_ELEM(1, seq), \
- utf_encoder<typename range_value<const Range1>::type> \
- > \
+ converted_range< \
+ joined_range< \
+ sub_range<const Range1>, \
+ sub_range<const Range2> \
+ >, \
+ converted_converter< \
+ utf_decoder, \
+ multi_converter< \
+ BOOST_PP_SEQ_ELEM(1, seq), \
+ utf_encoder<typename range_value<const Range1>::type> \
> \
> \
>, \
         sub_range<const Range2> \
> \
-> BOOST_PP_CAT(BOOST_PP_SEQ_ELEM(0, seq), _concated)(const Range1& range1, const Range2& range2 BOOST_PP_COMMA_IF(n) BOOST_PP_ENUM_BINARY_PARAMS(n, const T, & t)) \
+> BOOST_PP_CAT(BOOST_PP_SEQ_ELEM(0, seq), _concat)(const Range1& range1, const Range2& range2 BOOST_PP_COMMA_IF(n) BOOST_PP_ENUM_BINARY_PARAMS(n, const T, & t)) \
 { \
     tuple< \
         sub_range<const Range1>, \
@@ -174,7 +170,7 @@
      \
     return boost::join( \
         t.get<0>(), \
- boost::join(convertd( \
+ boost::join(boost::adaptors::convert( \
             boost::join(t.get<1>(), t.get<2>()), \
             make_converted_converter( \
                 utf_decoder(), \
@@ -187,10 +183,13 @@
         t.get<3>() \
     )); \
 }
+#endif
 
 /** INTERNAL ONLY */
-#define BOOST_UNICODE_COMPOSE_CAT_DEF(name, nf, convert, n) \
-BOOST_UNICODE_COMPOSE_CONCATED_DEF(name, nf, convert, n) \
+#define BOOST_UNICODE_COMPOSE_CAT_DEF(name, nf, convert, n) \
+namespace adaptors { \
+BOOST_UNICODE_COMPOSE_CONCATED_DEF(name, nf, convert, n) \
+} \
 BOOST_UNICODE_COMPOSE_CONCAT_DEF(name, nf, convert, n)
 
 BOOST_UNICODE_COMPOSE_CAT_DEF(composed, C, normalizer, 1)

Modified: sandbox/SOC/2009/unicode/boost/unicode/combining.hpp
==============================================================================
--- sandbox/SOC/2009/unicode/boost/unicode/combining.hpp (original)
+++ sandbox/SOC/2009/unicode/boost/unicode/combining.hpp 2010-07-04 12:36:05 EDT (Sun, 04 Jul 2010)
@@ -176,33 +176,7 @@
     }
 };
 
-#ifdef BOOST_UNICODE_DOXYGEN_INVOKED
-/** Turns a range of code points into a range of subranges of code points,
- * each subrange being a combining character sequence. */
-template<typename Range>
-iterator_range<
- segment_iterator<typename range_iterator<Range>::type, combiner>
->
-combine_bounded(Range&& range);
-#else
-template<typename Range>
-iterator_range<
- segment_iterator<typename range_iterator<const Range>::type, combiner>
->
-combine_bounded(const Range& range)
-{
- return segmented(range, combiner());
-}
-
-template<typename Range>
-iterator_range<
- segment_iterator<typename range_iterator<Range>::type, combiner>
->
-combine_bounded(Range& range)
-{
- return segmented(range, combiner());
-}
-#endif
+BOOST_SEGMENTER_DEF(combiner, combine)
     
 } // namespace unicode
 } // namespace boost

Modified: sandbox/SOC/2009/unicode/boost/unicode/compose.hpp
==============================================================================
--- sandbox/SOC/2009/unicode/boost/unicode/compose.hpp (original)
+++ sandbox/SOC/2009/unicode/boost/unicode/compose.hpp 2010-07-04 12:36:05 EDT (Sun, 04 Jul 2010)
@@ -2,16 +2,15 @@
 #define BOOST_UNICODE_COMPOSE_HPP
 
 #include <boost/unicode/compose_fwd.hpp>
-#include <boost/unicode/converter_def.hpp>
 
 namespace boost
 {
 namespace unicode
 {
 
-BOOST_UNICODE_PIPE_DEF(compose, 0)
-BOOST_UNICODE_PIPE_DEF(decompose, 1)
-BOOST_UNICODE_PIPE_DEF(normalize, 1)
+BOOST_CONVERTER_DEF(composer, compose)
+BOOST_CONVERTER_DEF(decomposer, decompose)
+BOOST_CONVERTER_DEF(normalizer, normalize)
 
 } // namespace unicode
 } // namespace boost

Deleted: sandbox/SOC/2009/unicode/boost/unicode/converter_def.hpp
==============================================================================
--- sandbox/SOC/2009/unicode/boost/unicode/converter_def.hpp 2010-07-04 12:36:05 EDT (Sun, 04 Jul 2010)
+++ (empty file)
@@ -1,121 +0,0 @@
-#ifndef BOOST_UNICODE_PIPE_DEF_HPP
-#define BOOST_UNICODE_PIPE_DEF_HPP
-
-#include <boost/preprocessor/punctuation/comma_if.hpp>
-#include <boost/preprocessor/repetition/enum_params.hpp>
-#include <boost/preprocessor/repetition/enum_binary_params.hpp>
-#include <boost/preprocessor/repetition/repeat.hpp>
-#include <boost/preprocessor/tuple/elem.hpp>
-#include <boost/preprocessor/cat.hpp>
-#include <boost/preprocessor/arithmetic/inc.hpp>
-
-#include <boost/detail/unspecified.hpp>
-
-#include <boost/iterator/convert_iterator.hpp>
-
-#ifdef BOOST_UNICODE_DOXYGEN_INVOKED
-/** INTERNAL ONLY */
-#define BOOST_UNICODE_PIPE_EAGER_DEF(z, n, text) \
-/** Eagerly evaluates \c unicode##::##text##r until the whole input
- range \c range has been treated, copying the result to \c out and
- returning the past-the-end output iterator. */ \
-template<typename Range, typename OutputIterator, typename... T> \
-OutputIterator text(const Range& range, OutputIterator out, const T&... args);
-#else
-#define BOOST_UNICODE_PIPE_EAGER_DEF(z, n, text) \
-template<typename Range, typename OutputIterator BOOST_PP_COMMA_IF(n) BOOST_PP_ENUM_PARAMS(n, typename T)> \
-OutputIterator text(const Range& range, OutputIterator out BOOST_PP_COMMA_IF(n) BOOST_PP_ENUM_BINARY_PARAMS(n, const T, & t)) \
-{ \
- return convert( \
- range, \
- BOOST_PP_CAT(text, r)(BOOST_PP_ENUM_PARAMS(n, t)), \
- out \
- ); \
-}
-#endif
-
-#ifdef BOOST_UNICODE_DOXYGEN_INVOKED
-/** INTERNAL ONLY */
-#define BOOST_UNICODE_PIPE_LAZY_DEF(z, n, text) \
-/** Lazily evalutes \c unicode::##text##r by returning a range
- adapter that wraps the range \c range and converts it step-by-step as
- the range is advanced. */ \
-template<typename Range, typename... T> \
-detail::unspecified<void> BOOST_PP_CAT(text, d)(Range&& range, const T&... args);
-#else
-#define BOOST_UNICODE_PIPE_LAZY_DEF(z, n, text) \
-template<typename Range BOOST_PP_COMMA_IF(n) BOOST_PP_ENUM_PARAMS(n, typename T)> \
-iterator_range< \
- convert_iterator< \
- typename range_iterator<const Range>::type, \
- unicode::BOOST_PP_CAT(text, r) \
- > \
-> \
-BOOST_PP_CAT(text, d)(const Range& range BOOST_PP_COMMA_IF(n) BOOST_PP_ENUM_BINARY_PARAMS(n, const T, & t)) \
-{ \
- return converted(range, unicode::BOOST_PP_CAT(text, r)(BOOST_PP_ENUM_PARAMS(n, t))); \
-}
-#endif
-
-#ifdef BOOST_UNICODE_DOXYGEN_INVOKED
-/** INTERNAL ONLY */
-#define BOOST_UNICODE_PIPE_LAZY_2_DEF(z, n, text)
-#else
-#define BOOST_UNICODE_PIPE_LAZY_2_DEF(z, n, text) \
-template<typename Range BOOST_PP_COMMA_IF(n) BOOST_PP_ENUM_PARAMS(n, typename T)> \
-iterator_range< \
- convert_iterator< \
- typename range_iterator<Range>::type, \
- unicode::BOOST_PP_CAT(text, r) \
- > \
-> \
-BOOST_PP_CAT(text, d)(Range& range BOOST_PP_COMMA_IF(n) BOOST_PP_ENUM_BINARY_PARAMS(n, const T, & t)) \
-{ \
- return converted(range, unicode::BOOST_PP_CAT(text, r)(BOOST_PP_ENUM_PARAMS(n, t))); \
-}
-#endif
-
-/** INTERNAL ONLY */
-#define BOOST_UNICODE_PIPE_COMMON_DEF(name, n) \
-BOOST_PP_REPEAT(BOOST_PP_INC(n), BOOST_UNICODE_PIPE_EAGER_DEF, name) \
-BOOST_PP_REPEAT(BOOST_PP_INC(n), BOOST_UNICODE_PIPE_LAZY_DEF, name) \
-BOOST_PP_REPEAT(BOOST_PP_INC(n), BOOST_UNICODE_PIPE_LAZY_2_DEF, name)
-
-#ifdef BOOST_UNICODE_DOXYGEN_INVOKED
-/** INTERNAL ONLY */
-#define BOOST_UNICODE_PIPE_OUTPUT_DEF(z, n, text) \
-/** Lazily evalutes \c unicode::##text##r by returning an output
- iterator that wraps \c out and converts every pushed element. */ \
-template<typename OutputIterator, typename... T> \
-detail::unspecified<void> \
-BOOST_PP_CAT(text, d_out)(OutputIterator out, const T&... args);
-#else
-#define BOOST_UNICODE_PIPE_OUTPUT_DEF(z, n, text) \
-template<typename OutputIterator BOOST_PP_COMMA_IF(n) BOOST_PP_ENUM_PARAMS(n, typename T)> \
-convert_output_iterator< \
- OutputIterator, \
- unicode::BOOST_PP_CAT(text, r) \
-> BOOST_PP_CAT(text, d_out)(OutputIterator out BOOST_PP_COMMA_IF(n) BOOST_PP_ENUM_BINARY_PARAMS(n, const T, & t)) \
-{ \
- return converted_output(out, unicode::BOOST_PP_CAT(text, r)(BOOST_PP_ENUM_PARAMS(n, t))); \
-}
-#endif
-
-/** Defines helper functions for usage of a \c \xmlonly<conceptname>OneManyConverter</conceptname>\endxmlonly.
- * Helper functions provide a pseudo-variadic interface where they forward all the extra arguments to
- * the constructor of the \c \xmlonly<conceptname>OneManyConverter</conceptname>\endxmlonly.
- * \arg \c name Name of the type modelling the \c \xmlonly<conceptname>OneManyConverter</conceptname>\endxmlonly.
- * \arg \c n Maximum number of optional arguments. */
-#define BOOST_UNICODE_ONE_MANY_PIPE_DEF(name, n) \
-BOOST_UNICODE_PIPE_COMMON_DEF(name, n) \
-BOOST_PP_REPEAT(BOOST_PP_INC(n), BOOST_UNICODE_PIPE_OUTPUT_DEF, name)
-
-/** Defines helper functions for usage of a \c \xmlonly<conceptname>Converter</conceptname>\endxmlonly.
- * Helper functions provide a pseudo-variadic interface where they forward all the extra arguments to
- * the constructor of the \c \xmlonly<conceptname>Converter</conceptname>\endxmlonly.
- * \arg \c name Name of the type modelling the \c \xmlonly<conceptname>Converter</conceptname>\endxmlonly.
- * \arg \c n Maximum number of optional arguments. */
-#define BOOST_UNICODE_PIPE_DEF(name, n) \
-BOOST_UNICODE_PIPE_COMMON_DEF(name, n)
-
-#endif

Added: sandbox/SOC/2009/unicode/boost/unicode/detail/cat.hpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2009/unicode/boost/unicode/detail/cat.hpp 2010-07-04 12:36:05 EDT (Sun, 04 Jul 2010)
@@ -0,0 +1,11 @@
+#ifndef BOOST_UNICODE_DETAIL_CAT_HPP
+#define BOOST_UNICODE_DETAIL_CAT_HPP
+
+#ifdef BOOST_UNICODE_DOXYGEN_INVOKED
+/** INTERNAL ONLY */
+#define BOOST_UNICODE_CAT(ns, thing) ns##::##thing
+#else
+#define BOOST_UNICODE_CAT(ns, thing) ns::thing
+#endif
+
+#endif

Modified: sandbox/SOC/2009/unicode/boost/unicode/graphemes.hpp
==============================================================================
--- sandbox/SOC/2009/unicode/boost/unicode/graphemes.hpp (original)
+++ sandbox/SOC/2009/unicode/boost/unicode/graphemes.hpp 2010-07-04 12:36:05 EDT (Sun, 04 Jul 2010)
@@ -4,6 +4,7 @@
 #include <boost/unicode/ucd/properties.hpp>
 #include <boost/utility.hpp>
 #include <boost/detail/unspecified.hpp>
+#include <boost/unicode/detail/cat.hpp>
 
 #include <boost/iterator/segment_iterator.hpp>
 
@@ -37,105 +38,28 @@
     }
 };
 
-#ifdef BOOST_UNICODE_DOXYGEN_INVOKED
-/** Adapts the range of code points \c range into a range of ranges of code points,
- * each subrange being a grapheme cluster. */
-template<typename Range>
-detail::unspecified<void> grapheme_bounded(Range&& range);
-#else
-template<typename Range>
-iterator_range<typename boost::detail::unspecified<
- segment_iterator<
- typename range_iterator<const Range>::type,
- boundary_segmenter<unicode::grapheme_boundary>
- >
->::type>
-grapheme_bounded(const Range& range)
-{
- return segmented(range, make_boundary_segmenter(unicode::grapheme_boundary()));
-}
-
-template<typename Range>
-iterator_range<typename boost::detail::unspecified<
- segment_iterator<
- typename range_iterator<Range>::type,
- boundary_segmenter<unicode::grapheme_boundary>
- >
->::type>
-grapheme_bounded(Range& range)
-{
- return segmented(range, make_boundary_segmenter(unicode::grapheme_boundary()));
-}
-#endif
+typedef boost::detail::unspecified<
+ boost::boundary_segmenter<grapheme_boundary>
+>::type grapheme_segmenter;
+BOOST_SEGMENTER_DEF(boost::unicode::grapheme_segmenter, grapheme_segment)
 
-#ifdef BOOST_UNICODE_DOXYGEN_INVOKED
 /** INTERNAL ONLY */
-#define BOOST_UNICODE_GRAPHEME_BOUNDED_DEF(Name) \
-/** Adapts the range of Name units \c range into a range of ranges of
-Name units, each subrange being a grapheme cluster. */ \
-template<typename Range> \
-detail::unspecified<void> Name##_grapheme_bounded(Range&& range); \
- \
-/** Model of \c \xmlonly<conceptname>BoundaryChecker</conceptname>\endxmlonly
-that tells whether a position lies on a grapheme cluster boundary
-within a range of Name units. */ \
-typedef multi_boundary< \
- Name##_boundary, Name##_decoder, \
- grapheme_boundary \
-> Name##_grapheme_boundary;
-#else
-#define BOOST_UNICODE_GRAPHEME_BOUNDED_DEF(Name) \
-template<typename Range> \
-iterator_range<typename boost::detail::unspecified< \
- segment_iterator< \
- typename range_iterator<const Range>::type, \
- converted_segmenter< \
- unicode::Name##_decoder, \
- boundary_segmenter<unicode::grapheme_boundary> \
- > \
+#define BOOST_UNICODE_GRAPHEME_DEF(codec) \
+typedef boost::detail::unspecified< \
+ boost::multi_boundary< \
+ codec##_boundary, \
+ codec##_decoder, \
+ grapheme_boundary \
> \
->::type> \
-Name##_grapheme_bounded(const Range& range) \
-{ \
- return segmented( \
- range, \
- make_converted_segmenter( \
- unicode::Name##_decoder(), \
- make_boundary_segmenter(unicode::grapheme_boundary()) \
- ) \
- ); \
-} \
- \
-template<typename Range> \
-iterator_range<typename boost::detail::unspecified< \
- segment_iterator< \
- typename range_iterator<Range>::type, \
- converted_segmenter< \
- unicode::Name##_decoder, \
- boundary_segmenter<unicode::grapheme_boundary> \
- > \
- > \
->::type> \
-Name##_grapheme_bounded(Range& range) \
-{ \
- return segmented( \
- range, \
- make_converted_segmenter( \
- unicode::Name##_decoder(), \
- make_boundary_segmenter(unicode::grapheme_boundary()) \
- ) \
- ); \
-} \
- \
-typedef multi_boundary< \
- Name##_boundary, Name##_decoder, \
- grapheme_boundary \
-> Name##_grapheme_boundary;
-#endif
-
-BOOST_UNICODE_GRAPHEME_BOUNDED_DEF(u16)
-BOOST_UNICODE_GRAPHEME_BOUNDED_DEF(u8)
-BOOST_UNICODE_GRAPHEME_BOUNDED_DEF(utf)
+>::type codec##_grapheme_boundary; \
+typedef boost::detail::unspecified< \
+ boost::boundary_segmenter<codec##_grapheme_boundary> \
+>::type codec##_grapheme_segmenter; \
+BOOST_SEGMENTER_DEF(BOOST_UNICODE_CAT(boost::unicode, codec##_grapheme_segmenter), codec##_grapheme_segment)
+
+BOOST_UNICODE_GRAPHEME_DEF(u8)
+BOOST_UNICODE_GRAPHEME_DEF(u16)
+BOOST_UNICODE_GRAPHEME_DEF(utf)
 
 } // unicode
 } // boost

Modified: sandbox/SOC/2009/unicode/boost/unicode/utf.hpp
==============================================================================
--- sandbox/SOC/2009/unicode/boost/unicode/utf.hpp (original)
+++ sandbox/SOC/2009/unicode/boost/unicode/utf.hpp 2010-07-04 12:36:05 EDT (Sun, 04 Jul 2010)
@@ -5,115 +5,44 @@
 #include <boost/iterator/convert_iterator.hpp>
 #include <boost/iterator/segment_iterator.hpp>
 
-#include <boost/unicode/converter_def.hpp>
-#include <boost/detail/unspecified.hpp>
+#include <boost/unicode/detail/cat.hpp>
 
 namespace boost
 {
 namespace unicode
 {
-
 /** INTERNAL ONLY */
-#define BOOST_UNICODE_ENCODER_DEF(Name) \
-BOOST_UNICODE_ONE_MANY_PIPE_DEF(Name##_encode, 0)
-
-/* */
+#define BOOST_UNICODE_ENCODER_DEF(codec) \
+BOOST_ONEMANYCONVERTER_DEF(BOOST_UNICODE_CAT(boost::unicode, codec##_encoder), codec##_encode)
 
-#ifdef BOOST_UNICODE_DOXYGEN_INVOKED
 /** INTERNAL ONLY */
-#define BOOST_UNICODE_DECODER_DEF(Name) \
-BOOST_UNICODE_PIPE_DEF(Name##_decode, 0) \
-/** Adapts the range of Name units \c range into a range of ranges of
-Name units, each subrange being a decoded unit. */ \
-template<typename Range> \
-detail::unspecified<void> Name##_bounded(Range&& range);
-#else
-#define BOOST_UNICODE_DECODER_DEF(Name) \
-BOOST_UNICODE_PIPE_DEF(Name##_decode, 0) \
- \
-template<typename Range> \
-iterator_range<typename boost::detail::unspecified< \
- segment_iterator< \
- typename range_iterator<const Range>::type, \
- converter_segmenter<unicode::Name##_decoder> \
- > \
->::type> Name##_bounded(const Range& range) \
-{ \
- return segmented( \
- range, \
- make_converter_segmenter(unicode::Name##_decoder()) \
- ); \
-} \
- \
-template<typename Range> \
-iterator_range<typename boost::detail::unspecified< \
- segment_iterator< \
- typename range_iterator<Range>::type, \
- converter_segmenter<unicode::Name##_decoder> \
- > \
->::type> Name##_bounded(Range& range) \
-{ \
- return segmented( \
- range, \
- make_converter_segmenter(unicode::Name##_decoder()) \
- ); \
-}
-#endif
+#define BOOST_UNICODE_DECODER_DEF(codec) \
+BOOST_CONVERTER_DEF(BOOST_UNICODE_CAT(boost::unicode, codec##_decoder), codec##_decode)\
+typedef boost::detail::unspecified< \
+ boost::boundary_segmenter<codec##_boundary> \
+>::type codec##_segmenter; \
+BOOST_SEGMENTER_DEF(BOOST_UNICODE_CAT(boost::unicode, codec##_segmenter), codec##_segment)
 
+BOOST_UNICODE_ENCODER_DEF(u8)
 BOOST_UNICODE_ENCODER_DEF(u16)
-BOOST_UNICODE_DECODER_DEF(u16)
+BOOST_UNICODE_ENCODER_DEF(latin1)
 
-BOOST_UNICODE_ENCODER_DEF(u8)
 BOOST_UNICODE_DECODER_DEF(u8)
-
+BOOST_UNICODE_DECODER_DEF(u16)
 BOOST_UNICODE_DECODER_DEF(utf)
 
-template<typename ValueType, typename Range, typename OutputIterator>
-OutputIterator utf_encode(const Range& range, OutputIterator out)
+namespace adaptors
 {
- return convert(range, utf_encoder<ValueType>(), out);
-}
-
-#ifdef BOOST_UNICODE_DOXYGEN_INVOKED
-template<typename ValueType, typename Range>
-detail::unspecified<void> utf_encoded(Range&& range);
-#else
-template<typename ValueType, typename Range>
-iterator_range<
- convert_iterator<
- typename range_iterator<const Range>::type,
- utf_encoder<ValueType>
- >
-> utf_encoded(const Range& range)
-{
- return converted(range, utf_encoder<ValueType>());
-}
-
-template<typename ValueType, typename Range>
-iterator_range<
- convert_iterator<
- typename range_iterator<Range>::type,
- utf_encoder<ValueType>
- >
-> utf_encoded(Range& range)
-{
- return converted(range, utf_encoder<ValueType>());
-}
-#endif
-
-template<typename ValueType, typename OutputIterator>
-typename boost::detail::unspecified<
- convert_output_iterator<
+ template<typename ValueType, typename OutputIterator>
+ boost::convert_output_iterator<
         OutputIterator,
- utf_encoder<ValueType>
- >
->::type utf_encoded_out(OutputIterator out)
-{
- return converted_output(out, utf_encoder<ValueType>());
+ boost::unicode::utf_encoder<ValueType>
+ > utf_encode_output(OutputIterator out)
+ {
+ return boost::adaptors::convert_output(out, utf_encoder<ValueType>());
+ }
 }
 
-BOOST_UNICODE_ENCODER_DEF(latin1);
-
 } // namespace unicode
 } // namespace boost
 

Modified: sandbox/SOC/2009/unicode/libs/unicode/doc/Jamfile.v2
==============================================================================
--- sandbox/SOC/2009/unicode/libs/unicode/doc/Jamfile.v2 (original)
+++ sandbox/SOC/2009/unicode/libs/unicode/doc/Jamfile.v2 2010-07-04 12:36:05 EDT (Sun, 04 Jul 2010)
@@ -21,12 +21,18 @@
         <doxygen:param>EXTRACT_ALL=YES
         <doxygen:param>"PREDEFINED=BOOST_UNICODE_DOXYGEN_INVOKED \\
                                    \"BOOST_UNICODE_DECL= \" \\
- \"BOOST_CONCEPT_REQUIRES(a,b)=/** Requires: a */ b \""
+ \"BOOST_CONCEPT_REQUIRES(a,b)=/** Requires: a */ b \" \\
+ \BOOST_UNICODE_UCD_BIG"
         <doxygen:param>HIDE_UNDOC_MEMBERS=NO
         <doxygen:param>EXTRACT_PRIVATE=NO
         <doxygen:param>ENABLE_PREPROCESSING=YES
         <doxygen:param>MACRO_EXPANSION=YES
-# <doxygen:param>EXPAND_ONLY_PREDEF=YES
+ <doxygen:param>EXPAND_ONLY_PREDEF=YES
+ <doxygen:param>"EXPAND_AS_DEFINED=BOOST_UNICODE_ENCODER_DEF BOOST_UNICODE_DECODER_DEF \\
+ BOOST_ONEMANYCONVERTER_DEF BOOST_CONVERTER_DEF BOOST_SEGMENTER_DEF \\
+ BOOST_UNICODE_GRAPHEME_DEF BOOST_UNICODE_GET_PROPERTY_DEF \\
+ BOOST_UNICODE_FWD_2 BOOST_UNICODE_CAT_LIMITS_FWD BOOST_UNICODE_CAT \\
+ BOOST_UNICODE_COMPOSE_CONCAT_DEF BOOST_UNICODE_COMPOSE_CONCATED_DEF BOOST_UNICODE_COMPOSE_CAT_DEF"
         <doxygen:param>SEARCH_INCLUDES=YES
         <doxygen:param>"INCLUDE_PATH=$(BOOST_ROOT) \\
                                      ../../../"

Modified: sandbox/SOC/2009/unicode/libs/unicode/doc/users_manual.qbk
==============================================================================
--- sandbox/SOC/2009/unicode/libs/unicode/doc/users_manual.qbk (original)
+++ sandbox/SOC/2009/unicode/libs/unicode/doc/users_manual.qbk 2010-07-04 12:36:05 EDT (Sun, 04 Jul 2010)
@@ -296,7 +296,7 @@
 
 A model of the [conceptref Segmenter] concept may then be used to segment
 a range. The [classref boost::segment_iterator], eventually invoked
-by [funcref boost::segmented], can be used to exploit that concept to
+by [funcref boost::adaptors::segment], can be used to exploit that concept to
 turn a range into a range of subranges.
 
 With the above example, the range would be converted into a range of
@@ -356,7 +356,7 @@
 iterator adapter is advanced).
 
 The [funcref boost::convert] function provides the former, while the
-[funcref boost::converted] function which returns a range in terms of
+[funcref boost::adaptors::convert] function which returns a range in terms of
 [classref boost::convert_iterator] provides the latter.
 
 With the above example, a convertd range [1, 2, 3, 4] would be converted
@@ -400,8 +400,8 @@
 
 * [classref boost::unicode::u8_encoder] is a model of the =OneManyConverter= concept.
 * [funcref boost::unicode::u8_encode] is an eager encoding algorithm.
-* [funcref boost::unicode::u8_encoded] returns a range adapter that does on-the-fly encoding.
-* [funcref boost::unicode::u8_encoded_out] returns an output iterator adapter that will encode its elements before forwarding them to the wrapped output iterator.
+* [funcref boost::unicode::adaptors::u8_encode] returns a range adapter that does on-the-fly encoding.
+* [funcref boost::unicode::adaptors::u8_encode_output] returns an output iterator adapter that will encode its elements before forwarding them to the wrapped output iterator.
 
 [note The library considers a conversion from UTF-32 an "encoding", while a conversion
 to UTF-32 is called a "decoding".
@@ -425,9 +425,9 @@
 
 * [classref boost::unicode::u8_boundary] is a =BoundaryChecker= that tells whether a position is the start of a code point in a range of UTF-8 code units.
 * [classref boost::unicode::grapheme_boundary] is a =BoundaryChecker= that tells whether a position is the start of a grapheme cluster in a range of code points.
-* [funcref boost::unicode::u8_bounded] adapts its input range in UTF-8 into a range of ranges of code units, each range being a code point.
-* [funcref boost::unicode::grapheme_bounded] adapts its input range in UTF-32 into a range of ranges of code points, each range being a grapheme cluster.
-* [funcref boost::unicode::u8_grapheme_bounded] adapts its input range in UTF-8 into a range of code units, each range being a grapheme cluster.
+* [funcref boost::unicode::adaptors::u8_segment] adapts its input range in UTF-8 into a range of ranges of code units, each range being a code point.
+* [funcref boost::unicode::adaptors::grapheme_segment] adapts its input range in UTF-32 into a range of ranges of code points, each range being a grapheme cluster.
+* [funcref boost::unicode::adaptors::u8_grapheme_segment] adapts its input range in UTF-8 into a range of code units, each range being a grapheme cluster.
 
 [heading UTF type deduction with SFINAE]
 Everytime there are two versions for a function or class, one for UTF-8 and
@@ -512,15 +512,15 @@
 
 Note concatenation with Normalization Form D is slightly more efficient as it only
 requires canonical sorting of the combining character sequence placed at
-the intersection.
+the intersection, while Normalization Form C requires the sequence be renormalized.
 
 See:
 
 * [funcref boost::unicode::cat_limits] to partition into the different sub ranges.
 * [funcref boost::unicode::composed_concat], eager version with input in Normalization Form C.
-* [funcref boost::unicode::composed_concated], lazy version with input in Normalization Form C.
+* [funcref boost::unicode::adaptors::composed_concat], lazy version with input in Normalization Form C.
 * [funcref boost::unicode::decomposed_concat], eager version with input in Normalization Form D.
-* [funcref boost::unicode::decomposed_concated], lazy version with input in Normalization Form D.
+* [funcref boost::unicode::adaptors::decomposed_concat], lazy version with input in Normalization Form D.
 
 [endsect] [/Normalization]
 

Modified: sandbox/SOC/2009/unicode/libs/unicode/example/characters.cpp
==============================================================================
--- sandbox/SOC/2009/unicode/libs/unicode/example/characters.cpp (original)
+++ sandbox/SOC/2009/unicode/libs/unicode/example/characters.cpp 2010-07-04 12:36:05 EDT (Sun, 04 Jul 2010)
@@ -23,18 +23,18 @@
     boost::iterator_range<char*> foo = boost::as_literal(foo_);
 
     std::cout << "Code units: " << boost::distance(foo) << std::endl;
- std::cout << "Code points: " << boost::distance(unicode::u8_bounded(foo)) << std::endl; /*< We could also have used `unicode::u8_decoded(foo)` here. >*/
- std::cout << "Graphemes: " << boost::distance(unicode::u8_grapheme_bounded(foo)) << std::endl; /*< We could also have used `unicode::grapheme_bounded(unicode::u8_decoded(foo))` here. >*/
+ std::cout << "Code points: " << boost::distance(unicode::adaptors::u8_segment(foo)) << std::endl; /*< We could also have used `unicode::adaptors::u8_decode(foo)` here. >*/
+ std::cout << "Graphemes: " << boost::distance(unicode::adaptors::u8_grapheme_segment(foo)) << std::endl; /*< We could also have used `unicode::adaptors::grapheme_segment(unicode::adaptors::u8_decode(foo))` here. >*/
     
     std::cout << std::endl;
     std::cout << "Code points boundaries:" << std::endl; /*< Take into account your terminal may be interpreting the carriage return when viewing the output and thus visually produce strange results. >*/
- BOOST_FOREACH(boost::iterator_range<char*> cp, unicode::u8_bounded(foo)) /*< In case the type of `cp` is too difficult to deduce, you could use `BOOST_FOREACH_AUTO` if your platform supports it or type erasure with `boost::lazy_range<char>` if you don't mind the overhead. >*/
+ BOOST_FOREACH(boost::iterator_range<char*> cp, unicode::adaptors::u8_segment(foo)) /*< In case the type of `cp` is too difficult to deduce, you could use `BOOST_FOREACH_AUTO` if your platform supports it or type erasure with `boost::lazy_range<char>` if you don't mind the overhead. >*/
         std::cout << '(' << cp << ')';
     std::cout << std::endl;
     
     std::cout << std::endl;
     std::cout << "Graphemes boundaries:" << std::endl;
- BOOST_FOREACH(boost::iterator_range<char*> grapheme, unicode::u8_grapheme_bounded(foo))
+ BOOST_FOREACH(boost::iterator_range<char*> grapheme, unicode::adaptors::u8_grapheme_segment(foo))
         std::cout << '(' << grapheme << ')';
     std::cout << std::endl;
 }

Modified: sandbox/SOC/2009/unicode/libs/unicode/example/convert.cpp
==============================================================================
--- sandbox/SOC/2009/unicode/libs/unicode/example/convert.cpp (original)
+++ sandbox/SOC/2009/unicode/libs/unicode/example/convert.cpp 2010-07-04 12:36:05 EDT (Sun, 04 Jul 2010)
@@ -33,22 +33,22 @@
     
 //` Decoding eager, stream iterator lazily encoded:
     unicode::utf_decode(foo,
- unicode::u8_encoded_out(
+ unicode::adaptors::u8_encode_output(
             std::ostream_iterator<char>(std::cout)
         )
     );
     std::cout << std::endl;
 
 //` Decoding is lazy, encoding is eager, using one buffer:
- unicode::u8_encode(unicode::utf_decoded(foo), std::back_inserter(baz));
+ unicode::u8_encode(unicode::adaptors::utf_decode(foo), std::back_inserter(baz));
     std::cout << baz << std::endl;
     
 //` Decoding is lazy, encoding is eager, using stream iterators:
- unicode::u8_encode(unicode::utf_decoded(foo), std::ostream_iterator<char>(std::cout));
+ unicode::u8_encode(unicode::adaptors::utf_decode(foo), std::ostream_iterator<char>(std::cout));
     std::cout << std::endl;
 
 //` Fully lazy (recommended unless you need to store the result in a specific container):
- std::cout << unicode::u8_encoded(unicode::utf_decoded(foo)) << std::endl;
+ std::cout << unicode::adaptors::u8_encode(unicode::adaptors::utf_decode(foo)) << std::endl;
     
 }
 //]

Modified: sandbox/SOC/2009/unicode/libs/unicode/example/search.cpp
==============================================================================
--- sandbox/SOC/2009/unicode/libs/unicode/example/search.cpp (original)
+++ sandbox/SOC/2009/unicode/libs/unicode/example/search.cpp 2010-07-04 12:36:05 EDT (Sun, 04 Jul 2010)
@@ -27,11 +27,11 @@
 as well as it's version in terms of graphemes
 */
     char foo[] = "foo\xcc\x82" "foo";
- BOOST_AUTO(foo_bounded, unicode::utf_grapheme_bounded(boost::as_literal(foo)));
+ BOOST_AUTO(foo_bounded, unicode::adaptors::utf_grapheme_segment(boost::as_literal(foo)));
     
 //` We do the same thing for the string we're going to look for, "foo"
     char search[] = "foo";
- BOOST_AUTO(search_bounded, unicode::utf_grapheme_bounded(boost::as_literal(search)));
+ BOOST_AUTO(search_bounded, unicode::adaptors::utf_grapheme_segment(boost::as_literal(search)));
     
 //` We perform the search using the ranges of graphemes, i.e. the [conceptref Segmenter]-based approach:
     BOOST_AUTO(range_segmenter, boost::algorithm::find_first(foo_bounded, search_bounded));

Modified: sandbox/SOC/2009/unicode/libs/unicode/example/source_input.cpp
==============================================================================
--- sandbox/SOC/2009/unicode/libs/unicode/example/source_input.cpp (original)
+++ sandbox/SOC/2009/unicode/libs/unicode/example/source_input.cpp 2010-07-04 12:36:05 EDT (Sun, 04 Jul 2010)
@@ -61,8 +61,8 @@
 Wide strings are either UTF-16 or UTF-32, we convert them to UTF-32
 then back to UTF-8:
 */
- std::cout << unicode::u8_encoded(unicode::utf_decoded(utfx_1)) << std::endl;
- std::cout << unicode::u8_encoded(unicode::utf_decoded(utfx_2)) << std::endl;
+ std::cout << unicode::adaptors::u8_encode(unicode::adaptors::utf_decode(utfx_1)) << std::endl;
+ std::cout << unicode::adaptors::u8_encode(unicode::adaptors::utf_decode(utfx_2)) << std::endl;
 
 /*`
 Compile-time UTF-8 strings just need to be converted to runtime ones:

Modified: sandbox/SOC/2009/unicode/libs/unicode/test/unicode/range_test.hpp
==============================================================================
--- sandbox/SOC/2009/unicode/libs/unicode/test/unicode/range_test.hpp (original)
+++ sandbox/SOC/2009/unicode/libs/unicode/test/unicode/range_test.hpp 2010-07-04 12:36:05 EDT (Sun, 04 Jul 2010)
@@ -34,16 +34,6 @@
     
     return ss.str();
 }
-
-template<typename Range>
-boost::reverse_range<
- const Range
->
-reversed(const Range& range)
-{
- return boost::adaptors::reverse(range);
-}
-
 } // namespace detail
 
 #define CHECK_EQUALS(range1, range2) \
@@ -56,11 +46,10 @@
  * part of the convert also works */
 #define CHECK_BI_EQUALS(range1, range2) \
 do { \
- using detail::reversed; \
     CHECK_EQUALS(range1, range2); \
     CHECK_EQUALS( \
- reversed(range1), \
- reversed(range2) \
+ boost::adaptors::reverse(range1), \
+ boost::adaptors::reverse(range2) \
     ); \
 } while(0)
 

Modified: sandbox/SOC/2009/unicode/libs/unicode/test/unicode/test_compose.cpp
==============================================================================
--- sandbox/SOC/2009/unicode/libs/unicode/test/unicode/test_compose.cpp (original)
+++ sandbox/SOC/2009/unicode/libs/unicode/test/unicode/test_compose.cpp 2010-07-04 12:36:05 EDT (Sun, 04 Jul 2010)
@@ -12,11 +12,10 @@
 using boost::assign::list_of;
 using boost::char32;
 
-#define CHECK_COMP(range1, range2) \
-do { \
- using unicode::decomposed; using unicode::composed; \
- CHECK_BI_EQUALS(decomposed(range1), range2); \
- CHECK_BI_EQUALS(range1, composed(range2)); \
+#define CHECK_COMP(range1, range2) \
+do { \
+ CHECK_BI_EQUALS(unicode::adaptors::decompose(range1), range2); \
+ CHECK_BI_EQUALS(range1, unicode::adaptors::compose(range2)); \
 } while(0)
 
 BOOST_AUTO_TEST_CASE( decomposition )
@@ -29,7 +28,7 @@
     
     // Canonical reordering test
     CHECK_BI_EQUALS(
- unicode::decomposed(list_of<char32>(0x1e17)(0x330)),
+ unicode::adaptors::decompose(list_of<char32>(0x1e17)(0x330)),
         list_of<char32>(0x65)(0x330)(0x304)(0x301)
     );
     
@@ -40,7 +39,7 @@
     );
     
     CHECK_BI_EQUALS(
- unicode::decomposed(list_of<char32>(0xA8), UINT_MAX),
+ unicode::adaptors::decompose(list_of<char32>(0xA8), UINT_MAX),
         list_of<char32>(0x20)(0x308)
     );
 }
@@ -64,7 +63,7 @@
 {
     // Canonical reordering
     CHECK_BI_EQUALS(
- unicode::normalized(list_of<char32>(0x1e17)(0x330)),
+ unicode::adaptors::normalize(list_of<char32>(0x1e17)(0x330)),
         list_of<char32>(0x1e1b)(0x304)(0x301)
     );
 }

Modified: sandbox/SOC/2009/unicode/libs/unicode/test/unicode/test_utf.cpp
==============================================================================
--- sandbox/SOC/2009/unicode/libs/unicode/test/unicode/test_utf.cpp (original)
+++ sandbox/SOC/2009/unicode/libs/unicode/test/unicode/test_utf.cpp 2010-07-04 12:36:05 EDT (Sun, 04 Jul 2010)
@@ -13,9 +13,9 @@
 
 #define CHECK_UTF(name, range1, range2) \
 do { \
- using unicode::u##name##_encoded; using unicode::u##name##_decoded; \
- CHECK_BI_EQUALS(u##name##_encoded(range1), range2); \
- CHECK_BI_EQUALS(range1, u##name##_decoded(range2)); \
+ using unicode::adaptors::u##name##_encode; using unicode::adaptors::u##name##_decode; \
+ CHECK_BI_EQUALS(u##name##_encode(range1), range2); \
+ CHECK_BI_EQUALS(range1, u##name##_decode(range2)); \
 } while(0)
 
 BOOST_AUTO_TEST_CASE( basic )


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk