This class represents a normal text segment from the source string. More...
#include <texttoken.h>
Public Types | |
enum | TokenType { TT_Error = 0, TT_Text = 1, TT_TagInvalid = 2, TT_RangeTagStart = 3, TT_RangeTagEnd = 4, TT_InsertTag = 5 } |
The type of token this class represents. More... | |
Public Member Functions | |
TextToken () | |
Class constructor. More... | |
TextToken (const String &RawText, const TokenType TType) | |
Descriptive constructor. More... | |
TextToken (const Char8 *Characters, const UInt32 Size) | |
Char8 constructor. More... | |
TextToken (const UInt32 *Characters, const UInt32 Size) | |
Char8 constructor. More... | |
virtual | ~TextToken () |
Class destructor. | |
virtual UInt32 | ClearAllCharacters () |
Removes all the rendered characters from this token. More... | |
virtual UInt32 | GetRawCharacterSize () const |
Gets the number of Char8's that comprise the source text for this tag. More... | |
virtual const String & | GetRawCharacterString () const |
Gets the raw string for this token used to render or manipulate characters. More... | |
virtual UInt32 | GetRenderCharacterSize () const |
Gets the number of rendered characters this token generates. More... | |
virtual TextToken::TokenType | GetTokenType () const |
Gets the type of token this is. More... | |
virtual UInt32 | InsertCharacter (const UInt32 Index, UInt32 UChar) |
Inserts a single UTF-32 size character into this token. More... | |
virtual UInt32 | InsertCharacters (const UInt32 Index, const Char8 *Characters, const UInt32 Size) |
Inserts multiple characters into this token. More... | |
virtual UInt32 | InsertCharacters (const UInt32 Index, const UInt32 *Characters, const UInt32 Size) |
Inserts multiple characters into this token. More... | |
virtual UInt32 | RemoveCharacter (const UInt32 Index) |
Removes a single rendered character from this token. More... | |
virtual UInt32 | RemoveCharacters (const UInt32 Index, const UInt32 Length) |
Removes rendered characters from this token. More... | |
Protected Member Functions | |
UInt32 | ConvertRenderIndexToRawIndex (const UInt32 Index) |
Takes a position of a renderable char and converts it to the respective position in the raw string. More... | |
Protected Attributes | |
UInt32 | RenderSize |
The number of rendered characters this token produced. More... | |
String | Text |
Container for the converted text. More... | |
TokenType | Type |
Type of token this is. More... | |
Friends | |
class | MarkupParser |
This class represents a normal text segment from the source string.
Text tokens are intended for the generation of segments of regular glyphs provided by an atlas or font file. They have no special behaviors of their own and will almost always have their render size match their text size.
Definition at line 56 of file texttoken.h.
The type of token this class represents.
Definition at line 60 of file texttoken.h.
Mezzanine::UI::TextToken::TextToken | ( | ) |
Class constructor.
Definition at line 55 of file texttoken.cpp.
Descriptive constructor.
RawText | A string containing the raw text of this token. |
TType | The type of text token to be created. |
Definition at line 60 of file texttoken.cpp.
Char8 constructor.
Characters | A buffer of UTF-8 characters to populate this TextToken with. |
Size | The number of characters that exist in the provided buffer. |
Definition at line 66 of file texttoken.cpp.
Char8 constructor.
Characters | A buffer of UTF-32 characters to populate this TextToken with. |
Size | The number of characters that exist in the provided buffer. |
Definition at line 71 of file texttoken.cpp.
|
virtual |
Removes all the rendered characters from this token.
Reimplemented in Mezzanine::UI::InsertTagToken, and Mezzanine::UI::RangeTagToken.
Definition at line 222 of file texttoken.cpp.
Takes a position of a renderable char and converts it to the respective position in the raw string.
Index | The index to be converted. |
Definition at line 79 of file texttoken.cpp.
|
virtual |
Gets the number of Char8's that comprise the source text for this tag.
Definition at line 102 of file texttoken.cpp.
|
virtual |
Gets the raw string for this token used to render or manipulate characters.
Definition at line 96 of file texttoken.cpp.
|
virtual |
Gets the number of rendered characters this token generates.
Definition at line 105 of file texttoken.cpp.
|
virtual |
Gets the type of token this is.
Definition at line 99 of file texttoken.cpp.
Inserts a single UTF-32 size character into this token.
Index | The index at which the character will be inserted. |
UChar | The unicode character to be inserted. This will be converted to UTF-8 prior to insertion. |
Reimplemented in Mezzanine::UI::InsertTagToken, and Mezzanine::UI::RangeTagToken.
Definition at line 108 of file texttoken.cpp.
|
virtual |
Inserts multiple characters into this token.
Index | The index at which the characters will be inserted. |
Characters | An array of Char8's encoded in UTF-8 to be inserted. |
Size | The size of the array of Char8's passed in. |
Reimplemented in Mezzanine::UI::InsertTagToken, and Mezzanine::UI::RangeTagToken.
Definition at line 113 of file texttoken.cpp.
|
virtual |
Inserts multiple characters into this token.
Index | The index at which the characters will be inserted. |
Characters | An array of UInt32's encoded in UTF-32 to be inserted. |
Size | The size of the array of UInt32's passed in. |
Reimplemented in Mezzanine::UI::InsertTagToken, and Mezzanine::UI::RangeTagToken.
Definition at line 141 of file texttoken.cpp.
Removes a single rendered character from this token.
Index | The index at which the rendered character will be removed. |
Reimplemented in Mezzanine::UI::InsertTagToken, and Mezzanine::UI::RangeTagToken.
Definition at line 173 of file texttoken.cpp.
|
virtual |
Removes rendered characters from this token.
Index | The index at which to start removing characters from this token. |
Length | The number of characters to try and remove from this token. |
Reimplemented in Mezzanine::UI::InsertTagToken, and Mezzanine::UI::RangeTagToken.
Definition at line 194 of file texttoken.cpp.
|
protected |
The number of rendered characters this token produced.
Definition at line 76 of file texttoken.h.
|
protected |
Container for the converted text.
Definition at line 79 of file texttoken.h.
|
protected |
Type of token this is.
Definition at line 73 of file texttoken.h.