boost::locale::boundary::break_iterator< IteratorType > Class Template Reference
[Boundary Analysis]

break_iterator is bidirectional iterator that returns text boundary positions More...

#include <boost/locale/boundary.hpp>

List of all members.

Public Types

typedef std::iterator_traits
< IteratorType >::value_type 
char_type
typedef IteratorType base_iterator
typedef mapping
< break_iterator< IteratorType > > 
mapping_type

Public Member Functions

 break_iterator ()
 break_iterator (break_iterator const &other)
break_iterator const & operator= (break_iterator const &other)
 break_iterator (mapping_type const &map, bool begin, unsigned mask)
bool operator== (break_iterator const &other) const
bool operator!= (break_iterator const &other) const
unsigned mark () const
break_iterator const & operator= (base_iterator p)
base_iterator operator* () const
break_iteratoroperator++ ()
break_iteratoroperator-- ()
break_iterator operator++ (int unused)
break_iterator operator-- (int unused)


Detailed Description

template<typename IteratorType>
class boost::locale::boundary::break_iterator< IteratorType >

break_iterator is bidirectional iterator that returns text boundary positions

It returns rather iterators to break position then text chunks themselves. It stops only on boundaries that their marks fit the required mask. Also beginning of text and end of text are valid boundaries regardless their marks.

Please note for text in range [text_begin,text_end) and break_iterator it over it in range [begin,end): if *it==text_end then it!=end. And if it==end then *it is invalid. Thus for example for work iterator over text "hello", break iterator returns at beginning text_begin ("|hello"), then text_end ("hello|") and then it points to end.


Member Typedef Documentation

template<typename IteratorType>
typedef std::iterator_traits<IteratorType>::value_type boost::locale::boundary::break_iterator< IteratorType >::char_type

The character type of the text

template<typename IteratorType>
typedef IteratorType boost::locale::boundary::break_iterator< IteratorType >::base_iterator

Underlying iterator that is used to iterate original text.

template<typename IteratorType>
typedef mapping<break_iterator<IteratorType> > boost::locale::boundary::break_iterator< IteratorType >::mapping_type

The type of mapping that iterator can iterate over it


Constructor & Destructor Documentation

template<typename IteratorType>
boost::locale::boundary::break_iterator< IteratorType >::break_iterator (  )  [inline]

Default constructor

template<typename IteratorType>
boost::locale::boundary::break_iterator< IteratorType >::break_iterator ( break_iterator< IteratorType > const &  other  )  [inline]

Copy constructor

template<typename IteratorType>
boost::locale::boundary::break_iterator< IteratorType >::break_iterator ( mapping_type const &  map,
bool  begin,
unsigned  mask 
) [inline]

Create break iterator for mapping map with location at begin or end according to value of flag begin, and a mask mask

It is strongly recommended to use map.begin(), map.end() instead.


Member Function Documentation

template<typename IteratorType>
break_iterator const& boost::locale::boundary::break_iterator< IteratorType >::operator= ( break_iterator< IteratorType > const &  other  )  [inline]

Assignment operator

template<typename IteratorType>
bool boost::locale::boundary::break_iterator< IteratorType >::operator== ( break_iterator< IteratorType > const &  other  )  const [inline]

Compare two iterators. They equal if they point to same map, have same position and same mask

template<typename IteratorType>
bool boost::locale::boundary::break_iterator< IteratorType >::operator!= ( break_iterator< IteratorType > const &  other  )  const [inline]

Opposite of ===

template<typename IteratorType>
unsigned boost::locale::boundary::break_iterator< IteratorType >::mark (  )  const [inline]

Return the mark that token iterator points at. See description of mapping class and various boundary flags

template<typename IteratorType>
break_iterator const& boost::locale::boundary::break_iterator< IteratorType >::operator= ( base_iterator  p  )  [inline]

set position of the break_iterator to the location of underlying iterator.

This operator sets the break_iterator to position of the iterator p or to the first valid following position For example:

For word boundary:

  • "|to be or ", would point to "|to be or "
  • "t|o be or ", would point to "to| be or "

p - should be in range of the original mapping.

template<typename IteratorType>
base_iterator boost::locale::boundary::break_iterator< IteratorType >::operator* (  )  const [inline]

Return the underlying iterator that break_iterator points it. Iterator must not point to the end of the range, otherwise throws std::out_of_range exception

Note, returned value is not lvalue, you can't use this iterator to change underlying iterators.

template<typename IteratorType>
break_iterator& boost::locale::boundary::break_iterator< IteratorType >::operator++ (  )  [inline]

Increment operator

template<typename IteratorType>
break_iterator& boost::locale::boundary::break_iterator< IteratorType >::operator-- (  )  [inline]

Decrement operator

template<typename IteratorType>
break_iterator boost::locale::boundary::break_iterator< IteratorType >::operator++ ( int  unused  )  [inline]

Increment operator

template<typename IteratorType>
break_iterator boost::locale::boundary::break_iterator< IteratorType >::operator-- ( int  unused  )  [inline]

Decrement operator


The documentation for this class was generated from the following file:

Generated on Thu Mar 18 23:02:03 2010 for Boost.Locale by doxygen 1.5.6