Boost.Locale
boost::locale::boundary Namespace Reference

This namespae contains all operations required for boundary analysis of text. More...

Classes

class  boundary_point
 This class represents a boundary point in the text. More...
 
struct  break_info
 This structure is used for representing boundary point that follows the offset. More...
 
class  boundary_indexing
 This facet generates an index for boundary analysis for a given text. More...
 
class  segment_index
 This class holds an index of segments in the text range and allows to iterate over them. More...
 
class  boundary_point_index
 This class holds an index of boundary points and allows iterating over them. More...
 
class  segment
 a segment object that represents a pair of two iterators that define the range where this segment exits and a rule that defines it. More...
 

Typedefs

typedef boundary_point
< std::string::const_iterator > 
sboundary_point
 convenience typedef
 
typedef boundary_point
< std::wstring::const_iterator > 
wsboundary_point
 convenience typedef
 
typedef boundary_point
< std::u16string::const_iterator > 
u16sboundary_point
 convenience typedef
 
typedef boundary_point
< std::u32string::const_iterator > 
u32sboundary_point
 convenience typedef
 
typedef boundary_point< char
const * > 
cboundary_point
 convenience typedef
 
typedef boundary_point
< wchar_t const * > 
wcboundary_point
 convenience typedef
 
typedef boundary_point
< char16_t const * > 
u16cboundary_point
 convenience typedef
 
typedef boundary_point
< char32_t const * > 
u32cboundary_point
 convenience typedef
 
typedef std::vector< break_infoindex_type
 
typedef segment_index
< std::string::const_iterator > 
ssegment_index
 convenience typedef
 
typedef segment_index
< std::wstring::const_iterator > 
wssegment_index
 convenience typedef
 
typedef segment_index
< std::u16string::const_iterator > 
u16ssegment_index
 convenience typedef
 
typedef segment_index
< std::u32string::const_iterator > 
u32ssegment_index
 convenience typedef
 
typedef segment_index< char
const * > 
csegment_index
 convenience typedef
 
typedef segment_index< wchar_t
const * > 
wcsegment_index
 convenience typedef
 
typedef segment_index
< char16_t const * > 
u16csegment_index
 convenience typedef
 
typedef segment_index
< char32_t const * > 
u32csegment_index
 convenience typedef
 
typedef boundary_point_index
< std::string::const_iterator > 
sboundary_point_index
 convenience typedef
 
typedef boundary_point_index
< std::wstring::const_iterator > 
wsboundary_point_index
 convenience typedef
 
typedef boundary_point_index
< std::u16string::const_iterator > 
u16sboundary_point_index
 convenience typedef
 
typedef boundary_point_index
< std::u32string::const_iterator > 
u32sboundary_point_index
 convenience typedef
 
typedef boundary_point_index
< char const * > 
cboundary_point_index
 convenience typedef
 
typedef boundary_point_index
< wchar_t const * > 
wcboundary_point_index
 convenience typedef
 
typedef boundary_point_index
< char16_t const * > 
u16cboundary_point_index
 convenience typedef
 
typedef boundary_point_index
< char32_t const * > 
u32cboundary_point_index
 convenience typedef
 
typedef segment
< std::string::const_iterator > 
ssegment
 convenience typedef
 
typedef segment
< std::wstring::const_iterator > 
wssegment
 convenience typedef
 
typedef segment
< std::u16string::const_iterator > 
u16ssegment
 convenience typedef
 
typedef segment
< std::u32string::const_iterator > 
u32ssegment
 convenience typedef
 
typedef segment< char const * > csegment
 convenience typedef
 
typedef segment< wchar_t const * > wcsegment
 convenience typedef
 
typedef segment< char16_t const * > u16csegment
 convenience typedef
 
typedef segment< char32_t const * > u32csegment
 convenience typedef
 
typedef uint32_t rule_type
 Flags used with word boundary analysis – the type of the word, line or sentence boundary found. More...
 

Enumerations

enum  boundary_type { character, word, sentence, line }
 

