Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r52858 - in sandbox/SOC/2009/unicode: . boost boost/iterator boost/unicode libs libs/unicode libs/unicode/doc libs/unicode/doc/html libs/unicode/doc/html/images libs/unicode/example libs/unicode/src
From: loufoque_at_[hidden]
Date: 2009-05-08 21:19:21


Author: mgaunard
Date: 2009-05-08 21:19:18 EDT (Fri, 08 May 2009)
New Revision: 52858
URL: http://svn.boost.org/trac/boost/changeset/52858

Log:
first draft of utf range adaptors
Added:
   sandbox/SOC/2009/unicode/
   sandbox/SOC/2009/unicode/boost/
   sandbox/SOC/2009/unicode/boost-build.jam (contents, props changed)
   sandbox/SOC/2009/unicode/boost/iterator/
   sandbox/SOC/2009/unicode/boost/iterator/pack_iterator.hpp (contents, props changed)
   sandbox/SOC/2009/unicode/boost/unicode/
   sandbox/SOC/2009/unicode/boost/unicode/unicode_iterator.hpp (contents, props changed)
   sandbox/SOC/2009/unicode/libs/
   sandbox/SOC/2009/unicode/libs/unicode/
   sandbox/SOC/2009/unicode/libs/unicode/boost.png (contents, props changed)
   sandbox/SOC/2009/unicode/libs/unicode/doc/
   sandbox/SOC/2009/unicode/libs/unicode/doc/Jamfile.v2 (contents, props changed)
   sandbox/SOC/2009/unicode/libs/unicode/doc/html/
   sandbox/SOC/2009/unicode/libs/unicode/doc/html/boostbook.css (contents, props changed)
   sandbox/SOC/2009/unicode/libs/unicode/doc/html/images/
   sandbox/SOC/2009/unicode/libs/unicode/doc/html/images/blank.png (contents, props changed)
   sandbox/SOC/2009/unicode/libs/unicode/doc/html/images/caution.png (contents, props changed)
   sandbox/SOC/2009/unicode/libs/unicode/doc/html/images/draft.png (contents, props changed)
   sandbox/SOC/2009/unicode/libs/unicode/doc/html/images/home.png (contents, props changed)
   sandbox/SOC/2009/unicode/libs/unicode/doc/html/images/important.png (contents, props changed)
   sandbox/SOC/2009/unicode/libs/unicode/doc/html/images/next.png (contents, props changed)
   sandbox/SOC/2009/unicode/libs/unicode/doc/html/images/next_disabled.png (contents, props changed)
   sandbox/SOC/2009/unicode/libs/unicode/doc/html/images/note.png (contents, props changed)
   sandbox/SOC/2009/unicode/libs/unicode/doc/html/images/prev.png (contents, props changed)
   sandbox/SOC/2009/unicode/libs/unicode/doc/html/images/prev_disabled.png (contents, props changed)
   sandbox/SOC/2009/unicode/libs/unicode/doc/html/images/tip.png (contents, props changed)
   sandbox/SOC/2009/unicode/libs/unicode/doc/html/images/toc-blank.png (contents, props changed)
   sandbox/SOC/2009/unicode/libs/unicode/doc/html/images/toc-minus.png (contents, props changed)
   sandbox/SOC/2009/unicode/libs/unicode/doc/html/images/toc-plus.png (contents, props changed)
   sandbox/SOC/2009/unicode/libs/unicode/doc/html/images/up.png (contents, props changed)
   sandbox/SOC/2009/unicode/libs/unicode/doc/html/images/up_disabled.png (contents, props changed)
   sandbox/SOC/2009/unicode/libs/unicode/doc/html/images/warning.png (contents, props changed)
   sandbox/SOC/2009/unicode/libs/unicode/doc/users_manual.qbk (contents, props changed)
   sandbox/SOC/2009/unicode/libs/unicode/example/
   sandbox/SOC/2009/unicode/libs/unicode/example/Jamfile.v2 (contents, props changed)
   sandbox/SOC/2009/unicode/libs/unicode/example/test.cpp (contents, props changed)
   sandbox/SOC/2009/unicode/libs/unicode/src/
   sandbox/SOC/2009/unicode/libs/unicode/src/Jamfile.v2 (contents, props changed)
   sandbox/SOC/2009/unicode/libs/unicode/src/src.cpp (contents, props changed)
   sandbox/SOC/2009/unicode/project-root.jam (contents, props changed)

Added: sandbox/SOC/2009/unicode/boost-build.jam
==============================================================================
--- (empty file)
+++ sandbox/SOC/2009/unicode/boost-build.jam 2009-05-08 21:19:18 EDT (Fri, 08 May 2009)
@@ -0,0 +1 @@
+boost-build $(BOOST_ROOT)/tools/build/v2 ;

