Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r64845 - in sandbox/SOC/2010/stringalgos: boost/algorithm/string boost/algorithm/string/finder boost/algorithm/string/finder/detail boost/algorithm/string/string_search libs/algorithm/string/benchmark libs/algorithm/string/doc
From: mstefanro_at_[hidden]
Date: 2010-08-16 10:42:28


Author: mstefanro
Date: 2010-08-16 10:42:24 EDT (Mon, 16 Aug 2010)
New Revision: 64845
URL: http://svn.boost.org/trac/boost/changeset/64845

Log:
[GSoC2010][StringAlgo] More doc, refactoring
Text files modified:
   sandbox/SOC/2010/stringalgos/boost/algorithm/string/benchmark_finder.hpp | 25 ++++++++++---------
   sandbox/SOC/2010/stringalgos/boost/algorithm/string/finder/detail/finder_typedefs.hpp | 12 +++++++--
   sandbox/SOC/2010/stringalgos/boost/algorithm/string/finder/detail/functor_finders.hpp | 2
   sandbox/SOC/2010/stringalgos/boost/algorithm/string/finder/detail/string_search_ranges.hpp | 2
   sandbox/SOC/2010/stringalgos/boost/algorithm/string/finder/finder.hpp | 51 +++++++++++++++++++++------------------
   sandbox/SOC/2010/stringalgos/boost/algorithm/string/finder/finder_generators.hpp | 30 ++++++++++++++---------
   sandbox/SOC/2010/stringalgos/boost/algorithm/string/finder/functor_finders.hpp | 14 ++++++++--
   sandbox/SOC/2010/stringalgos/boost/algorithm/string/finder/simplified_finder.hpp | 15 +++++++----
   sandbox/SOC/2010/stringalgos/boost/algorithm/string/finder_aliases.hpp | 2
   sandbox/SOC/2010/stringalgos/boost/algorithm/string/formatter.hpp | 2
   sandbox/SOC/2010/stringalgos/boost/algorithm/string/string_search/boyer_moore.hpp | 7 +++++
   sandbox/SOC/2010/stringalgos/boost/algorithm/string/string_search/knuth_morris_pratt.hpp | 4 +++
   sandbox/SOC/2010/stringalgos/boost/algorithm/string/string_search/naive_search.hpp | 5 +++
   sandbox/SOC/2010/stringalgos/boost/algorithm/string/string_search/rabin_karp.hpp | 13 ++++++++++
   sandbox/SOC/2010/stringalgos/boost/algorithm/string/string_search/suffix_array.hpp | 4 ++
   sandbox/SOC/2010/stringalgos/libs/algorithm/string/benchmark/string_search.cpp | 8 +++---
   sandbox/SOC/2010/stringalgos/libs/algorithm/string/doc/Jamfile.v2 | 37 ++++++++++++++++++++++++----
   sandbox/SOC/2010/stringalgos/libs/algorithm/string/doc/quickref.xml | 6 ++--
   sandbox/SOC/2010/stringalgos/libs/algorithm/string/doc/usage.xml | 2
   19 files changed, 163 insertions(+), 78 deletions(-)

Modified: sandbox/SOC/2010/stringalgos/boost/algorithm/string/benchmark_finder.hpp
==============================================================================
--- sandbox/SOC/2010/stringalgos/boost/algorithm/string/benchmark_finder.hpp (original)
+++ sandbox/SOC/2010/stringalgos/boost/algorithm/string/benchmark_finder.hpp 2010-08-16 10:42:24 EDT (Mon, 16 Aug 2010)
@@ -59,7 +59,7 @@
 
 
 /*! \file
-Defines a generic finder type with an iterface similar to that of \ref simplified_finder_t.
+Defines a generic finder type with an interface similar to that of \ref boost::algorithm::simplified_finder_t.
 This finder type is useful for comparing the performance of various string search algorithms.
 */
 
@@ -69,7 +69,7 @@
     /** Possesses a similar interface to \ref simplified_finder_t and allows to test
         the performance of various string search algorithms in order to allow easier
         choice of the right algorithm for a certain data set
- \tparam Range1T A range representing the type of the substring (the pattern)
+ \tparam Range1T A range representing the type of the substr (the pattern)
         \tparam Range2T A range representing the type of the string (the text)
         \tparam AlgorithmSequenceT A MPL sequence containing algorithm types that are to be benchmarked
         \tparam ComparatorT The comparator type passed to the algorithms
@@ -78,34 +78,33 @@
     class ComparatorT = boost::algorithm::is_equal>
     class benchmark_finder_t
     {
- typedef std::allocator<std::size_t> allocator_type_;
     public:
- BOOST_ALGORITHM_DETAIL_FINDER_TYPEDEFS(Range1T,Range2T);
- BOOST_ALGORITHM_DETAIL_FINDER_TYPEDEFS2(ComparatorT, allocator_type_);
+ BOOST_ALGORITHM_DETAIL_COMMON_FINDER_TYPEDEFS(Range1T,Range2T);
+ BOOST_ALGORITHM_DETAIL_COMMON_FINDER_TYPEDEFS2(ComparatorT, BOOST_ALGORITHM_DETAIL_DEFAULT_ALLOCATOR_TYPE);
     public:
 
         //! \copydoc boost::algorithm::simplified_finder_t::set_substring
         //! \see boost::algorithm::simplified_finder_t::set_substring
         void set_substring (substring_type
- const *const substring)
+ const *const substr)
         {
             boost::phoenix::function<finder_set_substring> f;
             boost::fusion::for_each(finders,
- f(boost::phoenix::arg_names::arg1, substring)
+ f(boost::phoenix::arg_names::arg1, substr)
             );
- trusted_finder.set_substring(substring);
+ trusted_finder.set_substring(substr);
         }
 
         //! \copydoc boost::algorithm::simplified_finder_t::set_string
         //! \see boost::algorithm::simplified_finder_t::set_string
- void set_string (string_type *const string)
+ void set_string (string_type *const str)
         {
             boost::phoenix::function<finder_set_string> f;
             boost::fusion::for_each(
                 finders,
- f(boost::phoenix::arg_names::arg1, string)
+ f(boost::phoenix::arg_names::arg1, str)
             );
- trusted_finder.set_string(string);
+ trusted_finder.set_string(str);
         }
 
         //! Clears all the benchmark data obtained from searching
@@ -144,6 +143,8 @@
             boost::fusion::for_each(finders, f(boost::phoenix::ref(output), boost::phoenix::arg_names::arg1) );
         }
     private:
+# ifndef BOOST_ALGORITHM_DOXYGEN
+
         typedef BOOST_STRING_TYPENAME boost::mpl::transform<AlgorithmSequenceT,
             std::pair<
                 BOOST_STRING_TYPENAME boost::algorithm::simplified_finder_t<substring_type,string_type,
@@ -279,7 +280,7 @@
                 os << "==========================================" << std::endl;
             }
         };
-
+# endif /* !defined(BOOST_ALGORITHM_DOXYGEN) */
     };
 } }
 

