|
FifeGUI 0.2.0
A C++ GUI library designed for games.
|
#include <utf8stringeditor.hpp>
Static Public Member Functions | |
| static int | countChars (std::string const &text, int byteOffset) |
| static int | eraseChar (std::string &text, int byteOffset) |
| static int | getOffset (std::string const &text, int charIndex) |
| static int | insertChar (std::string &text, int byteOffset, int ch) |
| static int | nextChar (std::string const &text, int byteOffset) |
| static int | prevChar (std::string const &text, int byteOffset) |
Utility for editing and handling UTF-8 encoded strings.
This is a helper class which allows to use UTF-8 strings in your application.
Definition at line 22 of file utf8stringeditor.hpp.
|
static |
Counts characters up to byteOffset.
| text | UTF-8 text to navigate. |
| byteOffset | Byte offset inside the text. |
Definition at line 71 of file utf8stringeditor.cpp.
Referenced by fcn::TextBox::keyPressed(), and fcn::TextBox::setCaretRowUTF8().
|
static |
Erase character at specified byte offset.
| text | UTF-8 text to modify. |
| byteOffset | Byte offset of the character to erase. |
Definition at line 37 of file utf8stringeditor.cpp.
Referenced by fcn::PasswordField::keyPressed(), fcn::TextBox::keyPressed(), and fcn::TextField::keyPressed().
|
static |
Gets byte offset for character index.
This method automatically clips charIndex to be inside the string + EOF
| text | UTF-8 text to navigate. |
| charIndex | Character index to move to. |
Definition at line 76 of file utf8stringeditor.cpp.
Referenced by fcn::TextBox::keyPressed(), fcn::TextBox::setCaretColumnUTF8(), and fcn::TextBox::setCaretRowUTF8().
|
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 49 of file utf8stringeditor.cpp.
Referenced by fcn::PasswordField::keyPressed(), fcn::TextBox::keyPressed(), and fcn::TextField::keyPressed().
|
static |
Returns byte offset of the next character.
| text | UTF-8 text to navigate. |
| byteOffset | Byte offset of current character. |
Definition at line 13 of file utf8stringeditor.cpp.
Referenced by fcn::PasswordField::keyPressed(), fcn::TextBox::keyPressed(), and fcn::TextField::keyPressed().
|
static |
Returns byte offset of the previous character.
| text | UTF-8 text to navigate. |
| byteOffset | Byte offset of current character. |
Definition at line 25 of file utf8stringeditor.cpp.
Referenced by fcn::PasswordField::keyPressed(), fcn::TextBox::keyPressed(), and fcn::TextField::keyPressed().