#include <tagmap.h>
Public Member Functions | |
virtual | ~TagMap () |
unsigned | insertTag (const char *tag) |
Inserts a new string of a tagname and returns the numeric value. | |
unsigned | insertTagWithOffset (const char *tag, unsigned start_offset, unsigned end_offset) |
Inserts a new string of a tagname and returns the numeric value. | |
void | print (OutputStream &dos) |
Prints mapping of (numeric values of) tagnames to their string values. | |
const char * | getTag (unsigned id) |
Returns string value for the entered (numeric value of a) tagname. | |
Static Public Member Functions | |
static TagMap * | getInstance () |
Returns instance of TagMap. | |
Private Member Functions | |
TagMap () | |
Constructor. | |
Private Attributes | |
vector< const char * > | tags |
StringHash | sh |
Static Private Attributes | |
static TagMap * | instance = NULL |
Instance of TagMap. |
Represents mapping of numeric values of tagnames to their string value, which takes therefore a string, e.g. <tagname></tagname>
or <tagname/>
, as arguments and returns the string value for a (numeric value of a) tagname.
SINGLETON PATTERN!
Definition at line 61 of file tagmap.h.
TagMap::~TagMap | ( | ) | [virtual] |
TagMap::TagMap | ( | ) | [private] |
Constructor.
Constructor - creating object.
Definition at line 50 of file tagmap.cpp.
References tags.
Referenced by getInstance().
static TagMap * TagMap::getInstance | ( | ) | [static] |
Returns instance of TagMap.
Returns instance of TagMap, i.e. of this object.
TagMap* | Pointer to a TagMap object. |
Definition at line 42 of file tagmap.cpp.
References instance, and TagMap().
Referenced by BufferNode::debugPrint(), Executor::finalDebugPrint(), ProjectionDFATransitions::print(), BufferNode::print(), BufferNode::printNoSubnodes(), and Executor::~Executor().
const char * TagMap::getTag | ( | unsigned | id | ) | [inline] |
Returns string value for the entered (numeric value of a) tagname.
Returns string value for the entered (numeric value of a) tagname.
[in] | id | Numeric value of a tagname. |
char* | Pointer to a char object. |
Definition at line 110 of file tagmap.h.
References tags.
Referenced by BufferNode::debugPrint(), NodeConstructExpression::eval(), ProjectionDFATransitions::print(), PathStepTagExpression::print(), NodeConstructExpression::print(), BufferNode::print(), and BufferNode::printNoSubnodes().
unsigned TagMap::insertTag | ( | const char * | tag | ) |
Inserts a new string of a tagname and returns the numeric value.
Inserts a new string of a tagname and returns the numeric value.
[in] | tag | Pointer to a char object (string of a tagname). |
unsigned | Numeric value for string value of a tagname. |
Definition at line 63 of file tagmap.cpp.
References StringHash::hash(), sh, and tags.
unsigned TagMap::insertTagWithOffset | ( | const char * | tag, | |
unsigned | start_offset, | |||
unsigned | end_offset | |||
) |
Inserts a new string of a tagname and returns the numeric value.
Inserts a new string of a tagname and returns the numeric value. Thereby the string is copied starting from position start
up to position end
.
[in] | tag | Pointer to a char object (string of a tagname). |
[in] | start_offset | The start offset (from the left). |
[in] | end_offset | The end offset (from the right). |
unsigned | Numeric value for string value of a tagname. |
Definition at line 76 of file tagmap.cpp.
References StringHash::hash(), sh, and tags.
Referenced by StreamTracker::processBachelorTag(), and StreamTracker::processOpeningTag().
void TagMap::print | ( | OutputStream & | dos | ) |
Prints mapping of (numeric values of) tagnames to their string values.
Prints mapping of (numeric values of) tagnames to their string values.
[in] | dos | Pointer to a OutputStream object. |
void |
Definition at line 94 of file tagmap.cpp.
Referenced by Executor::finalDebugPrint().
static TagMap * TagMap::instance = NULL [static, private] |
Instance of TagMap.
Instance of TagMap to avoid duplicate existence of this object.
Definition at line 117 of file tagmap.h.
Referenced by getInstance().
StringHash TagMap::sh [private] |
StringHash object to hash string values to avoid duplicate insertion.
Definition at line 134 of file tagmap.h.
Referenced by insertTag(), and insertTagWithOffset().
vector< const char * > TagMap::tags [private] |
The string values of all used tagnames.
Definition at line 128 of file tagmap.h.
Referenced by getTag(), insertTag(), insertTagWithOffset(), print(), TagMap(), and ~TagMap().