Modified: sandbox/SOC/2010/stringalgos/boost/algorithm/string/finder/detail/finder_typedefs.hpp
==============================================================================
--- sandbox/SOC/2010/stringalgos/boost/algorithm/string/finder/detail/finder_typedefs.hpp (original)
+++ sandbox/SOC/2010/stringalgos/boost/algorithm/string/finder/detail/finder_typedefs.hpp 2010-08-16 10:42:24 EDT (Mon, 16 Aug 2010)
@@ -18,6 +18,9 @@
 
 #include <boost/iterator/iterator_traits.hpp>
 
+#define BOOST_ALGORITHM_DETAIL_DEFAULT_ALLOCATOR_TYPE std::allocator<std::size_t>
+#define BOOST_ALGORITHM_DETAIL_DEFAULT_COMPARATOR_TYPE boost::algorithm::is_equal
+
 #define BOOST_ALGORITHM_DETAIL_COMMON_FINDER_TYPEDEFS(Range1T, Range2T) \
     typedef Range1T substring_type; /*!< The type of the substring */ \
     typedef Range2T string_type; /*!< The type of the string */ \
@@ -44,25 +47,28 @@
     typedef typename boost::iterator_range<substring_reverse_iterator_type> substring_reverse_range_type; \
     typedef typename boost::iterator_range<string_reverse_iterator_type> string_reverse_range_type
 
+/*
 #define BOOST_ALGORITHM_DETAIL_FINDER_TYPEDEFS(Range1T, Range2T) \
         BOOST_ALGORITHM_DETAIL_COMMON_FINDER_TYPEDEFS(Range1T, Range2T); \
     protected: \
         BOOST_ALGORITHM_DETAIL_UNCOMMON_FINDER_TYPEDEFS(Range1T, Range2T);
+*/
 
-
-#define BOOST_ALGORITHM_DETAIL_FINDER_TYPEDEFS2(ComparatorT, AllocatorT) \
+#define BOOST_ALGORITHM_DETAIL_COMMON_FINDER_TYPEDEFS2(ComparatorT, AllocatorT) \
     typedef ComparatorT comparator_type; /*!< The type of the comparator */ \
     typedef AllocatorT allocator_type /*!< The type of the allocator */
 
 
+/*
 namespace boost { namespace algorithm { namespace detail {
 
     template <class Range1T, class Range2T, class ComparatorT, class AllocatorT>
     struct finder_typedefs
     {
         BOOST_ALGORITHM_DETAIL_FINDER_TYPEDEFS(Range1T, Range2T);
- BOOST_ALGORITHM_DETAIL_FINDER_TYPEDEFS2(ComparatorT, AllocatorT);
+ BOOST_ALGORITHM_DETAIL_COMMON_FINDER_TYPEDEFS2(ComparatorT, AllocatorT);
     };
+*/
 
 } } }
 

Modified: sandbox/SOC/2010/stringalgos/boost/algorithm/string/finder/detail/functor_finders.hpp
==============================================================================
--- sandbox/SOC/2010/stringalgos/boost/algorithm/string/finder/detail/functor_finders.hpp (original)
+++ sandbox/SOC/2010/stringalgos/boost/algorithm/string/finder/detail/functor_finders.hpp 2010-08-16 10:42:24 EDT (Mon, 16 Aug 2010)
@@ -1,4 +1,4 @@
-// Boost string_algo library finder.hpp header file ---------------------------//
+// Boost string_algo library functor_finders.hpp header file ---------------------------//
 
 // Copyright Pavol Droba 2002-2006.
 //

