LHEF
3.0(beta)
|
The XMLTag struct is used to represent all information within an XML tag. More...
#include <LHEF.h>
Public Types | |
typedef std::string::size_type | pos_t |
Convenient typdef. | |
typedef std::map< std::string, std::string > | AttributeMap |
Convenient typdef. | |
Public Member Functions | |
XMLTag () | |
Default constructor. | |
~XMLTag () | |
The destructor also destroys any sub-tags. | |
bool | getattr (std::string n, double &v) const |
Find an attribute named n and set the double variable v to the corresponding value. | |
bool | getattr (std::string n, bool &v) const |
Find an attribute named n and set the bool variable v to true if the corresponding value is "yes". | |
bool | getattr (std::string n, long &v) const |
Find an attribute named n and set the long variable v to the corresponding value. | |
bool | getattr (std::string n, int &v) const |
Find an attribute named n and set the long variable v to the corresponding value. | |
bool | getattr (std::string n, std::string &v) const |
Find an attribute named n and set the string variable v to the corresponding value. | |
void | print (std::ostream &os) const |
Print out this tag to a stream. | |
Static Public Member Functions | |
static std::vector< XMLTag * > | findXMLTags (std::string str, std::string *leftover=0) |
Scan the given string and return all XML tags found as a vector of pointers to XMLTag objects. | |
static void | deleteAll (std::vector< XMLTag * > &tags) |
Delete all tags in a vector. | |
Public Attributes | |
std::string | name |
The name of this tag. | |
AttributeMap | attr |
The attributes of this tag. | |
std::vector< XMLTag * > | tags |
A vector of sub-tags. | |
std::string | contents |
The contents of this tag. | |
Static Public Attributes | |
static const pos_t | end = std::string::npos |
Convenient alias for npos. | |
The XMLTag struct is used to represent all information within an XML tag.
It contains the attributes as a map, any sub-tags as a vector of pointers to other XMLTag objects, and any other information as a single string.
|
inlinestatic |
Scan the given string and return all XML tags found as a vector of pointers to XMLTag objects.
Text which does not belong to any tag is stored in tags without name and in the string pointed to by leftover (if not null).
Definition at line 188 of file LHEF.h.
References end, name, tags, and XMLTag().
Referenced by LHEF::Reader::init(), and LHEF::Reader::readEvent().
|
inline |
Find an attribute named n and set the double variable v to the corresponding value.
Definition at line 130 of file LHEF.h.
References attr.
Referenced by LHEF::Cut::Cut().
|
inline |
|
inline |
|
inline |
|
inline |