Spinning Topp Logo BlackTopp Studios
inc
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Mezzanine::UI::TokenString Class Reference

This is a helper class that facilitates operations with collections of tokens generated from Markup Parsers. More...

#include <texttoken.h>

+ Collaboration diagram for Mezzanine::UI::TokenString:

Public Types

typedef TokenContainer::const_reverse_iterator ConstReverseTokenIterator
 Const Reverse Iterator type for TextToken instances being stored by this class.
 
typedef TokenContainer::const_iterator ConstTokenIterator
 Const Iterator type for TextToken instances being stored by this class.
 
typedef TokenContainer::reverse_iterator ReverseTokenIterator
 Reverse Iterator type for TextToken instances being stored by this class.
 
typedef std::vector< TextToken * > TokenContainer
 Basic container type for the storage of TextToken instances by this class.
 
typedef std::pair< TokenIterator, UInt32TokenIndexPair
 An std::pair used to report the result of a TextToken and it's local index.
 
typedef TokenContainer::iterator TokenIterator
 Iterator type for TextToken instances being stored by this class.
 

Public Member Functions

 TokenString ()
 Class constructor.
 
virtual ~TokenString ()
 Class destructor.
 
TokenIterator BeginToken ()
 Gets an iterator to the first TextToken. More...
 
ConstTokenIterator BeginToken () const
 Gets a const iterator to the first TextToken. More...
 
virtual UInt32 ClearAllCharacters ()
 Removes all the rendered characters from this string. More...
 
virtual void DestroyAllTokens ()
 Destroys all tokens currently in this string.
 
TokenIterator EndToken ()
 Gets an iterator to one passed the last TextToken. More...
 
ConstTokenIterator EndToken () const
 Gets a const iterator to one passed the last TextToken. More...
 
Whole GetNumCharacters () const
 Gets the number of renderable characters that exist in this string. More...
 
Whole GetNumTokens () const
 Gets the number of text tokens in this string. More...
 
virtual String GetRawString () const
 Gets a string containing all the raw characters of the tokens in this string. More...
 
virtual UInt32 InsertCharacter (const UInt32 Index, UInt32 UChar)
 Inserts a single UTF-32 size character into this string. More...
 
virtual UInt32 InsertCharacters (const UInt32 Index, const Char8 *Characters, const UInt32 Size)
 Inserts multiple characters into this string. More...
 
virtual UInt32 InsertCharacters (const UInt32 Index, const UInt32 *Characters, const UInt32 Size)
 Inserts multiple characters into this string. More...
 
virtual void PushToken (TextToken *ToBePushed)
 Appends a new token to the end of this string. More...
 
virtual void PushTokens (const TokenContainer &ToBePushed)
 Appends a group of tokens to the end of this string. More...
 
virtual UInt32 RemoveCharacter (const UInt32 Index)
 Removes a single rendered character from this string. More...
 
virtual UInt32 RemoveCharacters (const UInt32 Index, const UInt32 Length)
 Removes rendered characters from this string. More...
 
ReverseTokenIterator ReverseBeginToken ()
 Gets a reverse iterator to the last TextToken. More...
 
ConstReverseTokenIterator ReverseBeginToken () const
 Gets a const reverse iterator to the last TextToken. More...
 
ReverseTokenIterator ReverseEndToken ()
 Gets a reverse iterator to one before the first TextToken. More...
 
ConstReverseTokenIterator ReverseEndToken () const
 Gets a const reverse iterator to one before the first TextToken. More...
 

Protected Member Functions

TokenIndexPair GetTokenIndex (const UInt32 Index)
 Gets the token at the string index, and it's local index. More...
 

Protected Attributes

TokenContainer Tokens
 Container for TextToken storage. More...
 

Detailed Description

This is a helper class that facilitates operations with collections of tokens generated from Markup Parsers.

Definition at line 282 of file texttoken.h.

Member Function Documentation

TokenString::TokenIterator Mezzanine::UI::TokenString::BeginToken ( )

Gets an iterator to the first TextToken.

Returns
Returns an iterator to the first TextToken being stored by this TokenString.

Definition at line 457 of file texttoken.cpp.

TokenString::ConstTokenIterator Mezzanine::UI::TokenString::BeginToken ( ) const

Gets a const iterator to the first TextToken.

Returns
Returns a const iterator to the first TextToken being stored by this TokenString.

Definition at line 463 of file texttoken.cpp.

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

Removes all the rendered characters from this string.

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