Functions

template<typename BaseIterator >
bool operator== (BaseIterator const &l, boundary_point< BaseIterator > const &r)
 
template<typename BaseIterator >
bool operator!= (BaseIterator const &l, boundary_point< BaseIterator > const &r)
 
template<typename IteratorL , typename IteratorR >
bool operator== (segment< IteratorL > const &l, segment< IteratorR > const &r)
 Compare two segments.
 
template<typename IteratorL , typename IteratorR >
bool operator!= (segment< IteratorL > const &l, segment< IteratorR > const &r)
 Compare two segments.
 
template<typename IteratorL , typename IteratorR >
bool operator< (segment< IteratorL > const &l, segment< IteratorR > const &r)
 Compare two segments.
 
template<typename IteratorL , typename IteratorR >
bool operator<= (segment< IteratorL > const &l, segment< IteratorR > const &r)
 Compare two segments.
 
template<typename IteratorL , typename IteratorR >
bool operator> (segment< IteratorL > const &l, segment< IteratorR > const &r)
 Compare two segments.
 
template<typename IteratorL , typename IteratorR >
bool operator>= (segment< IteratorL > const &l, segment< IteratorR > const &r)
 Compare two segments.
 
template<typename CharType , typename Traits , typename Alloc , typename IteratorR >
bool operator== (std::basic_string< CharType, Traits, Alloc > const &l, segment< IteratorR > const &r)
 Compare string and segment.
 
template<typename CharType , typename Traits , typename Alloc , typename IteratorR >
bool operator!= (std::basic_string< CharType, Traits, Alloc > const &l, segment< IteratorR > const &r)
 Compare string and segment.
 
template<typename CharType , typename Traits , typename Alloc , typename IteratorR >
bool operator< (std::basic_string< CharType, Traits, Alloc > const &l, segment< IteratorR > const &r)
 Compare string and segment.
 
template<typename CharType , typename Traits , typename Alloc , typename IteratorR >
bool operator<= (std::basic_string< CharType, Traits, Alloc > const &l, segment< IteratorR > const &r)
 Compare string and segment.
 
template<typename CharType , typename Traits , typename Alloc , typename IteratorR >
bool operator> (std::basic_string< CharType, Traits, Alloc > const &l, segment< IteratorR > const &r)
 Compare string and segment.
 
template<typename CharType , typename Traits , typename Alloc , typename IteratorR >
bool operator>= (std::basic_string< CharType, Traits, Alloc > const &l, segment< IteratorR > const &r)
 Compare string and segment.
 
template<typename Iterator , typename CharType , typename Traits , typename Alloc >
bool operator== (segment< Iterator > const &l, std::basic_string< CharType, Traits, Alloc > const &r)
 Compare string and segment.
 
template<typename Iterator , typename CharType , typename Traits , typename Alloc >
bool operator!= (segment< Iterator > const &l, std::basic_string< CharType, Traits, Alloc > const &r)
 Compare string and segment.
 
template<typename Iterator , typename CharType , typename Traits , typename Alloc >
bool operator< (segment< Iterator > const &l, std::basic_string< CharType, Traits, Alloc > const &r)
 Compare string and segment.
 
template<typename Iterator , typename CharType , typename Traits , typename Alloc >
bool operator<= (segment< Iterator > const &l, std::basic_string< CharType, Traits, Alloc > const &r)
 Compare string and segment.
 
template<typename Iterator , typename CharType , typename Traits , typename Alloc >
bool operator> (segment< Iterator > const &l, std::basic_string< CharType, Traits, Alloc > const &r)
 Compare string and segment.
 
template<typename Iterator , typename CharType , typename Traits , typename Alloc >
bool operator>= (segment< Iterator > const &l, std::basic_string< CharType, Traits, Alloc > const &r)
 Compare string and segment.
 
template<typename CharType , typename IteratorR >
bool operator== (CharType const *l, segment< IteratorR > const &r)
 Compare C string and segment.
 
