MezzanineEngine 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Protected Attributes | Friends | List of all members
Mezzanine::UI::RangeTagToken Class Reference

This struct represents a markup tag segment from the source string. More...

#include <texttoken.h>

+ Inheritance diagram for Mezzanine::UI::RangeTagToken:
+ Collaboration diagram for Mezzanine::UI::RangeTagToken:

Public Member Functions

 RangeTagToken ()
 Class constructor.
 
 RangeTagToken (const String &RawText, const String &Name, const TokenType TType)
 Descriptive constructor. More...
 
virtual ~RangeTagToken ()
 Class destructor.
 
virtual UInt32 ClearAllCharacters ()
 Removes all the rendered characters from this token. More...
 
RangeTagTokenGetPartnerTag () const
 Gets the partner tag to this RangeTag. 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)
 
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...
 
- Public Member Functions inherited from Mezzanine::UI::TagToken
 TagToken ()
 Class constructor.
 
 TagToken (const String &RawText, const String &Name, const TokenType TType)
 Descriptive constructor. More...
 
virtual ~TagToken ()
 Class destructor.
 
String GetParameter (const String &Param) const
 Gets a parameter specified in this token by name. More...
 
const StringGetTagName () const
 Gets the name of the tag this token represents. More...
 
- Public Member Functions inherited from Mezzanine::UI::TextToken
 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 GetRawCharacterSize () const
 Gets the number of Char8's that comprise the source text for this tag. More...
 
virtual const StringGetRawCharacterString () 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...
 

Protected Attributes

RangeTagTokenPartnerTag
 Pointer to the opening/closing tag for this tag.
 
- Protected Attributes inherited from Mezzanine::UI::TagToken
NameValuePairMap Params
 The parameters provided for this tag, if any.
 
String TagName
 Unconverted version of the tag name.
 
- Protected Attributes inherited from Mezzanine::UI::TextToken
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
 

Additional Inherited Members

- Public Types inherited from Mezzanine::UI::TextToken
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...
 
- Protected Member Functions inherited from Mezzanine::UI::TextToken
UInt32 ConvertRenderIndexToRawIndex (const UInt32 Index)
 Takes a position of a renderable char and converts it to the respective position in the raw string. More...
 

Detailed Description

This struct represents a markup tag segment from the source string.

Tag tokens are tokens that represent text that isn't intended to be rendered, but instead alter other text around it or create special characters of their own. The render size on tag token should never never match the text size, instead being 0 or 1.

Definition at line 208 of file texttoken.h.

Constructor & Destructor Documentation

Mezzanine::UI::RangeTagToken::RangeTagToken ( const String RawText,
const String Name,
const TokenType  TType 
)
inline

Descriptive constructor.

Parameters
RawTextA string containing the raw text of this token.
NameThe name of this tag.
TTypeThe type of text token to be created.

Definition at line 222 of file texttoken.h.

Member Function Documentation

UInt32 Mezzanine::UI::RangeTagToken::ClearAllCharacters ( )
virtual

Removes all the rendered characters from this token.

Returns
Returns the number of rendered characters that were actually removed.

Reimplemented from Mezzanine::UI::TextToken.

Definition at line 279 of file texttoken.cpp.

RangeTagToken * Mezzanine::UI::RangeTagToken::GetPartnerTag ( ) const

Gets the partner tag to this RangeTag.

Returns
Returns a pointer to the other tag paired with this range tag.

Definition at line 224 of file texttoken.cpp.

UInt32 Mezzanine::UI::RangeTagToken::InsertCharacter ( const UInt32  Index,
UInt32  UChar 
)
virtual

Inserts a single UTF-32 size character into this token.

Parameters
IndexThe index at which the character will be inserted.
UCharThe unicode character to be inserted. This will be converted to UTF-8 prior to insertion.
Returns
Returns 1 if the character was successfully inserted, otherwise returns 0. Note: This is not rendered characters, as they don't get generated until the tokens are re-parsed.

Reimplemented from Mezzanine::UI::TextToken.

Definition at line 229 of file texttoken.cpp.

UInt32 Mezzanine::UI::RangeTagToken::InsertCharacters ( const UInt32  Index,
const Char8 Characters,
const UInt32  Size 
)
virtual

Reimplemented from Mezzanine::UI::TextToken.

Definition at line 239 of file texttoken.cpp.

UInt32 Mezzanine::UI::RangeTagToken::InsertCharacters ( const UInt32  Index,
const UInt32 Characters,
const UInt32  Size 
)
virtual

Inserts multiple characters into this token.

Parameters
IndexThe index at which the characters will be inserted.
CharactersAn array of UInt32's encoded in UTF-32 to be inserted.
SizeThe size of the array of UInt32's passed in.
Returns
Returns the number of characters successfully inserted. Note: This is not rendered characters, as they don't get generated until the tokens are re-parsed.

Reimplemented from Mezzanine::UI::TextToken.

Definition at line 249 of file texttoken.cpp.

UInt32 Mezzanine::UI::RangeTagToken::RemoveCharacter ( const UInt32  Index)
virtual

Removes a single rendered character from this token.

Parameters
IndexThe index at which the rendered character will be removed.
Returns
Returns 1 if the character was successfully removed, otherwise returns 0.

Reimplemented from Mezzanine::UI::TextToken.

Definition at line 259 of file texttoken.cpp.

UInt32 Mezzanine::UI::RangeTagToken::RemoveCharacters ( const UInt32  Index,
const UInt32  Length 
)
virtual

Removes rendered characters from this token.

Parameters
IndexThe index at which to start removing characters from this token.
LengthThe number of characters to try and remove from this token.
Returns
Returns the number of rendered characters that were actually removed.

Reimplemented from Mezzanine::UI::TextToken.

Definition at line 269 of file texttoken.cpp.


The documentation for this class was generated from the following files: