| evio
    5.3
    | 
This class parses XML dictionary string and contains maps for looking up dictionary information. More...
#include <evioDictionary.hxx>
| Public Member Functions | |
| evioDictionary () | |
| No-arg constructor contains empty maps.  More... | |
| evioDictionary (const string &dictXML, const string &sep=".") | |
| Constructor fills dictionary maps from string.  More... | |
| evioDictionary (ifstream &dictIFS, const string &sep=".") | |
| Constructor fills dictionary maps from ifstream.  More... | |
| virtual | ~evioDictionary () | 
| Destructor.  More... | |
| bool | parseDictionary (const string &dictionaryXML) | 
| Uses Expat to parse XML dictionary string and fill maps.  More... | |
| evioDictEntry | getEntry (const string &name) const | 
| Gets the dictionary entry (evioDictEntry) for a given name.  More... | |
| string | getName (evioDictEntry &entry) const | 
| Gets the name associated with an evioDictEntry.  More... | |
| string | getName (uint16_t tag, uint8_t num, uint16_t tagEnd=0, bool haveParent=false, uint16_t parentTag=0, uint8_t parentNum=0, uint16_t parentTagEnd=0) const | 
| Gets the name associated with an evioDictEntry which has the given tag, num, tagEnd, and parent tag, num, and tagEnd values.  More... | |
| string | getDictionaryXML () const | 
| Gets dictionary XML.  More... | |
| void | setSeparator (const string &sep) | 
| Sets separator character.  More... | |
| string | getSeparator () const | 
| Gets separator character.  More... | |
| string | toString () const | 
| Converts dictionary into string.  More... | |
| Static Public Member Functions | |
| static void | startElementHandler (void *userData, const char *xmlname, const char **atts) | 
| Expat start element handler, must be static.  More... | |
| static void | endElementHandler (void *userData, const char *xmlname) | 
| Expat end element handler, must be static.  More... | |
| static void | charDataHandler (void *userData, const char *s, int len) | 
| Expat start character data handler, must be static.  More... | |
| Public Attributes | |
| map< evioDictEntry, string > | getNameMap | 
| This is the heart of the dictionary in which a key is composed of a tag/num pair and other entry data and its corresponding value is a name.  More... | |
| map< string, evioDictEntry > | getTagNumMap | 
| This is a map in which the key is a name and the value is its corresponding dictionary entry.  More... | |
This class parses XML dictionary string and contains maps for looking up dictionary information.
| evioDictionary::evioDictionary | ( | ) | 
No-arg constructor contains empty maps.
| 
 | explicit | 
Constructor fills dictionary maps from string.
| dictionaryXML | XML string parsed to create dictionary maps | 
References parseDictionary().
| 
 | explicit | 
Constructor fills dictionary maps from ifstream.
| dictionaryXML | XML string parsed to create dictionary maps | 
References parseDictionary().
| 
 | virtual | 
Destructor.
| 
 | static | 
Expat start character data handler, must be static.
| userData | void* pointer to evioDictionary instance | 
| s | character data string which is NOT zero terminated! | 
| len | number of valid characters returned at pointer | 
References evio::evioDictEntry::getEntryType(), evio::TAG_NUM, evio::TAG_ONLY, and evio::TAG_RANGE.
Referenced by parseDictionary().
| 
 | static | 