template<typename CharType , typename IteratorR >
bool operator!= (CharType const *l, segment< IteratorR > const &r)
 Compare C string and segment.
 
template<typename CharType , typename IteratorR >
bool operator< (CharType const *l, segment< IteratorR > const &r)
 Compare C string and segment.
 
template<typename CharType , typename IteratorR >
bool operator<= (CharType const *l, segment< IteratorR > const &r)
 Compare C string and segment.
 
template<typename CharType , typename IteratorR >
bool operator> (CharType const *l, segment< IteratorR > const &r)
 Compare C string and segment.
 
template<typename CharType , typename IteratorR >
bool operator>= (CharType const *l, segment< IteratorR > const &r)
 Compare C string and segment.
 
template<typename Iterator , typename CharType >
bool operator== (segment< Iterator > const &l, CharType const *r)
 Compare C string and segment.
 
template<typename Iterator , typename CharType >
bool operator!= (segment< Iterator > const &l, CharType const *r)
 Compare C string and segment.
 
template<typename Iterator , typename CharType >
bool operator< (segment< Iterator > const &l, CharType const *r)
 Compare C string and segment.
 
template<typename Iterator , typename CharType >
bool operator<= (segment< Iterator > const &l, CharType const *r)
 Compare C string and segment.
 
template<typename Iterator , typename CharType >
bool operator> (segment< Iterator > const &l, CharType const *r)
 Compare C string and segment.
 
template<typename Iterator , typename CharType >
bool operator>= (segment< Iterator > const &l, CharType const *r)
 Compare C string and segment.
 
template<typename CharType , typename TraitsType , typename Iterator >
std::basic_ostream< CharType,
TraitsType > & 
operator<< (std::basic_ostream< CharType, TraitsType > &out, segment< Iterator > const &tok)
 
rule_type boundary_rule (boundary_type t)
 

Variables

Flags that describe a type of word selected

static const rule_type word_none = 0x0000F
 Not a word, like white space or punctuation mark.
 
static const rule_type word_number = 0x000F0
 Word that appear to be a number.
 
static const rule_type word_letter = 0x00F00
 Word that contains letters, excluding kana and ideographic characters.
 
static const rule_type word_kana = 0x0F000
 Word that contains kana characters.
 
static const rule_type word_ideo = 0xF0000
 Word that contains ideographic characters.
 
static const rule_type word_any = 0xFFFF0
 Any word including numbers, 0 is special flag, equivalent to 15.
 
static const rule_type word_letters = 0xFFF00
 Any word, excluding numbers but including letters, kana and ideograms.
 
static const rule_type word_kana_ideo = 0xFF000
 Word that includes kana or ideographic characters.
 
static const rule_type word_mask = 0xFFFFF
 
Flags that describe a type of line break

static const rule_type line_soft = 0x0F
 Soft line break: optional but not required.
 
static const rule_type line_hard = 0xF0
 Hard line break: like break is required (as per CR/LF)
 
static const rule_type line_any = 0xFF
 Soft or Hard line break.
 
static const rule_type line_mask = 0xFF
 Select all types of line breaks.
 
Flags that describe a type of sentence break

static const rule_type sentence_term = 0x0F
 The sentence was terminated with a sentence terminator like ".", "!" possible followed by hard separator like CR, LF, PS.
 
static const rule_type sentence_sep = 0xF0
 The sentence does not contain terminator like ".", "!" but ended with hard separator like CR, LF, PS or end of input.
 
static const rule_type sentence_any = 0xFF
 Either first or second sentence break type;.
 
static const rule_type sentence_mask = 0xFF
 Select all sentence breaking points.
 
Flags that describe a type of character break.

At this point break iterator does not distinguish different kinds of characters so it is used for consistency.

static const rule_type character_any = 0xF
 Not in use, just for consistency.
 
static const rule_type character_mask = 0xF
 Select all character breaking points.
 

Detailed Description

This namespae contains all operations required for boundary analysis of text.

This namespase contains all operations required for boundary analysis of text.