Added: sandbox/SOC/2009/unicode/boost/iterator/pack_iterator.hpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2009/unicode/boost/iterator/pack_iterator.hpp 2009-05-08 21:19:18 EDT (Fri, 08 May 2009)
@@ -0,0 +1,167 @@
+#ifndef BOOST_PACK_ITERATOR_HPP
+#define BOOST_BACK_ITERATOR_HPP
+
+#include <boost/iterator/iterator_facade.hpp>
+#include <iterator>
+#include <vector>
+#include <utility>
+#include <boost/range.hpp>
+
+#include <iostream>
+
+namespace boost
+{
+
+template<typename P>
+struct packer
+{
+ packer(P p_) : p(p_)
+ {
+ }
+
+ typedef typename P::output_type output_type;
+
+ template<typename Range, typename It>
+ std::pair<
+ typename boost::range_iterator<Range>::type,
+ It
+ >
+ left(const Range& in, It out)
+ {
+ assert(!boost::empty(in));
+
+ p(*boost::begin(in), out);
+ return std::make_pair(++boost::begin(in), out);
+ }
+
+ template<typename Range, typename OutputIterator>
+ std::pair<
+ typename boost::range_iterator<Range>::type,
+ OutputIterator
+ >
+ right(const Range& in, OutputIterator out)
+ {
+ assert(!boost::empty(in));
+
+ p(*--boost::end(in), out);
+ return std::make_pair(--boost::end(in), out);
+ }
+
+private:
+ P p;
+};
+
+template<typename P>
+packer<P> make_packer(P p)
+{
+ return packer<P>(p);
+}
+
+template<typename It, typename Packer>
+struct pack_iterator
+ : boost::iterator_facade<
+ pack_iterator<It, Packer>,
+ typename Packer::output_type,
+ std::bidirectional_iterator_tag,
+ const typename Packer::output_type
+ >
+{
+ typedef boost::iterator_facade<
+ pack_iterator<It, Packer>,
+ typename Packer::output_type,
+ std::bidirectional_iterator_tag,
+ const typename Packer::output_type
+ > base_type;
+
+ pack_iterator(It begin_, It pos_, It end_, Packer p_) : pos(pos_), begin(begin_), end(end_), index(0), p(p_)
+ {
+ if(pos != end)
+ next_pos = p.left(std::make_pair(pos, end), std::back_inserter(values)).first;
+ }
+
+ It base() const
+ {
+ return pos;
+ }
+
+private:
+ typedef typename Packer::output_type T;
+
+ friend class boost::iterator_core_access;
+
+ typename base_type::reference dereference() const
+ {
+ return values[index];
+ }
+
+ void increment()
+ {
+ if(index != values.size()-1)
+ {
+ index++;
+ }
+ else
+ {
+ values.clear();
+
+ pos = next_pos;
+ if(pos != end)
+ next_pos = p.left(std::make_pair(pos, end), std::back_inserter(values)).first;
+ index = 0;
+ }
+ }
+
+ void decrement()
+ {
+ if(index != 0)
+ {
+ index--;
+ }
+ else
+ {
+ values.clear();
+
+ next_pos = pos;
+ pos = p.right(std::make_pair(begin, pos), std::back_inserter(values)).first;
+ index = values.size()-1;
+ }
+ }
+
+ bool equal(const pack_iterator& other) const
+ {
+ return pos == other.pos && index == other.index;
+ }
+
+ It pos;
+ It next_pos;
+
+ It begin;
+ It end;
+ size_t index;
+
+ Packer p;
+
+ std::vector<T> values;
+};
+
+template<typename It, typename P>
+pack_iterator<It, P> make_pack_iterator(It begin, It pos, It end, P p)
+{
+ return pack_iterator<It, P>(begin, pos, end, p);
+}
+
+template<typename Range, typename P>
+std::pair<
+ pack_iterator<typename boost::range_iterator<const Range>::type, P>,
+ pack_iterator<typename boost::range_iterator<const Range>::type, P>
+> make_pack_range(const Range& range, P p)
+{
+ return std::make_pair(
+ make_pack_iterator(boost::begin(range), boost::begin(range), boost::end(range), p),
+ make_pack_iterator(boost::begin(range), boost::end(range), boost::end(range), p)
+ );
+}
+
+} // namespace boost
+
+#endif