Modified: sandbox/SOC/2010/stringalgos/boost/algorithm/string/finder/detail/string_search_ranges.hpp
==============================================================================
--- sandbox/SOC/2010/stringalgos/boost/algorithm/string/finder/detail/string_search_ranges.hpp (original)
+++ sandbox/SOC/2010/stringalgos/boost/algorithm/string/finder/detail/string_search_ranges.hpp 2010-08-16 10:42:24 EDT (Mon, 16 Aug 2010)
@@ -20,7 +20,7 @@
     class string_search_ranges
     {
     private:
- BOOST_ALGORITHM_DETAIL_FINDER_TYPEDEFS(Range1T, Range2T);
+ BOOST_ALGORITHM_DETAIL_COMMON_FINDER_TYPEDEFS(Range1T, Range2T);
     public:
         boost::iterator_range<substring_iterator_type> substr;
         boost::iterator_range<string_iterator_type> str;

Modified: sandbox/SOC/2010/stringalgos/boost/algorithm/string/finder/finder.hpp
==============================================================================
--- sandbox/SOC/2010/stringalgos/boost/algorithm/string/finder/finder.hpp (original)
+++ sandbox/SOC/2010/stringalgos/boost/algorithm/string/finder/finder.hpp 2010-08-16 10:42:24 EDT (Mon, 16 Aug 2010)
@@ -33,13 +33,13 @@
 #include <boost/algorithm/string/finder/detail/finder_typedefs.hpp>
 
 /*! \file
- Defines \ref finder_t, a finder type used for finding occurrences of a pattern in a string.
+ Defines \ref boost::algorithm::finder_t, a finder type used for finding occurrences of a pattern in a string.
     This finder allows passing both references and pointers to strings. The overloads taking references
     will make an internal copy of the passed string, whereas the pointer overloads will rely on the lifetime
     of the passed string being longer than that of the finder.
     If you are not planning on passing temporaries as strings and you can always guarantee on the lifetime of your
- strings, you might want to use \ref simplified_finder_t instead, which only has the pointer overloads (and
- cannot possess any internal copies). Likewise, if efficiency is very important, \ref simplified_finder_t is preferred.
+ strings, you might want to use \ref boost::algorithm::simplified_finder_t instead, which only has the pointer overloads (and
+ cannot possess any internal copies). Likewise, if efficiency is very important, \ref boost::algorithm::simplified_finder_t is preferred.
 */
 
 namespace boost { namespace algorithm {
@@ -52,6 +52,14 @@
     //! A generic finder type
     /*!
         Allows simple use of various string search algorithms.
+ This finder allows passing the pattern and the text both as pointers to ranges and as reference to ranges.
+ Whereas the overloads taking pointers are faster (because no strings are copied around),
+ you have to guarantee that the lifetime of your pointee is at least as long as the lifetime
+ of the finder. If you cannot guarantee on the lifetime, use a reference instead, which will
+ force a copy.
+ Note that this finder is the only one supporting reference overloads, all other support pointer-only versions
+ of the functions, which means this is the only finder which can make copies for you.
+
         \tparam Sequence1T A sequence representing the type of the substring (pattern)
         \tparam Sequence2T A sequence representing the type of the string (text)
         \tparam AlgorithmT The algorithm used to perform the searches
@@ -78,11 +86,13 @@
         // but std::string does not obey this concept, which means that even calling these template
         // parameters sequences is wrong.
     private:
+# ifndef BOOST_ALGORITHM_DOXYGEN
         BOOST_CONCEPT_ASSERT((boost::Container<Sequence1T>));
         BOOST_CONCEPT_ASSERT((boost::Container<Sequence2T>));
+# endif
     public:
         BOOST_ALGORITHM_DETAIL_COMMON_FINDER_TYPEDEFS(Sequence1T, Sequence2T);
- BOOST_ALGORITHM_DETAIL_FINDER_TYPEDEFS2(ComparatorT, AllocatorT);
+ BOOST_ALGORITHM_DETAIL_COMMON_FINDER_TYPEDEFS2(ComparatorT, AllocatorT);
     private:
         typedef BOOST_STRING_TYPENAME AlgorithmT::template algorithm<substring_char_type, string_char_type,
             comparator_type, allocator_type> algorithm_type;
@@ -95,18 +105,9 @@
                 of the pattern to be searched, or a pointer to a sequence of type \ref substring_type.
             \param string Either a range (or character array)
                 of the string to be searched, or a pointer to a sequence of type \ref string_type..
- \param comparator ComparatorT instance used to compare individual characters
+ \param comparator ComparatorT instance used by the string search algorithm to compare individual characters
             \param allocator AllocatorT instance used to allocate memory
                 for storing precomputed data if necessary
- \note Both the pattern and the text can be passed either as references of ranges,
- or as pointers to sequences. In the former case, the pattern and/or text is copied
- internally. In the latter class, the pointer is used by the finder and no copy is made.
- \warning Whereas the overloads taking pointers are faster (because no strings are copied around),
- you have to guarantee that the lifetime of your pointee is at least as long as the lifetime
- of the finder. If you cannot guarantee on the lifetime, use a reference instead, which will
- force a copy.
- \note If a rvalue reference is passed as the string or substring, and your compiler supports rvalue
- references, then a move is performed as opposed to a copy.
             */
         explicit finder_t (const Sequence1T *const substring = 0, Sequence2T *const string = 0,
             ComparatorT const &comparator = ComparatorT(), AllocatorT const &allocator = AllocatorT())
@@ -115,7 +116,7 @@
             substring_has_changed_(true), string_has_changed_(true)
         { }
 
- //! \overload
+ //! \copydoc finder_t::finder_t(const Sequence1T *const,Sequence2T *const)
         template <class Range2T>
         finder_t (const Sequence1T *const substring, Range2T &string,
             ComparatorT const &comparator = ComparatorT(), AllocatorT const &allocator = AllocatorT(),
@@ -127,7 +128,7 @@
             ranges_.substr = substring?*substring:substring_optional_copy_;
         }
 
- //! \overload
+ //! \copydoc finder_t::finder_t(const Sequence1T *const,Sequence2T *const)
         template <class Range1T>
         explicit finder_t (const Range1T &substring, Sequence2T *const string = 0,
             ComparatorT const &comparator = ComparatorT(), AllocatorT const &allocator = AllocatorT(),
@@ -140,7 +141,7 @@
             ranges_.str = string?boost::as_literal(*string):string_optional_copy_;
         }
 
- //! \overload
+ //! \copydoc finder_t::finder_t(const Sequence1T *const,Sequence2T *const)
         template <class Range1T, class Range2T>
         finder_t (const Range1T &substring, Range2T &string,
             ComparatorT comparator = ComparatorT(), AllocatorT allocator = AllocatorT(),
@@ -154,7 +155,7 @@
         }
 
 # ifdef BOOST_HAS_RVALUE_REFS
- //! \overload
+ //! \copydoc finder_t::finder_t(const Sequence1T *const,Sequence2T *const)
         template <class Range2T>
         explicit finder_t (
             Sequence1T const &&substring,
@@ -166,7 +167,7 @@
             substring_has_changed_(true), string_has_changed_(true)
         { }
 
- //! \overload
+ //! \copydoc finder_t::finder_t(const Sequence1T *const,Sequence2T *const)
         template <class Range2T>
         explicit finder_t (
             Sequence1T const &&substring,
@@ -179,7 +180,7 @@
             substring_has_changed_(true)
         { set_string(string); ranges_.substr = substring_optional_copy_; }
 
- //! \overload
+ //! \copydoc finder_t::finder_t(const Sequence1T *const,Sequence2T *const)
         finder_t (
             Sequence1T const &&substring,
             Sequence2T &&string,
@@ -190,7 +191,7 @@
             substring_has_changed_(true), string_has_changed_(true)
         { }
 
- //! \overload
+ //! \copydoc finder_t::finder_t(const Sequence1T *const,Sequence2T *const)
         finder_t (const Sequence1T *const substring,
             Sequence2T &&string,
             ComparatorT const &comparator = ComparatorT(), AllocatorT const &allocator = AllocatorT())
@@ -200,7 +201,7 @@
             substring_has_changed_(true), string_has_changed_(true)
         { }
             
- //! \overload
+ //! \copydoc finder_t::finder_t(const Sequence1T *const,Sequence2T *const)
         template <class Range1T>
         finder_t (const Range1T &substring,
             Sequence2T &&string,
@@ -531,6 +532,8 @@
         }
 
     private:
+# ifndef BOOST_ALGORITHM_DOXYGEN
+
         inline void apply_changes()
         {
             if (substring_has_changed_ || string_has_changed_) {
@@ -549,9 +552,11 @@
         algorithm_type algorithm_;
         substring_type substring_optional_copy_;
         string_type string_optional_copy_;
- // TODO should we use the allocator here too?
+ // TODO should we use the allocator here too, or should we warn the user to provide sequences using AllocatorT?
         boost::algorithm::detail::string_search_ranges<Sequence1T, Sequence2T> ranges_;
         bool substring_has_changed_, string_has_changed_;
+
+# endif
     };
 
 

Modified: sandbox/SOC/2010/stringalgos/boost/algorithm/string/finder/finder_generators.hpp
==============================================================================
--- sandbox/SOC/2010/stringalgos/boost/algorithm/string/finder/finder_generators.hpp (original)
+++ sandbox/SOC/2010/stringalgos/boost/algorithm/string/finder/finder_generators.hpp 2010-08-16 10:42:24 EDT (Mon, 16 Aug 2010)
@@ -18,7 +18,7 @@
 
 /*! \file
     Defines finder generators. They are mostly deprecated functions
- returning instances of finder types defined in \headername functor_finders.hpp.
+ returning instances of finder types defined in \headerfile boost/algorithm/string/finder/functor_finders.hpp .
     Finder generators are preserved for backward compatibility, but their use is discouraged.
 */
 
@@ -31,14 +31,14 @@
         The result is given as an \c iterator_range delimiting the match.
         \param Search The pattern to look for
         \param Comp A comparator used to match individual characters
- \tparam AlgorithmTagT A tag of the search algorithm that should be used for searching
+ \param Algorithm A tag of the search algorithm that should be used for searching
         \deprecated
     */
     template<typename RangeT,typename PredicateT, typename AlgorithmTagT>
     inline boost::algorithm::first_finder_t<RangeT, BOOST_STRING_TYPENAME AlgorithmTagT::type,PredicateT>
     first_finder(
         const RangeT& Search, PredicateT const& Comp,
- AlgorithmTagT const&)
+ AlgorithmTagT const &Algorithm)
     {
         return boost::algorithm::first_finder_t<RangeT, BOOST_STRING_TYPENAME AlgorithmTagT::type,PredicateT>(&Search, Comp);
     }
@@ -71,13 +71,13 @@
         The result is given as an \c iterator_range delimiting the match.
         \param Search The pattern to look for
         \param Comp A comparator used to match individual characters
- \tparam AlgorithmTagT A tag of the search algorithm that should be used for searching
+ \param Algorithm A tag of the search algorithm that should be used for searching
         \deprecated
     */
     template<typename RangeT, typename PredicateT, typename AlgorithmTagT>
     inline boost::algorithm::last_finder_t<RangeT, BOOST_STRING_TYPENAME AlgorithmTagT::type,PredicateT>
     last_finder( const RangeT& Search, PredicateT const &Comp,
- AlgorithmTagT const&)
+ AlgorithmTagT const &Algorithm)
     {
         return boost::algorithm::last_finder_t<RangeT, BOOST_STRING_TYPENAME AlgorithmTagT::type,PredicateT>(&Search, Comp);
     }
@@ -109,13 +109,15 @@
         The result is given as an \c iterator_range delimiting the match.
         \param Search The pattern to look for
         \param Comp A comparator used to match individual characters
- \tparam AlgorithmTagT A tag of the search algorithm that should be used for searching
+ \param Nth Specifies for which occurrence of the pattern should the finder look. For negative N, it starts
+ looking from the back to the front.
+ \param Algorithm A tag of the search algorithm that should be used for searching
         \deprecated
     */
     template<typename RangeT, typename PredicateT, typename AlgorithmTagT>
     inline boost::algorithm::nth_finder_t<RangeT,
         BOOST_STRING_TYPENAME AlgorithmTagT::type,PredicateT>
- nth_finder(const RangeT& Search, int Nth, PredicateT const &Comp, AlgorithmTagT const &)
+ nth_finder(const RangeT& Search, int Nth, PredicateT const &Comp, AlgorithmTagT const &Algorithm)
     {
         return boost::algorithm::nth_finder_t<RangeT,
             BOOST_STRING_TYPENAME AlgorithmTagT::type, PredicateT>(&Search, Nth, Comp);
@@ -209,9 +211,8 @@
         any operation. It simply returns the given range for
         any input.
 
- \param Begin Beginning of the range
- \param End End of the range
- \param Range The range.
+ \param Begin Beginning of the range to be returned by the finder
+ \param End End of the range to be returned by the finder
         \return An instance of the \c range_finger object
     */
     template< typename ForwardIteratorT >
@@ -224,8 +225,13 @@
     }
 
     //! "Range" finder
- /*!
- \overload
+ /*!
+ Construct the \c range_finder. The finder does not perform
+ any operation. It simply returns the given range for
+ any input.
+
+ \param Range The range to be returned by the finder
+ \return An instance of the \c range_finger object
     */
     template< typename ForwardIteratorT >
     inline detail::range_finderF<ForwardIteratorT>

Modified: sandbox/SOC/2010/stringalgos/boost/algorithm/string/finder/functor_finders.hpp
==============================================================================
--- sandbox/SOC/2010/stringalgos/boost/algorithm/string/finder/functor_finders.hpp (original)
+++ sandbox/SOC/2010/stringalgos/boost/algorithm/string/finder/functor_finders.hpp 2010-08-16 10:42:24 EDT (Mon, 16 Aug 2010)
@@ -1,4 +1,4 @@
-// Boost string_algo library generated_finders.hpp header file ---------------------------//
+// Boost string_algo library functor_finders.hpp header file ---------------------------//
 
 // Copyright Stefan Mihaila 2010.
 //
@@ -14,7 +14,7 @@
 #include <boost/algorithm/string/compare.hpp>
 #include <boost/algorithm/string/finder/detail/string_search_ranges.hpp>
 #include <boost/algorithm/string/finder/detail/finder_typedefs.hpp>
-#include <boost/algorithm/string/finder/detail/generated_finders.hpp>
+#include <boost/algorithm/string/finder/detail/functor_finders.hpp>
 #include <boost/algorithm/string/finder/default_search_algorithm.hpp>
 
 #include <boost/range/begin.hpp>
@@ -28,7 +28,8 @@
 #include <memory>
 
 /*! \file
- Defines a few useful finder types (\ref first_finder_t, \ref last_finder_t, \ref nth_finder_t).
+ Defines a few useful finder types (\ref boost::algorithm::first_finder_t, \ref boost::algorithm::last_finder_t,
+ \ref boost::algorithm::nth_finder_t).
     These finder objects are functors which get constructed with a pattern to search for, and can afterwards
     be called using a pair of iterators representing the text in which the search is to be performed.
 */
@@ -136,6 +137,8 @@
                 BOOST_STRING_TYPENAME boost::iterator_category<Iterator2T>::type());
         }
     private:
+# ifndef BOOST_ALGORITHM_DOXYGEN
+
         //implementation of last_finder_t for when bidirectional iterators are available
         template <class Iterator2T>
         BOOST_STRING_TYPENAME boost::iterator_range<Iterator2T>
@@ -213,6 +216,8 @@
         BOOST_STRING_TYPENAME boost::iterator_range<substring_iterator_type> substring_range_;
         algorithm_type algorithm_;
         bool first_call_bidi_, first_call_forw_;
+
+# endif /* !defined(BOOST_ALGORITHM_DOXYGEN) */
     };
    
     //! A generic "nth" finder type.
@@ -269,6 +274,7 @@
         */
         void set_n(int n) { n_ = n; }
     private:
+# ifndef BOOST_ALGORITHM_DOXYGEN
         //find nth, for n>=0
         template <class Iterator2T>
         BOOST_STRING_TYPENAME boost::iterator_range<Iterator2T>
@@ -351,6 +357,8 @@
         int n_;
         algorithm_type algorithm_;
         bool first_call_forw_, first_call_bidi_;
+
+# endif /* !defined(BOOST_ALGORITHM_DOXYGEN) */
     };
 } }
 

