7 #ifndef BOOST_LOCALE_CONVERTER_HPP_INCLUDED 8 #define BOOST_LOCALE_CONVERTER_HPP_INCLUDED 10 #include <boost/locale/config.hpp> 14 # pragma warning(push) 15 # pragma warning(disable : 4275 4251 4231 4660) 46 template<
typename CharType>
49 #ifdef BOOST_LOCALE_DOXYGEN 50 template<
typename Char>
60 static std::locale::id
id;
63 converter(
size_t refs = 0) : std::locale::facet(refs)
70 virtual std::basic_string<Char> convert(conversion_type how,Char
const *begin,Char
const *end,
int flags = 0)
const = 0;
71 #if defined (__SUNPRO_CC) && defined (_RWSTD_VER) 72 std::locale::id& __get_id (
void)
const {
return id; }
78 class BOOST_LOCALE_DECL converter<char> :
public converter_base,
public std::locale::facet {
80 static std::locale::id id;
82 converter(
size_t refs = 0) : std::locale::facet(refs)
86 virtual std::string convert(conversion_type how,
char const *begin,
char const *end,
int flags = 0)
const = 0;
87 #if defined (__SUNPRO_CC) && defined (_RWSTD_VER) 88 std::locale::id& __get_id (
void)
const {
return id; }
93 class BOOST_LOCALE_DECL converter<wchar_t> :
public converter_base,
public std::locale::facet {
95 static std::locale::id id;
96 converter(
size_t refs = 0) : std::locale::facet(refs)
100 virtual std::wstring convert(conversion_type how,
wchar_t const *begin,
wchar_t const *end,
int flags = 0)
const = 0;
101 #if defined (__SUNPRO_CC) && defined (_RWSTD_VER) 102 std::locale::id& __get_id (
void)
const {
return id; }
106 #ifdef BOOST_LOCALE_ENABLE_CHAR16_T 108 class BOOST_LOCALE_DECL converter<char16_t> :
public converter_base,
public std::locale::facet {
110 static std::locale::id id;
111 converter(
size_t refs = 0) : std::locale::facet(refs)
115 virtual std::u16string convert(conversion_type how,char16_t
const *begin,char16_t
const *end,
int flags = 0)
const = 0;
116 #if defined (__SUNPRO_CC) && defined (_RWSTD_VER) 117 std::locale::id& __get_id (
void)
const {
return id; }
122 #ifdef BOOST_LOCALE_ENABLE_CHAR32_T 124 class BOOST_LOCALE_DECL converter<char32_t> :
public converter_base,
public std::locale::facet {
126 static std::locale::id id;
127 converter(
size_t refs = 0) : std::locale::facet(refs)
131 virtual std::u32string convert(conversion_type how,char32_t
const *begin,char32_t
const *end,
int flags = 0)
const = 0;
132 #if defined (__SUNPRO_CC) && defined (_RWSTD_VER) 133 std::locale::id& __get_id (
void)
const {
return id; }
161 template<
typename CharType>
176 template<
typename CharType>
179 CharType
const *end=str;
194 template<
typename CharType>
195 std::basic_string<CharType>
normalize( CharType
const *begin,
198 std::locale
const &loc=std::locale())
211 template<
typename CharType>
212 std::basic_string<CharType>
to_upper(std::basic_string<CharType>
const &str,std::locale
const &loc=std::locale())
222 template<
typename CharType>
223 std::basic_string<CharType>
to_upper(CharType
const *str,std::locale
const &loc=std::locale())
225 CharType
const *end=str;
236 template<
typename CharType>
237 std::basic_string<CharType>
to_upper(CharType
const *begin,CharType
const *end,std::locale
const &loc=std::locale())
250 template<
typename CharType>
251 std::basic_string<CharType>
to_lower(std::basic_string<CharType>
const &str,std::locale
const &loc=std::locale())
261 template<
typename CharType>
262 std::basic_string<CharType>
to_lower(CharType
const *str,std::locale
const &loc=std::locale())
264 CharType
const *end=str;
275 template<
typename CharType>
276 std::basic_string<CharType>
to_lower(CharType
const *begin,CharType
const *end,std::locale
const &loc=std::locale())
288 template<
typename CharType>
289 std::basic_string<CharType>
to_title(std::basic_string<CharType>
const &str,std::locale
const &loc=std::locale())
299 template<
typename CharType>
300 std::basic_string<CharType>
to_title(CharType
const *str,std::locale
const &loc=std::locale())
302 CharType
const *end=str;
313 template<
typename CharType>
314 std::basic_string<CharType>
to_title(CharType
const *begin,CharType
const *end,std::locale
const &loc=std::locale())
327 template<
typename CharType>
328 std::basic_string<CharType>
fold_case(std::basic_string<CharType>
const &str,std::locale
const &loc=std::locale())
338 template<
typename CharType>
339 std::basic_string<CharType>
fold_case(CharType
const *str,std::locale
const &loc=std::locale())
341 CharType
const *end=str;
352 template<
typename CharType>
353 std::basic_string<CharType>
fold_case(CharType
const *begin,CharType
const *end,std::locale
const &loc=std::locale())
Canonical decomposition.
Definition: conversion.hpp:145
std::basic_string< CharType > fold_case(std::basic_string< CharType > const &str, std::locale const &loc=std::locale())
Definition: conversion.hpp:328
Apply Unicode normalization on the text.
Definition: conversion.hpp:38
The facet that implements text manipulation.
Definition: conversion.hpp:47
Convert text to lower case.
Definition: conversion.hpp:40
std::basic_string< CharType > to_title(std::basic_string< CharType > const &str, std::locale const &loc=std::locale())
Definition: conversion.hpp:289
Convert text to upper case.
Definition: conversion.hpp:39
std::basic_string< CharType > to_upper(std::basic_string< CharType > const &str, std::locale const &loc=std::locale())
Definition: conversion.hpp:212
Compatibility decomposition.
Definition: conversion.hpp:147
This class provides base flags for text manipulation. It is used as base for converter facet.
Definition: conversion.hpp:32
Convert text to title case.
Definition: conversion.hpp:42
norm_type
Definition: conversion.hpp:144
Compatibility decomposition followed by canonical composition.
Definition: conversion.hpp:148
conversion_type
Definition: conversion.hpp:37
std::basic_string< CharType > to_lower(std::basic_string< CharType > const &str, std::locale const &loc=std::locale())
Definition: conversion.hpp:251
Fold case in the text.
Definition: conversion.hpp:41
std::basic_string< CharType > normalize(std::basic_string< CharType > const &str, norm_type n=norm_default, std::locale const &loc=std::locale())
Definition: conversion.hpp:162
static std::locale::id id
Locale identification.
Definition: conversion.hpp:60
Canonical decomposition followed by canonical composition.
Definition: conversion.hpp:146
converter(size_t refs=0)
Standard constructor.
Definition: conversion.hpp:63
Default normalization - canonical decomposition followed by canonical composition.
Definition: conversion.hpp:149