Added: sandbox/SOC/2009/unicode/boost/unicode/unicode_iterator.hpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2009/unicode/boost/unicode/unicode_iterator.hpp 2009-05-08 21:19:18 EDT (Fri, 08 May 2009)
@@ -0,0 +1,371 @@
+#ifndef BOOST_UNICODE_ITERATOR_HPP
+#define BOOST_UNICODE_ITERATOR_HPP
+
+#include <boost/cstdint.hpp>
+#include <boost/assert.hpp>
+#include <boost/static_assert.hpp>
+#include <boost/throw_exception.hpp>
+#include <stdexcept>
+#ifndef BOOST_NO_STD_LOCALE
+#include <sstream>
+#include <ios>
+#endif
+#include <limits.h> // CHAR_BIT
+
+#include <boost/iterator/pack_iterator.hpp>
+
+namespace boost
+{
+
+namespace detail
+{
+
+static const ::boost::uint16_t high_surrogate_base = 0xD7C0u;
+static const ::boost::uint16_t low_surrogate_base = 0xDC00u;
+static const ::boost::uint32_t ten_bit_mask = 0x3FFu;
+
+inline bool is_high_surrogate(::boost::uint16_t v)
+{
+ return (v & 0xFC00u) == 0xd800u;
+}
+inline bool is_low_surrogate(::boost::uint16_t v)
+{
+ return (v & 0xFC00u) == 0xdc00u;
+}
+template <class T>
+inline bool is_surrogate(T v)
+{
+ return (v & 0xF800u) == 0xd800;
+}
+
+inline unsigned utf8_byte_count(boost::uint8_t c)
+{
+ // if the most significant bit with a zero in it is in position
+ // 8-N then there are N bytes in this UTF-8 sequence:
+ boost::uint8_t mask = 0x80u;
+ unsigned result = 0;
+ while(c & mask)
+ {
+ ++result;
+ mask >>= 1;
+ }
+ return (result == 0) ? 1 : ((result > 4) ? 4 : result);
+}
+
+inline unsigned utf8_trailing_byte_count(boost::uint8_t c)
+{
+ return utf8_byte_count(c) - 1;
+}
+
+inline void invalid_code_point(::boost::uint32_t val)
+{
+#ifndef BOOST_NO_STD_LOCALE
+ std::stringstream ss;
+ ss << "Invalid UTF-32 code point U+" << std::showbase << std::hex << val << " encountered while trying to encode UTF-16 sequence";
+ std::out_of_range e(ss.str());
+#else
+ std::out_of_range e("Invalid UTF-32 code point encountered while trying to encode UTF-16 sequence");
+#endif
+ boost::throw_exception(e);
+}
+
+template<typename Range>
+inline void invalid_utf_sequence(const Range& r)
+{
+#ifndef BOOST_NO_STD_LOCALE
+ std::stringstream ss;
+ ss << "Invalid UTF sequence " << std::showbase << std::hex;
+ for(typename boost::range_iterator<const Range>::type it = boost::begin(r); it != boost::end(r); ++it)
+ ss << *it << " ";
+ ss << "encountered while trying to decode UTF-32 sequence";
+ std::out_of_range e(ss.str());
+#else
+ std::out_of_range e("Invalid UTF sequence encountered while trying to decode UTF-32 sequence");
+#endif
+ boost::throw_exception(e);
+}
+
+struct u16_packer
+{
+ typedef boost::uint16_t output_type;
+
+ template<typename OutputIterator>
+ OutputIterator operator()(boost::uint32_t v, OutputIterator out)
+ {
+ if(v >= 0x10000u)
+ {
+ if(v > 0x10FFFFu)
+ detail::invalid_code_point(v);
+
+ // split into two surrogates:
+ output_type hi = static_cast<output_type>(v >> 10) + detail::high_surrogate_base;
+ output_type lo = static_cast<output_type>(v & detail::ten_bit_mask) + detail::low_surrogate_base;
+
+ BOOST_ASSERT(detail::is_high_surrogate(hi));
+ BOOST_ASSERT(detail::is_low_surrogate(lo));
+
+ *out++ = hi;
+ *out++ = lo;
+ }
+ else
+ {
+ // 16-bit code point:
+ output_type cp = static_cast<output_type>(v);
+
+ // value must not be a surrogate:
+ if(detail::is_surrogate(cp))
+ detail::invalid_code_point(v);
+
+ *out++ = cp;
+ }
+
+ return out;
+ }
+};
+
+struct u16_unpacker
+{
+ typedef boost::uint32_t output_type;
+
+ template<typename Range, typename It>
+ std::pair<
+ typename boost::range_iterator<Range>::type,
+ It
+ >
+ left(const Range& in, It out)
+ {
+ assert(!boost::empty(in));
+
+ typename boost::range_iterator<const Range>::type it(boost::begin(in));
+
+ boost::uint32_t value = *it;
+
+ if(detail::is_high_surrogate(value))
+ {
+ if(++it == boost::end(in))
+ detail::invalid_utf_sequence(in);
+
+ // precondition; next value must have be a low-surrogate:
+ boost::uint16_t lo = *it;
+ if(!detail::is_low_surrogate(lo))
+ detail::invalid_code_point(lo);
+
+ value = code_point(value, lo);
+ }
+ // postcondition; result must not be a surrogate:
+ if(detail::is_surrogate(value))
+ detail::invalid_code_point(static_cast<boost::uint16_t>(value));
+
+ *out++ = value;
+
+ return std::make_pair(++it, out);
+ }
+
+ template<typename Range, typename OutputIterator>
+ std::pair<
+ typename boost::range_iterator<Range>::type,
+ OutputIterator
+ >
+ right(const Range& in, OutputIterator out)
+ {
+ assert(!boost::empty(in));
+
+ typename boost::range_iterator<const Range>::type it = --boost::end(in);
+
+ boost::uint32_t value = *it;
+
+ if(detail::is_low_surrogate(value))
+ {
+ if(it == boost::begin(in))
+ invalid_utf_sequence(in);
+ --it;
+
+ boost::uint16_t hi = *it;
+ if(!detail::is_high_surrogate(hi))
+ invalid_code_point(hi);
+
+ value = code_point(hi, value);
+ }
+ // postcondition; result must not be a surrogate:
+ if(detail::is_surrogate(value))
+ invalid_code_point(static_cast<boost::uint16_t>(value));
+
+ *out++ = value;
+
+ return std::make_pair(it, out);
+ }
+
+private:
+ boost::uint32_t code_point(boost::uint16_t hi, boost::uint16_t lo)
+ {
+ return ((hi - detail::high_surrogate_base) << 10)
+ | (static_cast<boost::uint32_t>(static_cast<boost::uint16_t>(lo)) & detail::ten_bit_mask);
+ }
+};
+
+struct u8_packer
+{
+ typedef boost::uint8_t output_type;
+
+ template<typename OutputIterator>
+ OutputIterator operator()(boost::uint32_t c, OutputIterator out)
+ {
+ if(c > 0x10FFFFu)
+ detail::invalid_code_point(c);
+
+ if(c < 0x80u)
+ {
+ *out++ = static_cast<unsigned char>(c);
+ }
+ else if(c < 0x800u)
+ {
+ *out++ = static_cast<unsigned char>(0xC0u + (c >> 6));
+ *out++ = static_cast<unsigned char>(0x80u + (c & 0x3Fu));
+ }
+ else if(c < 0x10000u)
+ {
+ *out++ = static_cast<unsigned char>(0xE0u + (c >> 12));
+ *out++ = static_cast<unsigned char>(0x80u + ((c >> 6) & 0x3Fu));
+ *out++ = static_cast<unsigned char>(0x80u + (c & 0x3Fu));
+ }
+ else
+ {
+ *out++ = static_cast<unsigned char>(0xF0u + (c >> 18));
+ *out++ = static_cast<unsigned char>(0x80u + ((c >> 12) & 0x3Fu));
+ *out++ = static_cast<unsigned char>(0x80u + ((c >> 6) & 0x3Fu));
+ *out++ = static_cast<unsigned char>(0x80u + (c & 0x3Fu));
+ }
+
+ return out;
+ }
+};
+
+struct u8_unpacker
+{
+ typedef boost::uint32_t output_type;
+
+ template<typename Range, typename It>
+ std::pair<
+ typename boost::range_iterator<Range>::type,
+ It
+ >
+ left(const Range& in, It out)
+ {
+ assert(!boost::empty(in));
+
+ typename boost::range_iterator<const Range>::type it(boost::begin(in));
+
+ boost::uint32_t value = *it;
+
+ if((value & 0xC0u) == 0x80u)
+ detail::invalid_utf_sequence(in);
+
+ // see how many extra byts we have:
+ unsigned extra = detail::utf8_trailing_byte_count(value);
+ // extract the extra bits, 6 from each extra byte:
+
+ for(unsigned c = 0; c < extra; ++c)
+ {
+ if(++it == boost::end(in))
+ detail::invalid_utf_sequence(in);
+
+ value <<= 6;
+ value += static_cast<boost::uint8_t>(*it) & 0x3Fu;
+ }
+
+ // we now need to remove a few of the leftmost bits, but how many depends
+ // upon how many extra bytes we've extracted:
+ static const boost::uint32_t masks[4] =
+ {
+ 0x7Fu,
+ 0x7FFu,
+ 0xFFFFu,
+ 0x1FFFFFu,
+ };
+ value &= masks[extra];
+
+ // check the result:
+ if(value > static_cast<boost::uint32_t>(0x10FFFFu))
+ invalid_utf_sequence(in);
+
+ *out++ = value;
+
+ return std::make_pair(++it, out);
+ }
+
+ template<typename Range, typename OutputIterator>
+ std::pair<
+ typename boost::range_iterator<Range>::type,
+ OutputIterator
+ >
+ right(const Range& in, OutputIterator out)
+ {
+ assert(!boost::empty(in));
+
+ typename boost::range_iterator<const Range>::type it = --boost::end(in);
+
+ boost::uint32_t value = *it;
+
+ // Keep backtracking until we don't have a trailing character:
+ unsigned count = 0;
+ while((*it & 0xC0u) == 0x80u)
+ {
+ if(count >= 4 || it == boost::begin(in))
+ invalid_utf_sequence(in);
+
+ --it;
+ ++count;
+ }
+
+ // now check that the sequence was valid:
+ if(count != detail::utf8_trailing_byte_count(value))
+ invalid_utf_sequence(in);
+
+ out = left(std::make_pair(it, boost::end(in)), out).second;
+ return std::make_pair(it, out);
+ }
+};
+
+} // namespace detail
+
+template<typename Range>
+std::pair<
+ pack_iterator<typename boost::range_iterator<const Range>::type, packer<detail::u16_packer> >,
+ pack_iterator<typename boost::range_iterator<const Range>::type, packer<detail::u16_packer> >
+> make_u32_to_u16_range(const Range& range)
+{
+ return make_pack_range(range, make_packer(detail::u16_packer()));
+}
+
+template<typename Range>
+std::pair<
+ pack_iterator<typename boost::range_iterator<const Range>::type, detail::u16_unpacker>,
+ pack_iterator<typename boost::range_iterator<const Range>::type, detail::u16_unpacker>
+> make_u16_to_u32_range(const Range& range)
+{
+ return make_pack_range(range, detail::u16_unpacker());
+}
+
+template<typename Range>
+std::pair<
+ pack_iterator<typename boost::range_iterator<const Range>::type, packer<detail::u8_packer> >,
+ pack_iterator<typename boost::range_iterator<const Range>::type, packer<detail::u8_packer> >
+> make_u32_to_u8_range(const Range& range)
+{
+ return make_pack_range(range, make_packer(detail::u8_packer()));
+}
+
+template<typename Range>
+std::pair<
+ pack_iterator<typename boost::range_iterator<const Range>::type, detail::u8_unpacker>,
+ pack_iterator<typename boost::range_iterator<const Range>::type, detail::u8_unpacker>
+> make_u8_to_u32_range(const Range& range)
+{
+ return make_pack_range(range, detail::u8_unpacker());
+}
+
+//TODO: output iterators
+
+} // namespace boost
+
+#endif