Modified: sandbox/SOC/2010/stringalgos/boost/algorithm/string/finder/simplified_finder.hpp
==============================================================================
--- sandbox/SOC/2010/stringalgos/boost/algorithm/string/finder/simplified_finder.hpp (original)
+++ sandbox/SOC/2010/stringalgos/boost/algorithm/string/finder/simplified_finder.hpp 2010-08-16 10:42:24 EDT (Mon, 16 Aug 2010)
@@ -26,9 +26,9 @@
 #include <memory>
 
 /*! \file
- Defines \ref simplified_finder_t, a finder type uesd for finding occurrences of a pattern in a string.
- This finder is a more limited version of \ref finder_t, because it only allows passing pointers to ranges,
- which means no internal copies of the strings are made (\see finder_t for details). While this offers additional
+ Defines \ref boost::algorithm::simplified_finder_t, a finder type uesd for finding occurrences of a pattern in a string.
+ This finder is a more limited version of \ref boost::algorithm::finder_t, because it only allows passing pointers to ranges,
+ which means no internal copies of the strings are made (see boost::algorithm::finder_t for details). While this offers additional
     efficiency, it requires the caller to guarantee that the lifetime of a passed string is at least as long
     as the lifetime of the finder.
 */
@@ -57,7 +57,7 @@
         // TODO Add concept assertions here.
     public:
         BOOST_ALGORITHM_DETAIL_COMMON_FINDER_TYPEDEFS(Range1T, Range2T);
