PSCF v1.1
Public Member Functions | List of all members
Util::XmlAttribute Class Reference

Parser for an XML attribute. More...

#include <XmlAttribute.h>

Inheritance diagram for Util::XmlAttribute:
Util::XmlBase

Public Member Functions

 XmlAttribute ()
 Constructor. More...
 
virtual ~XmlAttribute ()
 Destructor. More...
 
bool match (const std::string &string, int begin)
 Return true if an attribute is found, false otherwise. More...
 
bool match (XmlBase &parser)
 If successful return true and advance cursor or parent parser. More...
 
const std::string & label ()
 Return label string. More...
 
std::stringstream & value ()
 Return value string, without quotes. More...
 
- Public Member Functions inherited from Util::XmlBase
 XmlBase ()
 Constructor. More...
 
 ~XmlBase ()
 Destructor. More...
 
void setString (const std::string &string, int cursor=0)
 Initialize string and cursor. More...
 
void setCursor (int cursor)
 Set cursor. More...
 
void skip ()
 Skip leading white space, if any. More...
 
void next ()
 Advance to the next character. More...
 
const std::string & string () const
 Return the associated string. More...
 
int cursor () const
 Return the index of the current character. More...
 
int c () const
 Return the current character. More...
 
bool isEnd () const
 Has the cursor reached the end of the string? More...
 

Detailed Description

Parser for an XML attribute.

Definition at line 23 of file XmlAttribute.h.

Constructor & Destructor Documentation

◆ XmlAttribute()

Util::XmlAttribute::XmlAttribute ( )

Constructor.

Definition at line 14 of file XmlAttribute.cpp.

◆ ~XmlAttribute()

Util::XmlAttribute::~XmlAttribute ( )
virtual

Destructor.

Definition at line 23 of file XmlAttribute.cpp.

Member Function Documentation

◆ match() [1/2]

bool Util::XmlAttribute::match ( const std::string &  string,
int  begin 
)

◆ match() [2/2]

bool Util::XmlAttribute::match ( XmlBase parser)

If successful return true and advance cursor or parent parser.

Parameters
parserparent parser object

Definition at line 82 of file XmlAttribute.cpp.

References Util::XmlBase::cursor(), match(), Util::XmlBase::setCursor(), and Util::XmlBase::string().

◆ label()

const std::string & Util::XmlAttribute::label ( )
inline

◆ value()

std::stringstream & Util::XmlAttribute::value ( )
inline

Return value string, without quotes.

Definition at line 59 of file XmlAttribute.h.


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