Added: sandbox/SOC/2009/unicode/libs/unicode/boost.png
==============================================================================
Binary file. No diff available.

Added: sandbox/SOC/2009/unicode/libs/unicode/doc/Jamfile.v2
==============================================================================
--- (empty file)
+++ sandbox/SOC/2009/unicode/libs/unicode/doc/Jamfile.v2 2009-05-08 21:19:18 EDT (Fri, 08 May 2009)
@@ -0,0 +1,21 @@
+#==============================================================================
+# Copyright (c) 2009 Mathias Gaunard
+#
+# 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)
+#==============================================================================
+
+import boostbook : boostbook ;
+using quickbook ;
+
+path-constant images : html ;
+
+boostbook quickbook
+ :
+ users_manual.qbk
+ :
+ <format>pdf:<xsl:param>img.src.path=$(images)/
+ ;
+
+

Added: sandbox/SOC/2009/unicode/libs/unicode/doc/html/boostbook.css
==============================================================================
--- (empty file)
+++ sandbox/SOC/2009/unicode/libs/unicode/doc/html/boostbook.css 2009-05-08 21:19:18 EDT (Fri, 08 May 2009)
@@ -0,0 +1,594 @@
+/*=============================================================================
+ Copyright (c) 2004 Joel de Guzman
+ http://spirit.sourceforge.net/
+
+ Distributed under the Boost Software License, Version 1.0. (See accompany-
+ ing file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+=============================================================================*/
+
+/*=============================================================================
+ Body defaults
+=============================================================================*/
+
+ body
+ {
+ margin: 1em;
+ font-family: sans-serif;
+ }
+
+/*=============================================================================
+ Paragraphs
+=============================================================================*/
+
+ p
+ {
+ text-align: left;
+ font-size: 10pt;
+ line-height: 1.15;
+ }
+
+/*=============================================================================
+ Program listings
+=============================================================================*/
+
+ /* Code on paragraphs */
+ p tt.computeroutput
+ {
+ font-size: 9pt;
+ }
+
+ pre.synopsis
+ {
+ font-size: 90%;
+ margin: 1pc 4% 0pc 4%;
+ padding: 0.5pc 0.5pc 0.5pc 0.5pc;
+ }
+
+ .programlisting,
+ .screen
+ {
+ font-size: 9pt;
+ display: block;
+ margin: 1pc 4% 0pc 4%;
+ padding: 0.5pc 0.5pc 0.5pc 0.5pc;
+ }
+
+ /* Program listings in tables don't get borders */
+ td .programlisting,
+ td .screen
+ {
+ margin: 0pc 0pc 0pc 0pc;
+ padding: 0pc 0pc 0pc 0pc;
+ }
+
+/*=============================================================================
+ Headings
+=============================================================================*/
+
+ h1, h2, h3, h4, h5, h6
+ {
+ text-align: left;
+ margin: 1em 0em 0.5em 0em;
+ font-weight: bold;
+ }
+
+ h1 { font: 140% }
+ h2 { font: bold 140% }
+ h3 { font: bold 130% }
+ h4 { font: bold 120% }
+ h5 { font: italic 110% }
+ h6 { font: italic 100% }
+
+ /* Top page titles */
+ title,
+ h1.title,
+ h2.title
+ h3.title,
+ h4.title,
+ h5.title,
+ h6.title,
+ .refentrytitle
+ {
+ font-weight: bold;
+ margin-bottom: 1pc;
+ }
+
+ h1.title { font-size: 140% }
+ h2.title { font-size: 140% }
+ h3.title { font-size: 130% }
+ h4.title { font-size: 120% }
+ h5.title { font-size: 110% }
+ h6.title { font-size: 100% }
+
+ .section h1
+ {
+ margin: 0em 0em 0.5em 0em;
+ font-size: 140%;
+ }
+
+ .section h2 { font-size: 140% }
+ .section h3 { font-size: 130% }
+ .section h4 { font-size: 120% }
+ .section h5 { font-size: 110% }
+ .section h6 { font-size: 100% }
+
+ /* Code on titles */
+ h1 tt.computeroutput { font-size: 140% }
+ h2 tt.computeroutput { font-size: 140% }
+ h3 tt.computeroutput { font-size: 130% }
+ h4 tt.computeroutput { font-size: 120% }
+ h5 tt.computeroutput { font-size: 110% }
+ h6 tt.computeroutput { font-size: 100% }
+
+/*=============================================================================
+ Author
+=============================================================================*/
+
+ h3.author
+ {
+ font-size: 100%
+ }
+
+/*=============================================================================
+ Lists
+=============================================================================*/
+
+ li
+ {
+ font-size: 10pt;
+ line-height: 1.3;
+ }
+
+ /* Unordered lists */
+ ul
+ {
+ text-align: left;
+ }
+
+ /* Ordered lists */
+ ol
+ {
+ text-align: left;
+ }
+
+/*=============================================================================
+ Links
+=============================================================================*/
+
+ a
+ {
+ text-decoration: none; /* no underline */
+ }
+
+ a:hover
+ {
+ text-decoration: underline;
+ }
+
+/*=============================================================================
+ Spirit style navigation
+=============================================================================*/
+
+ .spirit-nav
+ {
+ text-align: right;
+ }
+
+ .spirit-nav a
+ {
+ color: white;
+ padding-left: 0.5em;
+ }
+
+ .spirit-nav img
+ {
+ border-width: 0px;
+ }
+
+/*=============================================================================
+ Copyright footer
+=============================================================================*/
+ .copyright-footer
+ {
+ text-align: right;
+ font-size: 70%;
+ }
+
+ .copyright-footer p
+ {
+ text-align: right;
+ font-size: 80%;
+ }
+
+/*=============================================================================
+ Table of contents
+=============================================================================*/
+
+ .toc
+ {
+ margin: 1pc 4% 0pc 4%;
+ padding: 0.1pc 1pc 0.1pc 1pc;
+ font-size: 80%;
+ line-height: 1.15;
+ }
+
+ .boost-toc
+ {
+ float: right;
+ padding: 0.5pc;
+ }
+
+/*=============================================================================
+ Tables
+=============================================================================*/
+
+ .table-title,
+ div.table p.title
+ {
+ margin-left: 4%;
+ padding-right: 0.5em;
+ padding-left: 0.5em;
+ }
+
+ .informaltable table,
+ .table table
+ {
+ width: 92%;
+ margin-left: 4%;
+ margin-right: 4%;
+ }
+
+ div.informaltable table,
+ div.table table
+ {
+ padding: 4px;
+ }
+
+ /* Table Cells */
+ div.informaltable table tr td,
+ div.table table tr td
+ {
+ padding: 0.5em;
+ text-align: left;
+ font-size: 9pt;
+ }
+
+ div.informaltable table tr th,
+ div.table table tr th
+ {
+ padding: 0.5em 0.5em 0.5em 0.5em;
+ border: 1pt solid white;
+ font-size: 80%;
+ }
+
+ table.simplelist
+ {
+ width: auto !important;
+ margin: 0em !important;
+ padding: 0em !important;
+ border: none !important;
+ }
+ table.simplelist td
+ {
+ margin: 0em !important;
+ padding: 0em !important;
+ text-align: left !important;
+ font-size: 9pt !important;
+ border: none !important;
+ }
+
+/*=============================================================================
+ Blurbs
+=============================================================================*/
+
+ div.note,
+ div.tip,
+ div.important,
+ div.caution,
+ div.warning,
+ p.blurb
+ {
+ font-size: 9pt; /* A little bit smaller than the main text */
+ line-height: 1.2;
+ display: block;
+ margin: 1pc 4% 0pc 4%;
+ padding: 0.5pc 0.5pc 0.5pc 0.5pc;
+ }
+
+ p.blurb img
+ {
+ padding: 1pt;
+ }
+
+/*=============================================================================
+ Variable Lists
+=============================================================================*/
+
+ div.variablelist
+ {
+ margin: 1em 0;
+ }
+
+ /* Make the terms in definition lists bold */
+ div.variablelist dl dt,
+ span.term
+ {
+ font-weight: bold;
+ font-size: 10pt;
+ }
+
+ div.variablelist table tbody tr td
+ {
+ text-align: left;
+ vertical-align: top;
+ padding: 0em 2em 0em 0em;
+ font-size: 10pt;
+ margin: 0em 0em 0.5em 0em;
+ line-height: 1;
+ }
+
+ div.variablelist dl dt
+ {
+ margin-bottom: 0.2em;
+ }
+
+ div.variablelist dl dd
+ {
+ margin: 0em 0em 0.5em 2em;
+ font-size: 10pt;
+ }
+
+ div.variablelist table tbody tr td p,
+ div.variablelist dl dd p
+ {
+ margin: 0em 0em 0.5em 0em;
+ line-height: 1;
+ }
+
+/*=============================================================================
+ Misc
+=============================================================================*/
+
+ /* Title of books and articles in bibliographies */
+ span.title
+ {
+ font-style: italic;
+ }
+
+ span.underline
+ {
+ text-decoration: underline;
+ }
+
+ span.strikethrough
+ {
+ text-decoration: line-through;
+ }
+
+ /* Copyright, Legal Notice */
+ div div.legalnotice p
+ {
+ text-align: left
+ }
+
+/*=============================================================================
+ Colors
+=============================================================================*/
+
+ @media screen
+ {
+ body {
+ background-color: #FFFFFF;
+ color: #000000;
+ }
+
+ /* Links */
+ a
+ {
+ color: #005a9c;
+ }
+
+ a:visited
+ {
+ color: #9c5a9c;
+ }
+
+ h1 a, h2 a, h3 a, h4 a, h5 a, h6 a,
+ h1 a:hover, h2 a:hover, h3 a:hover, h4 a:hover, h5 a:hover, h6 a:hover,
+ h1 a:visited, h2 a:visited, h3 a:visited, h4 a:visited, h5 a:visited, h6 a:visited
+ {
+ text-decoration: none; /* no underline */
+ color: #000000;
+ }
+
+ /* Syntax Highlighting */
+ .keyword { color: #0000AA; }
+ .identifier { color: #000000; }
+ .special { color: #707070; }
+ .preprocessor { color: #402080; }
+ .char { color: teal; }
+ .comment { color: #800000; }
+ .string { color: teal; }
+ .number { color: teal; }
+ .white_bkd { background-color: #FFFFFF; }
+ .dk_grey_bkd { background-color: #999999; }
+
+ /* Copyright, Legal Notice */
+ .copyright
+ {
+ color: #666666;
+ font-size: small;
+ }
+
+ div div.legalnotice p
+ {
+ color: #666666;
+ }
+
+ /* Program listing */
+ pre.synopsis
+ {
+ border: 1px solid #DCDCDC;
+ }
+
+ .programlisting,
+ .screen
+ {
+ border: 1px solid #DCDCDC;
+ }
+
+ td .programlisting,
+ td .screen
+ {
+ border: 0px solid #DCDCDC;
+ }
+
+ /* Blurbs */
+ div.note,
+ div.tip,
+ div.important,
+ div.caution,
+ div.warning,
+ p.blurb
+ {
+ border: 1px solid #DCDCDC;
+ }
+
+ /* Table of contents */
+ .toc
+ {
+ border: 1px solid #DCDCDC;
+ }
+
+ /* Tables */
+ div.informaltable table tr td,
+ div.table table tr td
+ {
+ border: 1px solid #DCDCDC;
+ }
+
+ div.informaltable table tr th,
+ div.table table tr th
+ {
+ background-color: #F0F0F0;
+ border: 1px solid #DCDCDC;
+ }
+
+ .copyright-footer
+ {
+ color: #8F8F8F;
+ }
+
+ /* Misc */
+ span.highlight
+ {
+ color: #00A000;
+ }
+ }
+
+ @media print
+ {
+ /* Links */
+ a
+ {
+ color: black;
+ }
+
+ a:visited
+ {
+ color: black;
+ }
+
+ .spirit-nav
+ {
+ display: none;
+ }
+
+ /* Program listing */
+ pre.synopsis
+ {
+ border: 1px solid gray;
+ }
+
+ .programlisting,
+ .screen
+ {
+ border: 1px solid gray;
+ }
+
+ td .programlisting,
+ td .screen
+ {
+ border: 0px solid #DCDCDC;
+ }
+
+ /* Table of contents */
+ .toc
+ {
+ border: 1px solid gray;
+ }
+
+ .informaltable table,
+ .table table
+ {
+ border: 1px solid gray;
+ border-collapse: collapse;
+ }
+
+ /* Tables */
+ div.informaltable table tr td,
+ div.table table tr td
+ {
+ border: 1px solid gray;
+ }
+
+ div.informaltable table tr th,
+ div.table table tr th
+ {
+ border: 1px solid gray;
+ }
+
+ table.simplelist tr td
+ {
+ border: none !important;
+ }
+
+ /* Misc */
+ span.highlight
+ {
+ font-weight: bold;
+ }
+ }
+
+/*=============================================================================
+ Images
+=============================================================================*/
+
+ span.inlinemediaobject img
+ {
+ vertical-align: middle;
+ }
+
+/*==============================================================================
+ Super and Subscript: style so that line spacing isn't effected, see
+ http://www.adobe.com/cfusion/communityengine/index.cfm?event=showdetails&productId=1&postId=5341
+==============================================================================*/
+
+sup,
+sub {
+ height: 0;
+ line-height: 1;
+ vertical-align: baseline;
+ _vertical-align: bottom;
+ position: relative;
+
+}
+
+sup {
+ bottom: 1ex;
+}
+
+sub {
+ top: .5ex;
+}
+

Added: sandbox/SOC/2009/unicode/libs/unicode/doc/html/images/blank.png
==============================================================================
Binary file. No diff available.

Added: sandbox/SOC/2009/unicode/libs/unicode/doc/html/images/caution.png
==============================================================================
Binary file. No diff available.

Added: sandbox/SOC/2009/unicode/libs/unicode/doc/html/images/draft.png
==============================================================================
Binary file. No diff available.

Added: sandbox/SOC/2009/unicode/libs/unicode/doc/html/images/home.png
==============================================================================
Binary file. No diff available.

Added: sandbox/SOC/2009/unicode/libs/unicode/doc/html/images/important.png
==============================================================================
Binary file. No diff available.

Added: sandbox/SOC/2009/unicode/libs/unicode/doc/html/images/next.png
==============================================================================
Binary file. No diff available.

Added: sandbox/SOC/2009/unicode/libs/unicode/doc/html/images/next_disabled.png
==============================================================================
Binary file. No diff available.

Added: sandbox/SOC/2009/unicode/libs/unicode/doc/html/images/note.png
==============================================================================
Binary file. No diff available.

Added: sandbox/SOC/2009/unicode/libs/unicode/doc/html/images/prev.png
==============================================================================
Binary file. No diff available.

Added: sandbox/SOC/2009/unicode/libs/unicode/doc/html/images/prev_disabled.png
==============================================================================
Binary file. No diff available.

Added: sandbox/SOC/2009/unicode/libs/unicode/doc/html/images/tip.png
==============================================================================
Binary file. No diff available.

Added: sandbox/SOC/2009/unicode/libs/unicode/doc/html/images/toc-blank.png
==============================================================================
Binary file. No diff available.

Added: sandbox/SOC/2009/unicode/libs/unicode/doc/html/images/toc-minus.png
==============================================================================
Binary file. No diff available.

Added: sandbox/SOC/2009/unicode/libs/unicode/doc/html/images/toc-plus.png
==============================================================================
Binary file. No diff available.

Added: sandbox/SOC/2009/unicode/libs/unicode/doc/html/images/up.png
==============================================================================
Binary file. No diff available.

Added: sandbox/SOC/2009/unicode/libs/unicode/doc/html/images/up_disabled.png
==============================================================================
Binary file. No diff available.

Added: sandbox/SOC/2009/unicode/libs/unicode/doc/html/images/warning.png
==============================================================================
Binary file. No diff available.

Added: sandbox/SOC/2009/unicode/libs/unicode/doc/users_manual.qbk
==============================================================================
--- (empty file)
+++ sandbox/SOC/2009/unicode/libs/unicode/doc/users_manual.qbk 2009-05-08 21:19:18 EDT (Fri, 08 May 2009)
@@ -0,0 +1,77 @@
+[library Unicode
+ [quickbook 1.3]
+ [version 1.0]
+ [authors [Gaunard, Mathias]]
+ [copyright 2009 Mathias Gaunard]
+ [category string-text]
+ [purpose Internationalized text handling in C++ with Unicode]
+ [license
+ Distributed under 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])
+ ]
+]
+
+[/ Some links]
+
+[def __note__ [$images/note.png]]
+[def __alert__ [$images/alert.png]]
+[def __tip__ [$images/tip.png]]
+
+[def __unicode_std__ [@http://www.unicode.org/versions/latest/ Unicode Standard]]
+[def __boost_range__ [@http://boost.org/libs/range/index.html Boost.Range]]
+
+[section Preface]
+
+[:Some introductory material]
+
+
+[heading Description]
+
+Some more detailed material
+
+[heading How to use this manual]
+
+Some icons are used to mark certain topics indicative of their relevance. These
+icons precede some text to indicate:
+
+[table Icons
+ [[Icon] [Name] [Meaning]]
+ [[__note__] [Note] [Information provided is auxiliary but will
+ give the reader a deeper insight into a specific
+ topic. May be skipped.]]
+ [[__alert__] [Alert] [Information provided is of utmost importance.]]
+ [[__tip__] [Tip] [A potentially useful and helpful piece of
+ information.]]
+]
+
+[endsect]
+
+[section Introduction]
+
+Some detailed introduction
+
+[endsect]
+
+
+
+[section First module]
+
+A first module
+
+[heading Interesting point]
+
+Bla bla
+
+[section First submodule]
+
+bla bla bla
+
+[heading Another interesting point]
+
+See also [link unicode.first_module.interesting_point that point].
+
+[endsect]
+
+[endsect]
+

Added: sandbox/SOC/2009/unicode/libs/unicode/example/Jamfile.v2
==============================================================================
--- (empty file)
+++ sandbox/SOC/2009/unicode/libs/unicode/example/Jamfile.v2 2009-05-08 21:19:18 EDT (Fri, 08 May 2009)
@@ -0,0 +1,15 @@
+#==============================================================================
+# Copyright (c) 2009 Mathias Gaunard
+#
+# 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)
+#==============================================================================
+
+project
+ : requirements
+ <include>../../..
+ <library>../src//boost-unicode
+ ;
+
+exe test : test.cpp ;

Added: sandbox/SOC/2009/unicode/libs/unicode/example/test.cpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2009/unicode/libs/unicode/example/test.cpp 2009-05-08 21:19:18 EDT (Fri, 08 May 2009)
@@ -0,0 +1,40 @@
+#include <iostream>
+#include <boost/foreach.hpp>
+#include <boost/unicode/unicode_iterator.hpp>
+
+template<typename Range>
+std::pair<
+ boost::reverse_iterator<typename boost::range_iterator<Range>::type>,
+ boost::reverse_iterator<typename boost::range_iterator<Range>::type>
+> make_reverse_range(const Range& r)
+{
+ return std::make_pair(
+ boost::make_reverse_iterator(boost::end(r)),
+ boost::make_reverse_iterator(boost::begin(r))
+ );
+}
+
+int main()
+{
+ std::vector<boost::uint32_t> v;
+
+ /*v.push_back(122);
+ v.push_back(27700);
+ v.push_back(119070);
+ v.push_back(123);*/
+
+ v.push_back(1);
+ v.push_back(0xE9);
+ v.push_back(3);
+
+
+ /*v.push_back(0x7a);
+ v.push_back(0x6c34);
+ v.push_back(0xd834);
+ v.push_back(0xdd1e);
+ v.push_back(0x7b);*/
+
+
+ BOOST_FOREACH(uint32_t cp, boost::make_u8_to_u32_range(v))
+ std::cout << std::hex << cp << std::endl;
+}

Added: sandbox/SOC/2009/unicode/libs/unicode/src/Jamfile.v2
==============================================================================
--- (empty file)
+++ sandbox/SOC/2009/unicode/libs/unicode/src/Jamfile.v2 2009-05-08 21:19:18 EDT (Fri, 08 May 2009)
@@ -0,0 +1,14 @@
+#==============================================================================
+# Copyright (c) 2009 Mathias Gaunard
+#
+# 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)
+#==============================================================================
+
+project
+ : requirements
+ <include>../../..
+ ;
+
+lib boost-unicode : src.cpp ;

Added: sandbox/SOC/2009/unicode/libs/unicode/src/src.cpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2009/unicode/libs/unicode/src/src.cpp 2009-05-08 21:19:18 EDT (Fri, 08 May 2009)
@@ -0,0 +1 @@
+#include <boost/unicode/unicode_iterator.hpp>

Added: sandbox/SOC/2009/unicode/project-root.jam
==============================================================================
--- (empty file)
+++ sandbox/SOC/2009/unicode/project-root.jam 2009-05-08 21:19:18 EDT (Fri, 08 May 2009)
@@ -0,0 +1,10 @@
+#==============================================================================
+# Copyright (c) 2009 Mathias Gaunard
+#
+# 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)
+#==============================================================================
+
+build-project libs/unicode/doc ;
+build-project libs/unicode/example ;


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