- BOOST_ALGORITHM_DETAIL_FINDER_TYPEDEFS2(ComparatorT, AllocatorT);
+ BOOST_ALGORITHM_DETAIL_COMMON_FINDER_TYPEDEFS2(ComparatorT, AllocatorT);
     private:
         typedef BOOST_STRING_TYPENAME AlgorithmT::template algorithm<substring_char_type, string_char_type,
             comparator_type, allocator_type> algorithm_type;
@@ -125,8 +125,8 @@
 
         //! Change the pattern (substring) to be searched.
         /*!
- \param string_begin An iterator indicating the beginning of the pattern to be searched.
- \param string_end An iterator indicating the end of the pattern to be searched.
+ \param substring_begin An iterator indicating the beginning of the pattern to be searched.
+ \param substring_end An iterator indicating the end of the pattern to be searched.
         */
         void set_substring (substring_iterator_type const &substring_begin, substring_iterator_type const &substring_end)
         {
@@ -251,6 +251,8 @@
         std::string get_algorithm_name() const { return algorithm_.get_algorithm_name(); }
 
     private:
+# ifndef BOOST_ALGORITHM_DOXYGEN
+
         inline void apply_changes()
         {
             if (substring_has_changed_ || string_has_changed_) {
@@ -269,6 +271,7 @@
         boost::algorithm::detail::string_search_ranges<substring_type, string_type> ranges_;
         algorithm_type algorithm_;
         bool substring_has_changed_, string_has_changed_;
+# endif
     };
 
 } }

