#include <boost/locale/boundary.hpp>
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_iterator & | operator++ () |
break_iterator & | operator-- () |
break_iterator | operator++ (int unused) |
break_iterator | operator-- (int unused) |
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.
typedef std::iterator_traits<IteratorType>::value_type boost::locale::boundary::break_iterator< IteratorType >::char_type |
The character type of the text
typedef IteratorType boost::locale::boundary::break_iterator< IteratorType >::base_iterator |
Underlying iterator that is used to iterate original text.
typedef mapping<break_iterator<IteratorType> > boost::locale::boundary::break_iterator< IteratorType >::mapping_type |
The type of mapping that iterator can iterate over it
boost::locale::boundary::break_iterator< IteratorType >::break_iterator | ( | ) | [inline] |
Default constructor
boost::locale::boundary::break_iterator< IteratorType >::break_iterator | ( | break_iterator< IteratorType > const & | other | ) | [inline] |
Copy constructor
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.
break_iterator const& boost::locale::boundary::break_iterator< IteratorType >::operator= | ( | break_iterator< IteratorType > const & | other | ) | [inline] |
Assignment operator
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
bool boost::locale::boundary::break_iterator< IteratorType >::operator!= | ( | break_iterator< IteratorType > const & | other | ) | const [inline] |
Opposite of ===
unsigned boost::locale::boundary::break_iterator< IteratorType >::mark | ( | ) | const [inline] |
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:
p - should be in range of the original mapping.
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.
break_iterator& boost::locale::boundary::break_iterator< IteratorType >::operator++ | ( | ) | [inline] |
Increment operator
break_iterator& boost::locale::boundary::break_iterator< IteratorType >::operator-- | ( | ) | [inline] |
Decrement operator
break_iterator boost::locale::boundary::break_iterator< IteratorType >::operator++ | ( | int | unused | ) | [inline] |
Increment operator
break_iterator boost::locale::boundary::break_iterator< IteratorType >::operator-- | ( | int | unused | ) | [inline] |
Decrement operator