Defined in file: hzDocument.h

The hzAttrset class is really an convenient attribute iterator. The tag attributes are stored in the host document in a one-to-many map between tag uids and attribute, rather than in a list held by the host tag. Given this arrangement, iteration of tag attributes would normally require a first and a last position within the map, as well as another variable to iterate between the two. In previous version of the HadronZoo library, each tag had an attribute pointer and each attribute had a next pointer. Attributes could be iterated by control loops of the form:- for (attr = first_attr ; attr ; attr = attr->next) {} The objective of the attribute iterator is to achieve a similar interface. The hzAttrset is initialized to a tag (node) which in turn points to the host document. The initialization does a lookup in the document map and the Valid() method returns true if there is an attribute. The Advance() method moves on to the next attribut in the tag so:- for (attrset = node ; attrset.Valid() ; attrset.Advance()) {}

Constructors/Detructors

hzAttrset*hzAttrset(hzAttrset&)
hzAttrset*hzAttrset(void)m_pHostNode = 0 ;
void~hzAttrset(void)

Public Methods:

voidAdvance(void)Advance the iterator
const char*Name(void)Return the attribute name
boolNameEQ(const char* cstr)Confirm or deny that the current attribute name equals the supplied null terminated string
boolValEQ(const char* cstr)Confirm or deny that the current attribute value equals the supplied null terminated string
boolValid(void)
const char*Value(void)Return the attribute name

Overloaded operators:

hzAttrset&operator=(hzAttrset&)
hzAttrset&operator=(hzXmlNode* pNode)
hzAttrset&operator=(hzHtmElem* pNode)

Member Variables:

int32_tm_CurrentCurrent attribute for the tag in the map
int32_tm_FinalLast attribute for the tag in the document 1:many map of tag ids to attrs
uint32_tm_NodeUidNode Uid (key to node/attr map)
hzPairm_PairName/value pair
int32_tm_StartFirst attribute for the tag in the document 1:many map of tag ids to attrs
hzDocument*m_pHostDocThis is needed for the node's uid and the document hosting the map