diff --git a/string/doc/Jamfile.v2 b/string/doc/Jamfile.v2 index 5e99ba7..2c2c96e 100644 --- a/string/doc/Jamfile.v2 +++ b/string/doc/Jamfile.v2 @@ -21,7 +21,6 @@ doxygen autodoc [ glob ../../../../boost/algorithm/string/iterator_range.hpp ] [ glob ../../../../boost/algorithm/string/sequence_traits.hpp ] [ glob ../../../../boost/algorithm/string/std_containers_traits.hpp ] - [ glob ../../../../boost/algorithm/string/collection_traits.hpp ] [ glob ../../../../boost/algorithm/string/concept.hpp ] [ glob ../../../../boost/algorithm/string/compare.hpp ] [ glob ../../../../boost/algorithm/string/constants.hpp ] diff --git a/string/doc/design.xml b/string/doc/design.xml index 20598b5..db5129c 100644 --- a/string/doc/design.xml +++ b/string/doc/design.xml @@ -18,15 +18,13 @@ Definition: A string is a - collection of characters accessible in sequential + range of characters accessible in sequential ordered fashion. Character is any value type with "cheap" copying and assignment. First requirement of string-type is that it must accessible using - collection traits. This facility allows to access + Boost.Range. This facility allows to access the elements inside the string in a uniform iterator-based fashion. - This requirement is actually less stringent than that of collection concept. It implements - an external collection interface. This is sufficient for our library @@ -47,161 +45,6 @@ - -
- <code>iterator_range</code> class - - - An iterator_range is an encapsulation of a pair of iterators that - delimit a sequence (or, a range). This concept is widely used by - sequence manipulating algorithms. Although being so useful, there no direct support - for it in the standard library (The closest thing is that some algorithms return a pair of iterators). - Instead all STL algorithms have two distinct parameters for beginning and end of a range. This design - is natural for implementation of generic algorithms, but it forbids to work with a range as a single value. - - - It is possible to encapsulate a range in std::pair<>, but - std::pair<> is an overly generic encapsulation, so it is not best match for a range. - For instance, it does not enforce that begin and end iterators be of the same type. - - - Naturally the range concept is heavily used also in this library. During the development of - the library, it was discovered, that there is a need for a reasonable encapsulation for it, since - core part of the library deals with substring searching algorithms and any such algorithm - returns a range delimiting the result of the search. std::pair<> was deemed as - unsuitable. Therefore the iterator_range was defined. - - - The intention of the iterator_range class is to manage a range as a single value and provide - a basic interface for common operations. Its interface is similar to that of a collection. - In addition to begin() - and end() accessors, it has member functions for checking whether the range is empty, - or to determine the size of the range. It also has a set of member typedefs that extract - type information from the encapsulated iterators. As such, the interface is compatible with - the collection traits requirements so - it is possible to use this class as a parameter to many algorithms in this library. - - - iterator_range will be moved to Boost.Range library in the future - releases. The internal version will be deprecated then. - -
- -
- Collection Traits - - - Collection traits provide uniform access to different types of - collections . - This functionality allows to write generic algorithms which work with several - different kinds of collections. For this library it means, that, for instance, - many algorithms work with std::string as well as with char[]. - This facility implements the - external collection - concept. - - - The following collection types are supported: - - - Standard containers - - - Built-in arrays (like int[]) - - - Null terminated strings (this includes char[],wchar_t[],char*, and wchar_t*) - - - std::pair<iterator,iterator> - - - - - Collection traits support a subset of the container concept (Std §23.1). This subset - can be described as an input container concept, e.g. a container with immutable content. - Its definition can be found in the header boost/algorithm/string/collection_traits.hpp. - - - In the table C denotes a container and c is an object of C. - - - Collection Traits - - - - Name - Standard collection equivalent - Description - Maeterlinck - - - - value_type_of<C>::type - C::value_type - Type of contained values - - - difference_type_of<C>::type - C::difference_type - difference type of the collection - - - iterator_of<C>::type - C::iterator - iterator type of the collection - - - const_iterator_of<C>::type - C::const_iterator - const_iterator type of the collection - - - result_iterator_of<C>::type - - - result_iterator type of the collection. This type maps to C::iterator - for mutable collection and C::const_iterator for const collection. - - - - begin(c) - c.begin() - - Gets the iterator pointing to the start of the collection. - - - - end(c) - c.end() - - Gets the iterator pointing to the end of the collection. - - - - size(c) - c.size() - - Gets the size of the collection. - - - - empty(c) - c.empty() - - Checks if the collection is empty. - - - - -
- - - The collection traits are only a temporary part of this library. They will be replaced in the future - releases by Boost.Range library. Use of the internal implementation will be deprecated then. - - -
Sequence Traits diff --git a/string/doc/release_notes.xml b/string/doc/release_notes.xml new file mode 100644 index 0000000..e9007c8 --- /dev/null +++ b/string/doc/release_notes.xml @@ -0,0 +1,17 @@ + + +
+ Release Notes + + + + 1.32 + Initial release in Boost + + + 1.33 + Internal version of collection traits removed, library adapted to Boost.Range + + +
diff --git a/string/doc/string_algo.xml b/string/doc/string_algo.xml index a046c1e..c31999a 100644 --- a/string/doc/string_algo.xml +++ b/string/doc/string_algo.xml @@ -33,6 +33,7 @@ Boost String Algorithms Library + diff --git a/string/doc/usage.xml b/string/doc/usage.xml index 3317997..7c8d6c2 100644 --- a/string/doc/usage.xml +++ b/string/doc/usage.xml @@ -46,10 +46,10 @@ to_lower(str1), than to_lower(str1.begin(), str1.end()). - The magic of collection_traits + The magic of Boost.Range provides a uniform way of handling different string types. If there is a need to pass a pair of iterators, - iterator_range + boost::iterator_range can be used to package iterators into a structure with a compatible interface. @@ -200,16 +200,16 @@ We have used find_last() to search the text for "ll". - The result is given in the iterator_range. + The result is given in the boost::iterator_range. This range delimits the part of the input which satisfies the find criteria. In our example it is the last occurrence of "ll". As we can see, input of the find_last() algorithm can be also char[] because this type is supported by - collection_traits. + Boost.Range. The following lines transform the result. Notice that - iterator_range has familiar + boost::iterator_range has familiar begin() and end() methods, so it can be used like any other STL container. Also it is convertible to bool therefore it is easy to use find algorithms for a simple containment checking. @@ -256,7 +256,7 @@ the find iterator allows us to iterate over the substrings matching the specified criteria. This facility is using the Finder to incrementally search the string. - Dereferencing a find iterator yields an iterator_range + Dereferencing a find iterator yields an boost::iterator_range object, that delimits the current match. @@ -274,7 +274,7 @@ It!=string_find_iterator(); ++It) { - cout << copy_iterator_range<std::string>(*It) << endl; + cout << copy_range<std::string>(*It) << endl; } // Output will be: @@ -288,7 +288,7 @@ It!=string_find_iterator(); ++It) { - cout << copy_iterator_range<std::string>(*It) << endl; + cout << copy_range<std::string>(*It) << endl; } // Output will be: