This is a base class for tags that implement the functionality of a markup language. More...
#include <markupparser.h>
Public Types | |
typedef std::list< Character * > | CharacterContainer |
Basic container type for the storage of Character instances by this class. | |
typedef CharacterContainer::iterator | CharacterIterator |
Iterator type for Character instances stored by this class. | |
typedef CharacterContainer::const_iterator | ConstCharacterIterator |
Const Iterator type for Character instances stored by this class. | |
typedef std::pair< Boole, Character * > | ProcessResult |
An std::pair used to report the result of a MarkupTag being processed any the character it may have generated. | |
Public Member Functions | |
MarkupTag () | |
Class constructor. | |
virtual | ~MarkupTag () |
Class destructor. | |
virtual const String & | GetName () const =0 |
Gets the name of this tag. More... | |
virtual Boole | IsRangeTag () const =0 |
Gets whether or not this tag applies to a range of characters. More... | |
virtual ProcessResult | Process (NameValuePairMap &Params, CharacterTraits &Traits, TextLayer *Layer) const =0 |
Processes this tag. More... | |
This is a base class for tags that implement the functionality of a markup language.
When creating markup tags it is important to understand the disinction between range tags and non-range tags. Range tags render nothing themselves and instead alter all the characters between both ends of the tag. Non-range tags can create characters of their own to be inserted, however when doing so it should be limited to creating only one per processing of a tag. This helps to make specific configurations easier to implement for the end user, as well as simplify the logic used when editing strings and tokens handled by text layers.
Definition at line 66 of file markupparser.h.
|
pure virtual |
Gets the name of this tag.
Implemented in Mezzanine::UI::DefaultSpriteTag, Mezzanine::UI::DefaultFontTag, and Mezzanine::UI::DefaultColourTag.
|
pure virtual |
Gets whether or not this tag applies to a range of characters.
Implemented in Mezzanine::UI::DefaultSpriteTag, Mezzanine::UI::DefaultFontTag, and Mezzanine::UI::DefaultColourTag.
|
pure virtual |
Processes this tag.
Params | A NameValuePairMap of all the parameters provided for this tag. |
Traits | The character traits to be modified and used for future character construction. |
Layer | A pointer to the TextLayer currently being parsed. |
Implemented in Mezzanine::UI::DefaultSpriteTag, Mezzanine::UI::DefaultFontTag, and Mezzanine::UI::DefaultColourTag.