|
FIFE
|
UTF-8 string editor. More...
#include <utf8stringeditor.h>
Collaboration diagram for fcn::UTF8StringEditor:Static Public Member Functions | |
| static int | nextChar (const std::string &text, int byteOffset) |
| Returns byte offset of the next character. More... | |
| static int | prevChar (const std::string &text, int byteOffset) |
| Returns byte offset of the previous character. More... | |
| static int | eraseChar (std::string &text, int byteOffset) |
| Erase character at specified byte offset. More... | |
| static int | insertChar (std::string &text, int byteOffset, int ch) |
| Insert a character at specified byte offset. More... | |
| static int | countChars (const std::string &text, int byteOffset) |
| Counts characters up to byteOffset. More... | |
| static int | getOffset (const std::string &text, int charIndex) |
| Gets byte offset for character index. More... | |
UTF-8 string editor.
This is a helper class which allows to use UTF-8 strings in your application.
Definition at line 45 of file utf8stringeditor.h.
|
static |
Counts characters up to byteOffset.
| text | UTF-8 text to navigate. |
| byteOffset | Byte offset inside the text. |
Definition at line 93 of file utf8stringeditor.cpp.
References utf8::distance().
|
static |
Erase character at specified byte offset.
| text | UTF-8 text to modify. |
| byteOffset | Byte offset of the character to erase. |
Definition at line 60 of file utf8stringeditor.cpp.
References utf8::next().
|
static |
Gets byte offset for character index.
This method automaticly clips charIndex to be inside the string + EOF
| text | UTF-8 text to navigate. |
| charIndex | Character index to move to. |
Definition at line 98 of file utf8stringeditor.cpp.
References utf8::next().
|
static |
Insert a character at specified byte offset.
| text | UTF-8 text to modify. |
| byteOffset | Byte offset where character will be inserted. |
| ch | Unicode character to insert. |
Definition at line 71 of file utf8stringeditor.cpp.
References utf8::append(), and utf8::next().
|
static |
Returns byte offset of the next character.
| text | UTF-8 text to navigate. |
| byteOffset | Byte offset of current character. |
Definition at line 38 of file utf8stringeditor.cpp.
References utf8::next().
|
static |
Returns byte offset of the previous character.
| text | UTF-8 text to navigate. |
| byteOffset | Byte offset of current character. |
Definition at line 49 of file utf8stringeditor.cpp.
References utf8::prior().