31 extern std::string
UTF8ToUpper(
const std::string& text);
33 extern std::string
UTF8ToLower(
const std::string& text);
84 using storage_type = std::vector<codepoint>;
112 bool Empty()
const {
return store.empty(); }
118 size_t Size()
const {
return store.size(); }
130 void Reserve(
size_t sz) { store.reserve(sz); }
167 const storage_type&
Data()
const {
return store; }
175 bool Remove(
size_t pos,
size_t n = 1);
240 std::string
Substr(
size_t pos,
size_t n = (-1))
const;
250 #endif // UTF8HELPER_H byte b[3]
Definition: utf8helper.h:74
std::string UTF8ToUpper(const std::string &text)
std::string Substr(size_t pos, size_t n=(-1)) const
Returns a std::string object with the substring of n characters of this string, starting at the posit...
Exit
Definition: utf8helper.h:70
std::string UTF8ToLower(const std::string &text)
bool Remove(size_t pos, size_t n=1)
Remove n character from the position pos.
UTF8String()
Contructs empty UTF8String object with transformation nop.
codepoint u
Definition: utf8helper.h:76
codepoint TransformTransliterate(const character *, int)
uint32_t codepoint
Definition: utf8helper_charmap.h:37
int context
Definition: utf8helper.h:73
bool Empty() const
Definition: utf8helper.h:112
Definition: utf8helper.h:83
Definition: utf8helper.h:70
Definition: utf8helper.h:70
codepoint TransformCapitalize(const character *, int)
std::string UTF8Normalize(const std::string &text)
std::string UTF8Transliterate(const std::string &text)
Parse and transform an UTF8 string.
Definition: utf8helper.h:69
Parser(utf8helper::Transform func)
size_t RawSize() const
Returns the number of bytes of this string.
Definition: utf8helper.h:124
UTF8String & operator<<(char cc)
Definition: utf8helper.h:151
Exit(* run)(Parser *, byte)
Definition: utf8helper.h:72
utf8helper::Transform func
Definition: utf8helper.h:71
codepoint operator[](size_t pos) const
Returns the character at the position pos.
Definition: utf8helper.h:161
void Reserve(size_t sz)
Attempts to allocate memory for at least sz characters.
Definition: utf8helper.h:130
codepoint TransformNormalize(const character *, int)
codepoint TransformNop(const character *, int)
UTF8String & Transform(utf8helper::Transform)
Apply transformation to the string.
Definition: utf8helper.h:28
Definition: utf8helper.h:70
Definition: utf8helper_charmap.h:41
std::string UTF8Capitalize(const std::string &text)
uint8_t byte
Definition: utf8helper_charmap.h:36
bool Insert(size_t pos, codepoint u, utf8helper::Transform func=utf8helper::TransformNop)
Insert the character u at the position pos.
void WriteByte(char cc)
Push one more byte into this string. A character is added to this string on each valid sequence...
size_t Size() const
Return the number of character of this string.
Definition: utf8helper.h:118
codepoint TransformLower(const character *, int)
void Clear()
Clears the contents of the string and makes it null.
codepoint(*)(const character *, int context) Transform
functor implements desired transformation of the character It has 2 arguments:
Definition: utf8helper.h:49
const storage_type & Data() const
Returns the characters contained in this string.
Definition: utf8helper.h:167
UTF8String & Append(codepoint u, utf8helper::Transform func=utf8helper::TransformNop)
Add character to the string.
std::string ToStdString() const
Returns a std::string object with the data contained in this string.
char u_size
Definition: utf8helper.h:75
codepoint TransformUpper(const character *, int)