Modified: sandbox/SOC/2010/stringalgos/boost/algorithm/string/finder_aliases.hpp
==============================================================================
--- sandbox/SOC/2010/stringalgos/boost/algorithm/string/finder_aliases.hpp (original)
+++ sandbox/SOC/2010/stringalgos/boost/algorithm/string/finder_aliases.hpp 2010-08-16 10:42:24 EDT (Mon, 16 Aug 2010)
@@ -12,7 +12,7 @@
 #define BOOST_STRING_FINDER_ALIASES_HPP
 
 /*! \file
- Defines useful typedefs for a easier creation of \ref finder_t finders.
+ Defines useful typedefs for a easier creation of \ref boost::algorithm::finder_t finders.
 */
 
 #include <boost/algorithm/string/finder/finder.hpp>

Modified: sandbox/SOC/2010/stringalgos/boost/algorithm/string/formatter.hpp
==============================================================================
--- sandbox/SOC/2010/stringalgos/boost/algorithm/string/formatter.hpp (original)
+++ sandbox/SOC/2010/stringalgos/boost/algorithm/string/formatter.hpp 2010-08-16 10:42:24 EDT (Mon, 16 Aug 2010)
@@ -83,7 +83,7 @@
         template<typename RangeT>
         inline detail::empty_formatF<
             BOOST_STRING_TYPENAME range_value<RangeT>::type>
- empty_formatter(const RangeT&)
+ empty_formatter(const RangeT &Input)
         {
             return detail::empty_formatF<
                 BOOST_STRING_TYPENAME range_value<RangeT>::type>();

Modified: sandbox/SOC/2010/stringalgos/boost/algorithm/string/string_search/boyer_moore.hpp
==============================================================================
--- sandbox/SOC/2010/stringalgos/boost/algorithm/string/string_search/boyer_moore.hpp (original)
+++ sandbox/SOC/2010/stringalgos/boost/algorithm/string/string_search/boyer_moore.hpp 2010-08-16 10:42:24 EDT (Mon, 16 Aug 2010)
@@ -57,6 +57,8 @@
     struct boyer_moore
     {
 
+# ifndef BOOST_ALGORITHM_DOXYGEN
+
         template <class Range1CharT, class Range2CharT, class ComparatorT, class AllocatorT>
         class algorithm
         {
@@ -67,6 +69,8 @@
             typedef AllocatorT allocator_type;
         public:
             std::string get_algorithm_name () const { return "Boyer-Moore"; }
+
+
             algorithm (comparator_type const &comp, allocator_type const &alloc)
                 : comp_(comp), alloc_(alloc), table1(alloc_), table2(alloc_)
             {
@@ -92,6 +96,7 @@
             //No precomputation to be done on the string
             template <class T>
             inline void on_string_change(T const&) { }
+
         private:
             comparator_type comp_; allocator_type alloc_;
 
@@ -373,6 +378,8 @@
             }
 
         };
+
+# endif /* !defined(BOOST_ALGORITHM_DOXYGEN) */
     };
     //! Instances of this type can be passed to find functions to require them to
     //! use the Boyer-Moore algorithm.

Modified: sandbox/SOC/2010/stringalgos/boost/algorithm/string/string_search/knuth_morris_pratt.hpp
==============================================================================
--- sandbox/SOC/2010/stringalgos/boost/algorithm/string/string_search/knuth_morris_pratt.hpp (original)
+++ sandbox/SOC/2010/stringalgos/boost/algorithm/string/string_search/knuth_morris_pratt.hpp 2010-08-16 10:42:24 EDT (Mon, 16 Aug 2010)
@@ -33,6 +33,8 @@
     struct knuth_morris_pratt
     {
 
+# ifndef BOOST_ALGORITHM_DOXYGEN
+
         template <class Range1CharT, class Range2CharT, class ComparatorT, class AllocatorT>
         class algorithm
         {
@@ -67,6 +69,7 @@
             //No precomputation to be done on the string
             template <class T>
             inline void on_string_change(T const&) { }
+
         private:
 
             comparator_type comp_;
@@ -191,6 +194,7 @@
             }
 
         };
+# endif /* !defined(BOOST_ALGORITHM_DOXYGEN) */
     };
     //! Instances of this type can be passed to find functions to require them to
     //! use the Knuth-Morris-Pratt algorithm.

Modified: sandbox/SOC/2010/stringalgos/boost/algorithm/string/string_search/naive_search.hpp
==============================================================================
--- sandbox/SOC/2010/stringalgos/boost/algorithm/string/string_search/naive_search.hpp (original)
+++ sandbox/SOC/2010/stringalgos/boost/algorithm/string/string_search/naive_search.hpp 2010-08-16 10:42:24 EDT (Mon, 16 Aug 2010)
@@ -33,6 +33,8 @@
         struct naive_search
         {
 
+# ifndef BOOST_ALGORITHM_DOXYGEN
+
         template <class Range1CharT, class Range2CharT, class ComparatorT, class AllocatorT>
         class algorithm
                 {
@@ -43,6 +45,7 @@
             typedef AllocatorT allocator_type;
         public:
             std::string get_algorithm_name () const { return "Naive search"; }
+
             algorithm (comparator_type const &comp, allocator_type const &alloc)
                 : comp_(comp), alloc_(alloc) { }
 
@@ -88,7 +91,9 @@
         private:
             comparator_type comp_;
             allocator_type alloc_;
+
                 };
+# endif /* !defined(BOOST_ALGORITHM_DOXYGEN) */
 
         };
     //! Instances of this type can be passed to find functions to require them to