Expat end element handler, must be static.
| userData | void* pointer to evioDictionary instance | 
| xmlname | Name of current element | 
References evio::dictEntryTag, and evio::oldDictEntryTag.
Referenced by parseDictionary().
| string evioDictionary::getDictionaryXML | ( | ) | const | 
Gets dictionary XML.
Referenced by evio::evioBufferChannel::open(), evio::evioFileChannel::open(), and evio::evioSocketChannel::open().
| evioDictEntry evioDictionary::getEntry | ( | const string & | name | ) | const | 
Gets the dictionary entry (evioDictEntry) for a given name.
| name | name of dictionary entry | 
| evioException | if entry not found | 
References getTagNumMap.
Referenced by evio::evioDOMTree::addBank(), evio::evioDOMNode::createEvioDOMNode(), evio::evioDOMNode::createUnknownEvioDOMNode(), evio::evioDOMNode::evioDOMNode(), and evio::evioDOMTree::evioDOMTree().
| string evioDictionary::getName | ( | evioDictEntry & | entry | ) | const | 
Gets the name associated with an evioDictEntry.
| entry | dictionary entry | 
| evioException | if entry not found | 
References getNameMap, evio::evioDictEntry::getNum(), evio::evioDictEntry::getTag(), and evio::evioDictEntry::getTagEnd().
| string evioDictionary::getName | ( | uint16_t | tag, | 
| uint8_t | num, | ||
| uint16_t | tagEnd = 0, | ||
| bool | haveParent = false, | ||
| uint16_t | parentTag = 0, | ||
| uint8_t | parentNum = 0, | ||
| uint16_t | parentTagEnd = 0 | ||
| ) | const | 
Gets the name associated with an evioDictEntry which has the given tag, num, tagEnd, and parent tag, num, and tagEnd values.
| tag | dictionary entry's tag value. | 
| num | dictionary entry's num value. | 
| tagEnd | dictionary entry's tagEnd value (ending value of a range of tags and > tag). Defaults to 0. | 
| haveParent | true if entry has a parent entry, else false. Defaults to false. | 
| parentTag | parent entry's tag value. Defaults to 0. | 
| parentNum | parent entry's num value. Defaults to 0. | 
| parentTagEnd | parent entry's tagEnd value. Defaults to 0. | 
| evioException | if entry not found | 
References evio::EVIO_UNKNOWN32, evio::evioDictEntry::getEntryType(), evio::evioDictEntry::inRange(), evio::TAG_NUM, evio::TAG_ONLY, and evio::TAG_RANGE.
| string evioDictionary::getSeparator | ( | ) | const | 
Gets separator character.
| bool evioDictionary::parseDictionary | ( | const string & | dictionaryXML | ) | 
Uses Expat to parse XML dictionary string and fill maps.
| dictionaryXML | XML string | 
References charDataHandler(), endElementHandler(), and startElementHandler().
Referenced by evioDictionary().
| void evioDictionary::setSeparator | ( | const string & | sep | ) | 
Sets separator character.
| sep | Separator character | 
| 
 | static | 
Expat start element handler, must be static.
| userData | void* pointer to evioDictionary instance | 
| xmlname | Name of current element | 
| atts | Array of attributes for this element | 
References evio::dictEntryTag, evio::EVIO_UNKNOWN32, evio::evioDictEntry::getDataType(), evio::evioDictEntry::getEntryType(), evio::oldDictEntryTag, evio::TAG_NUM, evio::TAG_ONLY, and evio::TAG_RANGE.
Referenced by parseDictionary().
| string evioDictionary::toString | ( | ) | const | 
Converts dictionary into string.
References evio::evioDictEntry::getDescription(), evio::evioDictEntry::getFormat(), evio::evioDictEntry::getNum(), evio::evioDictEntry::getTag(), and getTagNumMap.
| map<evioDictEntry, string> evio::evioDictionary::getNameMap | 
This is the heart of the dictionary in which a key is composed of a tag/num pair and other entry data and its corresponding value is a name.
This map contains all entries whether tag/num, tag-only, or tag-range. Gets node name given tag/num.
Referenced by evio::evioDOMContainerNode::getFooter(), evio::evioDOMContainerNode::getHeader(), and getName().
| map<string, evioDictEntry> evio::evioDictionary::getTagNumMap | 
This is a map in which the key is a name and the value is its corresponding dictionary entry.
It's the reverse of the getNameMap map. This map contains all entries whether tag/num, tag-only, or tag-range. Gets tag/num given node name.
Referenced by getEntry(), evio::evioDOMTree::getNodeList(), and toString().