|
libosmscout 0.1
|
#include <utf8helper.h>
Public Member Functions | |
| UTF8String & | Append (codepoint u, utf8helper::Transform func=utf8helper::TransformNop) |
| Add character to the string. | |
| UTF8String & | Append (const storage_type &data, utf8helper::Transform func=utf8helper::TransformNop) |
| Add characters to the string. | |
| void | Clear () |
| Clears the contents of the string and makes it null. | |
| const storage_type & | Data () const |
| Returns the characters contained in this string. | |
| bool | Empty () const |
| bool | Insert (size_t pos, codepoint u, utf8helper::Transform func=utf8helper::TransformNop) |
| Insert the character u at the position pos. | |
| size_t | Insert (size_t pos, const storage_type &data, utf8helper::Transform func=utf8helper::TransformNop) |
| Insert characters at the position pos. | |
| UTF8String & | operator<< (char cc) |
| A convenience method for writeByte(char) | |
| codepoint | operator[] (size_t pos) const |
| Returns the character at the position pos. | |
| size_t | RawSize () const |
| Returns the number of bytes of this string. | |
| bool | Remove (size_t pos, size_t n=1) |
| Remove n character from the position pos. | |
| void | Reserve (size_t sz) |
| Attempts to allocate memory for at least sz characters. | |
| size_t | Size () const |
| Return the number of character of this string. | |
| 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 position pos. | |
| std::string | ToStdString () const |
| Returns a std::string object with the data contained in this string. | |
| UTF8String & | Transform (const std::string &text, utf8helper::Transform) |
| Transform and assign the text to the string. | |
| UTF8String & | Transform (utf8helper::Transform) |
| Apply transformation to the string. | |
| UTF8String () | |
| Contructs empty UTF8String object with transformation nop. | |
| UTF8String (const std::string &text) | |
| Contructs UTF8String object containing the text. | |
| UTF8String (const std::string &text, utf8helper::Transform) | |
| Contructs UTF8String object containing the text with specified transformation. | |
| UTF8String (const UTF8String &)=default | |
| UTF8String (utf8helper::Transform) | |
| Contructs empty UTF8String object with the specified transformation. | |
| void | WriteByte (char cc) |
| Push one more byte into this string. | |
| utf8helper::UTF8String::UTF8String | ( | ) |
Contructs empty UTF8String object with transformation nop.
|
explicit |
Contructs UTF8String object containing the text.
References utf8helper::Parser::func.
|
explicit |
Contructs empty UTF8String object with the specified transformation.
| utf8helper::UTF8String::UTF8String | ( | const std::string & | text, |
| utf8helper::Transform | func | ||
| ) |
Contructs UTF8String object containing the text with specified transformation.
|
default |
| UTF8String & utf8helper::UTF8String::Append | ( | codepoint | u, |
| utf8helper::Transform | func = utf8helper::TransformNop |
||
| ) |
Add character to the string.
| u | |
| transform | function = nop |
References utf8helper::_u_string(), utf8helper::Parser::Continue, utf8helper::Parser::Done, utf8helper::Parser::Error, utf8helper::Parser::run, utf8helper::Parser::u, and utf8helper::Parser::u_size.
Referenced by Append().
| UTF8String & utf8helper::UTF8String::Append | ( | const storage_type & | data, |
| utf8helper::Transform | func = utf8helper::TransformNop |
||
| ) |
Add characters to the string.
| data | |
| transform | function = nop |
References Append().
| void utf8helper::UTF8String::Clear | ( | ) |
Clears the contents of the string and makes it null.
References utf8helper::Parser::Reset().
Referenced by Transform(), and Transform().
|
inline |
Returns the characters contained in this string.
|
inline |
| bool utf8helper::UTF8String::Insert | ( | size_t | pos, |
| codepoint | u, | ||
| utf8helper::Transform | func = utf8helper::TransformNop |
||
| ) |
Insert the character u at the position pos.
| pos | |
| u | |
| transform | function = nop |
References utf8helper::_u_string(), utf8helper::Parser::Continue, utf8helper::Parser::Done, utf8helper::Parser::Error, utf8helper::Parser::run, Size(), utf8helper::Parser::u, and utf8helper::Parser::u_size.
Referenced by Insert().
| size_t utf8helper::UTF8String::Insert | ( | size_t | pos, |
| const storage_type & | data, | ||
| utf8helper::Transform | func = utf8helper::TransformNop |
||
| ) |
|
inline |
A convenience method for writeByte(char)
| cc |
References WriteByte().
|
inline |
Returns the character at the position pos.
| pos |
|
inline |
Returns the number of bytes of this string.
| bool utf8helper::UTF8String::Remove | ( | size_t | pos, |
| size_t | n = 1 |
||
| ) |
Remove n character from the position pos.
| pos | |
| n |
References utf8helper::_u_size(), n, and Size().
|
inline |
|
inline |
| std::string utf8helper::UTF8String::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 position pos.
| pos | |
| n |
References utf8helper::_u_string(), and n.
| std::string utf8helper::UTF8String::ToStdString | ( | ) | const |
Returns a std::string object with the data contained in this string.
References utf8helper::_u_string().
Referenced by utf8helper::UTF8Capitalize(), utf8helper::UTF8Normalize(), utf8helper::UTF8ToLower(), utf8helper::UTF8ToUpper(), and utf8helper::UTF8Transliterate().
| UTF8String & utf8helper::UTF8String::Transform | ( | const std::string & | text, |
| utf8helper::Transform | func | ||
| ) |
Transform and assign the text to the string.
| text | |
| transform | function |
References Clear(), utf8helper::Parser::func, Reserve(), and WriteByte().
| UTF8String & utf8helper::UTF8String::Transform | ( | utf8helper::Transform | func | ) |
Apply transformation to the string.
| transform | function |
References utf8helper::_u_string(), Clear(), utf8helper::Parser::func, and WriteByte().
| void utf8helper::UTF8String::WriteByte | ( | char | cc | ) |
Push one more byte into this string.
A character is added to this string on each valid sequence.
| cc |
References utf8helper::Parser::Continue, utf8helper::Parser::Done, utf8helper::Parser::Error, utf8helper::Parser::run, utf8helper::Parser::u, and utf8helper::Parser::u_size.
Referenced by operator<<(), Transform(), and Transform().