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

Parser for an XML end tag. More...

#include <XmlEndTag.h>

Inheritance diagram for Util::XmlEndTag:
Util::XmlBase

Public Member Functions

 XmlEndTag ()
 Constructor. More...
 
 ~XmlEndTag ()
 Destructor. More...
 
bool match (const std::string &string, int begin)
 Attempt to match any end tag. More...
 
void match (const std::string expected, const std::string &string, int begin)
 Match a required end tag. More...
 
const std::string label ()
 Label string. 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 end tag.

Definition at line 24 of file XmlEndTag.h.

Constructor & Destructor Documentation

◆ XmlEndTag()

Util::XmlEndTag::XmlEndTag ( )

Constructor.

Definition at line 14 of file XmlEndTag.cpp.

◆ ~XmlEndTag()

Util::XmlEndTag::~XmlEndTag ( )

Destructor.

Definition at line 17 of file XmlEndTag.cpp.

Member Function Documentation

◆ match() [1/2]

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

Attempt to match any end tag.

Return true if end tag found, false otherwise.

Parameters
stringcontaining text of XML tag
beginindex of first character

Definition at line 20 of file XmlEndTag.cpp.

References Util::XmlBase::c(), Util::XmlBase::cursor(), Util::XmlBase::isEnd(), Util::XmlBase::next(), Util::XmlBase::setString(), Util::XmlBase::skip(), and Util::XmlBase::string().

Referenced by match().

◆ match() [2/2]

void Util::XmlEndTag::match ( const std::string  expected,
const std::string &  string,
int  begin 
)

Match a required end tag.

Throw exception is specified end tag does not match.

Parameters
expectedexpected label string
stringcontaining text of XML tag
beginindex of first character

Definition at line 65 of file XmlEndTag.cpp.

References Util::Log::file(), label(), match(), and UTIL_THROW.

◆ label()

const std::string Util::XmlEndTag::label ( )
inline

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