Boost.Locale
Text Conversions

Classes

class  boost::locale::converter_base
 This class provides base flags for text manipulation. It is used as base for converter facet. More...
 
class  boost::locale::converter< Char >
 The facet that implements text manipulation. More...
 

Enumerations

enum  boost::locale::norm_type {
  boost::locale::norm_nfd , boost::locale::norm_nfc , boost::locale::norm_nfkd , boost::locale::norm_nfkc ,
  boost::locale::norm_default = norm_nfc
}
 The type that defined normalization form More...
 

Functions

template<typename CharType >
std::basic_string< CharType > boost::locale::normalize (const CharType *begin, const CharType *end, norm_type n=norm_default, const std::locale &loc=std::locale())
 
template<typename CharType >
std::basic_string< CharType > boost::locale::normalize (const std::basic_string< CharType > &str, norm_type n=norm_default, const std::locale &loc=std::locale())
 
template<typename CharType >
std::basic_string< CharType > boost::locale::normalize (const CharType *str, norm_type n=norm_default, const std::locale &loc=std::locale())
 
template<typename CharType >
std::basic_string< CharType > boost::locale::to_upper (const CharType *begin, const CharType *end, const std::locale &loc=std::locale())
 
template<typename CharType >
std::basic_string< CharType > boost::locale::to_upper (const std::basic_string< CharType > &str, const std::locale &loc=std::locale())
 
template<typename CharType >
std::basic_string< CharType > boost::locale::to_upper (const CharType *str, const std::locale &loc=std::locale())
 
template<typename CharType >
std::basic_string< CharType > boost::locale::to_lower (const CharType *begin, const CharType *end, const std::locale &loc=std::locale())
 
template<typename CharType >
std::basic_string< CharType > boost::locale::to_lower (const std::basic_string< CharType > &str, const std::locale &loc=std::locale())
 
template<typename CharType >
std::basic_string< CharType > boost::locale::to_lower (const CharType *str, const std::locale &loc=std::locale())
 
template<typename CharType >
std::basic_string< CharType > boost::locale::to_title (const CharType *begin, const CharType *end, const std::locale &loc=std::locale())
 
template<typename CharType >
std::basic_string< CharType > boost::locale::to_title (const std::basic_string< CharType > &str, const std::locale &loc=std::locale())
 
template<typename CharType >
std::basic_string< CharType > boost::locale::to_title (const CharType *str, const std::locale &loc=std::locale())
 
template<typename CharType >
std::basic_string< CharType > boost::locale::fold_case (const CharType *begin, const CharType *end, const std::locale &loc=std::locale())
 
template<typename CharType >
std::basic_string< CharType > boost::locale::fold_case (const std::basic_string< CharType > &str, const std::locale &loc=std::locale())
 
template<typename CharType >
std::basic_string< CharType > boost::locale::fold_case (const CharType *str, const std::locale &loc=std::locale())
 

Detailed Description

This module provides various function for string manipulation like Unicode normalization, case conversion etc.

Enumeration Type Documentation

◆ norm_type

The type that defined normalization form

Enumerator
norm_nfd 

Canonical decomposition.

norm_nfc 

Canonical decomposition followed by canonical composition.

norm_nfkd 

Compatibility decomposition.

norm_nfkc 

Compatibility decomposition followed by canonical composition.

norm_default 

Default normalization - canonical decomposition followed by canonical composition.

Function Documentation

◆ fold_case() [1/3]

template<typename CharType >
std::basic_string< CharType > boost::locale::fold_case ( const CharType *  begin,
const CharType *  end,
const std::locale &  loc = std::locale() 
)

Fold case of a string in range [begin,end) according to locale loc

Exceptions
std::bad_castloc does not have converter facet installed

◆ fold_case() [2/3]

template<typename CharType >
std::basic_string< CharType > boost::locale::fold_case ( const CharType *  str,
const std::locale &  loc = std::locale() 
)

Fold case of a NULL terminated string str according to locale loc

Exceptions
std::bad_castloc does not have converter facet installed

◆ fold_case() [3/3]

template<typename CharType >
std::basic_string< CharType > boost::locale::fold_case ( const std::basic_string< CharType > &  str,
const std::locale &  loc = std::locale() 
)

Fold case of a string str according to locale loc

Exceptions
std::bad_castloc does not have converter facet installed

◆ normalize() [1/3]

