MezzanineEngine 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | List of all members
Mezzanine::UI::MarkupTag Class Referenceabstract

This is a base class for tags that implement the functionality of a markup language. More...

#include <markupparser.h>

+ Inheritance diagram for Mezzanine::UI::MarkupTag:

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< Boolean,
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 StringGetName () const =0
 Gets the name of this tag. More...
 
virtual Boolean 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...
 

Detailed Description

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.

Member Function Documentation

virtual const String& Mezzanine::UI::MarkupTag::GetName ( ) const
pure virtual

Gets the name of this tag.

Returns
Returns a String containing the name of this tag.

Implemented in Mezzanine::UI::DefaultSpriteTag, Mezzanine::UI::DefaultFontTag, and Mezzanine::UI::DefaultColourTag.

virtual Boolean Mezzanine::UI::MarkupTag::IsRangeTag ( ) const
pure virtual

Gets whether or not this tag applies to a range of characters.

Returns
Returns true if this tag requires a closing tag to accompany to be valid, false otherwise.

Implemented in Mezzanine::UI::DefaultSpriteTag, Mezzanine::UI::DefaultFontTag, and Mezzanine::UI::DefaultColourTag.

virtual ProcessResult Mezzanine::UI::MarkupTag::Process ( NameValuePairMap Params,
CharacterTraits Traits,
TextLayer Layer 
) const
pure virtual

Processes this tag.

Parameters
ParamsA NameValuePairMap of all the parameters provided for this tag.
TraitsThe character traits to be modified and used for future character construction.
LayerA pointer to the TextLayer currently being parsed.
Returns
Returns a process result where the first value is true if this tag succeeded in making it's alterations and the second value contains a pointer to a generated character if one was generated. The second value can be NULL.

Implemented in Mezzanine::UI::DefaultSpriteTag, Mezzanine::UI::DefaultFontTag, and Mezzanine::UI::DefaultColourTag.


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