Definition at line 564 of file texttoken.cpp.

TokenString::TokenIterator Mezzanine::UI::TokenString::EndToken ( )

Gets an iterator to one passed the last TextToken.

Returns
Returns an iterator to one passed the last TextToken being stored by this TokenString.

Definition at line 460 of file texttoken.cpp.

TokenString::ConstTokenIterator Mezzanine::UI::TokenString::EndToken ( ) const

Gets a const iterator to one passed the last TextToken.

Returns
Returns a const iterator to one passed the last TextToken being stored by this TokenString.

Definition at line 466 of file texttoken.cpp.

Whole Mezzanine::UI::TokenString::GetNumCharacters ( ) const

Gets the number of renderable characters that exist in this string.

Returns
Returns a Whole containing the number of renderable characters this TokenString is storing.

Definition at line 442 of file texttoken.cpp.

Whole Mezzanine::UI::TokenString::GetNumTokens ( ) const

Gets the number of text tokens in this string.

Returns
Returns a Whole containing the number of tokens this TokenString is storing.

Definition at line 452 of file texttoken.cpp.

String Mezzanine::UI::TokenString::GetRawString ( ) const
virtual

Gets a string containing all the raw characters of the tokens in this string.

Returns
Returns a string of all the UTF-8 characters in the tokens of this string.

Definition at line 432 of file texttoken.cpp.

TokenString::TokenIndexPair Mezzanine::UI::TokenString::GetTokenIndex ( const UInt32  Index)
protected

Gets the token at the string index, and it's local index.

Parameters
IndexThe TokenString index of the character to retrieve.
Returns
Returns an std::pair containing an iterator to the token at the specified index in the first member, and it's local index in the second member

Definition at line 402 of file texttoken.cpp.

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

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

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.

Definition at line 502 of file texttoken.cpp.

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

Inserts multiple characters into this string.

Parameters
IndexThe index at which the characters will be inserted.
CharactersAn array of Char8's encoded in UTF-8 to be inserted.
SizeThe size of the array of Char8's passed in.
Returns
Returns the number of characters successfully inserted.

Definition at line 516 of file texttoken.cpp.

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

Inserts multiple characters into this string.

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.

Definition at line 530 of file texttoken.cpp.

void Mezzanine::UI::TokenString::PushToken ( TextToken ToBePushed)
virtual

Appends a new token to the end of this string.

Note
Tokens appended to this string will become owned by this string and deleted when this string is destructed.
Parameters
ToBePushedThe token being added to this string.

Definition at line 484 of file texttoken.cpp.

void Mezzanine::UI::TokenString::PushTokens ( const TokenContainer ToBePushed)
virtual

Appends a group of tokens to the end of this string.

Note
Tokens appended to this string will become owned by this string and deleted when this string is destructed.
Parameters
ToBePushedA container

Definition at line 487 of file texttoken.cpp.

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

Removes a single rendered character from this string.

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

Definition at line 544 of file texttoken.cpp.

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

Removes rendered characters from this string.

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

Definition at line 550 of file texttoken.cpp.

TokenString::ReverseTokenIterator Mezzanine::UI::TokenString::ReverseBeginToken ( )

Gets a reverse iterator to the last TextToken.

Returns
Returns a reverse iterator to the last TextToken being stored by this TokenString.

Definition at line 469 of file texttoken.cpp.

TokenString::ConstReverseTokenIterator Mezzanine::UI::TokenString::ReverseBeginToken ( ) const

Gets a const reverse iterator to the last TextToken.

Returns
Returns a const reverse iterator to the last TextToken being stored by this TokenString.

Definition at line 475 of file texttoken.cpp.

TokenString::ReverseTokenIterator Mezzanine::UI::TokenString::ReverseEndToken ( )

Gets a reverse iterator to one before the first TextToken.

Returns
Returns a reverse iterator to one before the first TextToken being stored by this TokenString.

Definition at line 472 of file texttoken.cpp.

TokenString::ConstReverseTokenIterator Mezzanine::UI::TokenString::ReverseEndToken ( ) const

Gets a const reverse iterator to one before the first TextToken.

Returns
Returns a const reverse iterator to one before the first TextToken being stored by this TokenString.

Definition at line 478 of file texttoken.cpp.

Member Data Documentation

TokenContainer Mezzanine::UI::TokenString::Tokens
protected

Container for TextToken storage.

Definition at line 300 of file texttoken.h.


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