template<typename CharType >
std::basic_string< CharType > boost::locale::normalize ( const CharType *  begin,
const CharType *  end,
norm_type  n = norm_default,
const std::locale &  loc = std::locale() 
)

Normalize Unicode string in range [begin,end) according to normalization form n

Note: This function receives only Unicode strings, i.e.: UTF-8, UTF-16 or UTF-32. It does not take in account the locale encoding, because Unicode decomposition and composition are meaningless outside of a Unicode character set.

Exceptions
std::bad_castloc does not have converter facet installed

◆ normalize() [2/3]

template<typename CharType >
std::basic_string< CharType > boost::locale::normalize ( const CharType *  str,
norm_type  n = norm_default,
const std::locale &  loc = std::locale() 
)

Normalize NULL terminated Unicode string str according to normalization form n

Note: This function receives only Unicode strings, i.e.: UTF-8, UTF-16 or UTF-32. It does not take in account the locale encoding, because Unicode decomposition and composition are meaningless outside of a Unicode character set.

Exceptions
std::bad_castloc does not have converter facet installed

◆ normalize() [3/3]

template<typename CharType >
std::basic_string< CharType > boost::locale::normalize ( const std::basic_string< CharType > &  str,
norm_type  n = norm_default,
const std::locale &  loc = std::locale() 
)

Normalize Unicode string str according to normalization form n

Note: This function receives only Unicode strings, i.e.: UTF-8, UTF-16 or UTF-32. It does not take in account the locale encoding, because Unicode decomposition and composition are meaningless outside of a Unicode character set.

Exceptions
std::bad_castloc does not have converter facet installed

◆ to_lower() [1/3]

template<typename CharType >
std::basic_string< CharType > boost::locale::to_lower ( const CharType *  begin,
const CharType *  end,
const std::locale &  loc = std::locale() 
)

Convert a string in range [begin,end) to lower case according to locale loc

Exceptions
std::bad_castloc does not have converter facet installed
Examples
conversions.cpp, and wconversions.cpp.

◆ to_lower() [2/3]

template<typename CharType >
std::basic_string< CharType > boost::locale::to_lower ( const CharType *  str,
const std::locale &  loc = std::locale() 
)

Convert a NULL terminated string str to lower case according to locale loc

Exceptions
std::bad_castloc does not have converter facet installed

◆ to_lower() [3/3]

template<typename CharType >
std::basic_string< CharType > boost::locale::to_lower ( const std::basic_string< CharType > &  str,
const std::locale &  loc = std::locale() 
)

Convert a string str to lower case according to locale loc

Exceptions
std::bad_castloc does not have converter facet installed

◆ to_title() [1/3]

template<typename CharType >
std::basic_string< CharType > boost::locale::to_title ( const CharType *  begin,
const CharType *  end,
const std::locale &  loc = std::locale() 
)

Convert a string in range [begin,end) to title case according to locale loc

Exceptions
std::bad_castloc does not have converter facet installed

◆ to_title() [2/3]

template<typename CharType >
std::basic_string< CharType > boost::locale::to_title ( const CharType *  str,
const std::locale &  loc = std::locale() 
)

Convert a NULL terminated string str to title case according to locale loc

Exceptions
std::bad_castloc does not have converter facet installed

◆ to_title() [3/3]

template<typename CharType >
std::basic_string< CharType > boost::locale::to_title ( const std::basic_string< CharType > &  str,
const std::locale &  loc = std::locale() 
)

Convert a string str to title case according to locale loc

Exceptions
std::bad_castloc does not have converter facet installed

◆ to_upper() [1/3]

template<typename CharType >
std::basic_string< CharType > boost::locale::to_upper ( const CharType *  begin,
const CharType *  end,
const std::locale &  loc = std::locale() 
)

Convert a string in range [begin,end) to upper case according to locale loc

Exceptions
std::bad_castloc does not have converter facet installed
Examples
conversions.cpp, and wconversions.cpp.

◆ to_upper() [2/3]

template<typename CharType >
std::basic_string< CharType > boost::locale::to_upper ( const CharType *  str,
const std::locale &  loc = std::locale() 
)

Convert a NULL terminated string str to upper case according to locale loc

Exceptions
std::bad_castloc does not have converter facet installed

◆ to_upper() [3/3]

template<typename CharType >
std::basic_string< CharType > boost::locale::to_upper ( const std::basic_string< CharType > &  str,
const std::locale &  loc = std::locale() 
)

Convert a string str to upper case according to locale loc

Exceptions
std::bad_castloc does not have converter facet installed