Modified: sandbox/SOC/2010/stringalgos/boost/algorithm/string/string_search/rabin_karp.hpp
==============================================================================
--- sandbox/SOC/2010/stringalgos/boost/algorithm/string/string_search/rabin_karp.hpp (original)
+++ sandbox/SOC/2010/stringalgos/boost/algorithm/string/string_search/rabin_karp.hpp 2010-08-16 10:42:24 EDT (Mon, 16 Aug 2010)
@@ -64,6 +64,7 @@
         class StringIteratorCategory = std::random_access_iterator_tag>
     struct rabin_karp_algorithm
     {
+# ifndef BOOST_ALGORITHM_DOXYGEN
 
         template <class Range1CharT, class Range2CharT, class ComparatorT, class AllocatorT>
         class algorithm;
@@ -81,6 +82,9 @@
         public:
             std::string get_algorithm_name () const
             { return "Rabin-Karp (" + boost::lexical_cast<std::string>(sizeof(HashType)) + ")"; }
+
+
+
             algorithm (comparator_type const &comp, allocator_type const &alloc)
                 : comp_(comp), alloc_(alloc)
             {
@@ -110,15 +114,24 @@
             }
             comparator_type comp_; allocator_type alloc_;
         };
+# endif /* !defined(BOOST_ALGORITHM_DOXYGEN) */
     };
 
 
     //todo try to find better pairs for better efficiency?
     //! An implementation of a 32bit version of Rabin-Karp
+# ifndef BOOST_ALGORITHM_DOXYGEN
     typedef rabin_karp_algorithm<boost::uint_fast32_t,257,64433,277,57923> rabin_karp32;
+# else
+ typedef rabin_karp_algorithm<boost::uint_fast32_t,unspecified,unspecified,unspecified,unspecified> rabin_karp32;
+# endif
     //1/150167080229379589 odds of collision. useful with wchar_t
     //! An implementation of a 64bit version of Rabin-Karp
+# ifndef BOOST_ALGORITHM_DOXYGEN
     typedef rabin_karp_algorithm<boost::uint64_t,337515847,373587883,255150899,401959183> rabin_karp64;
+# else
+ typedef rabin_karp_algorithm<boost::uint64_t,unspecified,unspecified,unspecified,unspecified> rabin_karp64;
+# endif
     //! Instances of this type can be passed to find functions to require them to
     //! use the predefined 32bit Rabin-Karp algorithm.
     struct rabin_karp32_tag { typedef boost::algorithm::rabin_karp32 type; };

Modified: sandbox/SOC/2010/stringalgos/boost/algorithm/string/string_search/suffix_array.hpp
==============================================================================
--- sandbox/SOC/2010/stringalgos/boost/algorithm/string/string_search/suffix_array.hpp (original)
+++ sandbox/SOC/2010/stringalgos/boost/algorithm/string/string_search/suffix_array.hpp 2010-08-16 10:42:24 EDT (Mon, 16 Aug 2010)
@@ -37,6 +37,7 @@
     struct suffix_array_search
     {
 
+# ifndef BOOST_ALGORITHM_DOXYGEN
 
         template <class Range1CharT, class Range2CharT, class ComparatorT, class AllocatorT>
         class algorithm;
@@ -51,6 +52,7 @@
         public:
             std::string get_algorithm_name () const { return "Suffix array"; }
 
+
             algorithm (comparator_type const &comp, allocator_type const &alloc)
                 : comp_(comp), alloc_(alloc), found_matches_(false), pos_(alloc_), matches_(alloc_) { }
             
@@ -245,8 +247,8 @@
             std::vector<std::size_t, BOOST_STRING_TYPENAME allocator_type::template rebind<std::size_t>::other> pos_;
             std::vector<std::size_t, BOOST_STRING_TYPENAME allocator_type::template rebind<std::size_t>::other> matches_;
 
-
         };
+# endif /* !defined(BOOST_ALGORITHM_DOXYGEN) */
     };
     //! Instances of this type can be passed to find functions to require them to
     //! use the Suffix Array Search algorithm.

Modified: sandbox/SOC/2010/stringalgos/libs/algorithm/string/benchmark/string_search.cpp
==============================================================================
--- sandbox/SOC/2010/stringalgos/libs/algorithm/string/benchmark/string_search.cpp (original)
+++ sandbox/SOC/2010/stringalgos/libs/algorithm/string/benchmark/string_search.cpp 2010-08-16 10:42:24 EDT (Mon, 16 Aug 2010)
@@ -300,7 +300,7 @@
 
     boost::benchmark_finder_t<std::string, std::string,
         boost::mpl::vector<
- //boost::naive_search,
+ boost::naive_search,
             boost::knuth_morris_pratt//,
             //boost::boyer_moore,
             //boost::suffix_array_search,
@@ -321,8 +321,8 @@
     std::string const &benchmark_path = "E:/gsoc-boost/benchmarks";
 
     std::vector<std::string> benchmark_files = list_of
- /*("dblp.xml.200MB")*/ ("dna.200MB") /*("english.200MB") ("pitches.50MB")
- ("proteins.200MB") ("sources.200MB") ("random1.50MB") ("binary.50MB")*/;
+ ("dblp.xml.200MB") ("dna.200MB") ("english.200MB") ("pitches.50MB")
+ ("proteins.200MB") ("sources.200MB") ("random1.50MB") ("binary.50MB");
     boost::for_each(benchmark_files, arg1 = benchmark_path + "/" + arg1);
 
 
@@ -337,7 +337,7 @@
     bool substr_change = false;
     try {
         //Category 1
- for (unsigned int test = 4; test <= 4; ++test)
+ for (unsigned int test = 1; test <= 4; ++test)
         {
 
             BOOST_FOREACH(std::string fn, benchmark_files)

Modified: sandbox/SOC/2010/stringalgos/libs/algorithm/string/doc/Jamfile.v2
==============================================================================
--- sandbox/SOC/2010/stringalgos/libs/algorithm/string/doc/Jamfile.v2 (original)
+++ sandbox/SOC/2010/stringalgos/libs/algorithm/string/doc/Jamfile.v2 2010-08-16 10:42:24 EDT (Mon, 16 Aug 2010)
@@ -63,9 +63,34 @@
     <doxygen:param>MACRO_EXPANSION=YES
     <doxygen:param>EXPAND_ONLY_PREDEF=YES
     <doxygen:param>SEARCH_INCLUDES=YES
- <doxygen:param>PREDEFINED="BOOST_STRING_TYPENAME=typename; BOOST_STATIC_CONSTANT(type,var)=static const type var; BOOST_HAS_RVALUE_REFS;"
- ;
-
-
-
-
+ <doxygen:param>"PREDEFINED= \\
+ \"BOOST_ALGORITHM_DOXYGEN\" \\
+ \"BOOST_STRING_TYPENAME=typename\" \\
+ \"BOOST_STATIC_CONSTANT(type,var)=static const type var\" \\
+ \"BOOST_HAS_RVALUE_REFS\" \\
+ \"BOOST_ALGORITHM_DETAIL_DEFAULT_ALLOCATOR_TYPE=std::allocator<std::size_t>\" \\
+ \"BOOST_ALGORITHM_DETAIL_DEFAULT_COMPARATOR_TYPE=boost::algorithm::is_equal\" \\
+ \"BOOST_ALGORITHM_DETAIL_COMMON_FINDER_TYPEDEFS(Range1T,Range2T)= \\
+ typedef Range1T substring_type; /*!< The type of the substring */ \\
+ typedef Range2T string_type; /*!< The type of the string */ \\
+ typedef typename boost::range_const_iterator<substring_type>::type \\
+ substring_iterator_type; /*!< The type of the substring's iterator */ \\
+ typedef typename boost::range_iterator<string_type>::type \\
+ string_iterator_type; /*!< The type of the string's iterator */ \\
+ typedef typename boost::iterator_value<substring_iterator_type>::type \\
+ substring_char_type; /*!< The character type of the substring */ \\
+ typedef typename boost::iterator_value<string_iterator_type>::type \\
+ string_char_type; /*!< The character type of the string */ \\
+ typedef typename boost::iterator_range<substring_iterator_type> \\
+ substring_range_type; /*!< The range type of the substring (pattern) */ \\
+ typedef typename boost::iterator_range<string_iterator_type> \\
+ string_range_type; /*!< The range type of the text */ \\
+ typedef typename boost::iterator_difference<string_iterator_type>::type \\
+ string_difference_type /*! A type capable of holding the difference between two iterators of the text */ \\
+ \" \\
+ \"BOOST_ALGORITHM_DETAIL_COMMON_FINDER_TYPEDEFS2(ComparatorT, AllocatorT)= \\
+ typedef ComparatorT comparator_type; /*!< The type of the comparator */ \\
+ typedef AllocatorT allocator_type /*! The type of the allocator */ \\
+ \"
+ "
+ ;
\ No newline at end of file

Modified: sandbox/SOC/2010/stringalgos/libs/algorithm/string/doc/quickref.xml
==============================================================================
--- sandbox/SOC/2010/stringalgos/libs/algorithm/string/doc/quickref.xml (original)
+++ sandbox/SOC/2010/stringalgos/libs/algorithm/string/doc/quickref.xml 2010-08-16 10:42:24 EDT (Mon, 16 Aug 2010)
@@ -541,21 +541,21 @@
               <classname>first_finder_t</classname>
             </entry>
             <entry>Functor finder that can be passed to find/replace/split algorithms.
-Works as a function object returning the first occurrence of a pattern in a string.</entry>
+Works as a function object returning the <emphasis>first</emphasis> occurrence of a pattern in a string.</entry>
           </row>
           <row>
             <entry>
               <classname>nth_finder_t</classname>
             </entry>
             <entry>Functor finder that can be passed to find/replace/split algorithms.
-Works as a function object returning the N-th occurrence of a pattern in a string.</entry>
+Works as a function object returning the <emphasis>N-th</emphasis> occurrence of a pattern in a string.</entry>
           </row>
           <row>
             <entry>
               <classname>last_finder_t</classname>
             </entry>
             <entry>Functor finder that can be passed to find/replace/split algorithms.
-Works as a function object returning the last occurrence of a pattern in a string.</entry>
+Works as a function object returning the <emphasis>last</emphasis> occurrence of a pattern in a string.</entry>
           </row>
         </tbody>
       </tgroup>

Modified: sandbox/SOC/2010/stringalgos/libs/algorithm/string/doc/usage.xml
==============================================================================
--- sandbox/SOC/2010/stringalgos/libs/algorithm/string/doc/usage.xml (original)
+++ sandbox/SOC/2010/stringalgos/libs/algorithm/string/doc/usage.xml 2010-08-16 10:42:24 EDT (Mon, 16 Aug 2010)
@@ -351,7 +351,7 @@
     <title>Finders</title>
     <para>Finders offer a greater degree of control over what string search algorithms you would like to use for finding. Some of them may also be used as parameters to find/replace/split functions. </para>
     <para>They are especially useful if multiple searches are to be performed and the string or the substring do not change every iteration (because most string search algorithms precompute information on either the sought string or the text, meaning subsequent searches can be faster).</para>
- <para>There currently are 6 supported finder types: <classname alt="boost::algorithm::finder_t">finder_t</classname>, <classname alt="boost::algorithm::simplified_finder_t">simplified_finder_t</classname><classname alt="boost::algorithm::benchmark_finder_t">benchmark_finder_t</classname>, <classname alt="boost::algorithm::first_finder_t">first_finder_t</classname>, <classname alt="boost::algorithm::nth_finder_t">nth_finder_t</classname> and <classname alt="boost::algorithm::last_finder_t">last_finder_t</classname>.<programlisting>std::string random_saying =
+ <para>There currently are 6 supported finder types: <classname alt="boost::algorithm::finder_t">finder_t</classname>, <classname alt="boost::algorithm::simplified_finder_t">simplified_finder_t</classname>, <classname alt="boost::algorithm::benchmark_finder_t">benchmark_finder_t</classname>, <classname alt="boost::algorithm::first_finder_t">first_finder_t</classname>, <classname alt="boost::algorithm::nth_finder_t">nth_finder_t</classname> and <classname alt="boost::algorithm::last_finder_t">last_finder_t</classname>.<programlisting>std::string random_saying =
     "Speak when you are angry and you will make the best speech you'll ever regret.";
 
 //Create a finder_t object that will search using the Knuth-Morris-Pratt algorithm.


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