openMSX
Classes | Public Member Functions | Static Public Member Functions | Friends | List of all members
openmsx::XMLElement Class Reference

#include <XMLElement.hh>

Public Member Functions

 XMLElement (const char *name_)
 
 XMLElement (const char *name_, const char *data_)
 
std::string_view getName () const
 
void clearName ()
 
std::string_view getData () const
 
XMLElementsetData (const char *data_)
 
bool hasChildren () const
 
const XMLElementgetFirstChild () const
 
const XMLElementfindChild (std::string_view childName) const
 
const XMLElementfindChild (std::string_view childName, const XMLElement *&hint) const
 
const XMLElementgetChild (std::string_view childName) const
 
std::string_view getChildData (std::string_view childName) const
 
std::string_view getChildData (std::string_view childName, std::string_view defaultValue) const
 
bool getChildDataAsBool (std::string_view childName, bool defaultValue) const
 
int getChildDataAsInt (std::string_view childName, int defaultValue) const
 
size_t numChildren () const
 
ChildRange getChildren () const
 
NamedChildRange getChildren (std::string_view childName) const
 
const XMLAttributefindAttribute (std::string_view attrName) const
 
const XMLAttributegetAttribute (std::string_view attrName) const
 
std::string_view getAttributeValue (std::string_view attrName) const
 
std::string_view getAttributeValue (std::string_view attrName, std::string_view defaultValue) const
 
bool getAttributeValueAsBool (std::string_view attrName, bool defaultValue) const
 
int getAttributeValueAsInt (std::string_view attrName, int defaultValue) const
 
XMLAttribute ** findAttributePointer (std::string_view attrName)
 
size_t numAttributes () const
 
AttributeRange getAttributes () const
 
XMLElementsetFirstChild (XMLElement *child)
 
XMLElementsetNextSibling (XMLElement *sibling)
 
XMLAttributesetFirstAttribute (XMLAttribute *attribute)
 

Static Public Member Functions

static void removeAttribute (XMLAttribute **attrPtr)
 

Friends

class XMLDocument
 
class XMLDocumentHandler
 

Detailed Description

Definition at line 90 of file XMLElement.hh.

Constructor & Destructor Documentation

◆ XMLElement() [1/2]

openmsx::XMLElement::XMLElement ( const char *  name_)
inline

Definition at line 167 of file XMLElement.hh.

◆ XMLElement() [2/2]

openmsx::XMLElement::XMLElement ( const char *  name_,
const char *  data_ 
)
inline

Definition at line 168 of file XMLElement.hh.

Member Function Documentation

◆ clearName()

void openmsx::XMLElement::clearName ( )
inline

Definition at line 171 of file XMLElement.hh.

Referenced by openmsx::XmlInputArchive::endTag().

◆ findAttribute()

const XMLAttribute * openmsx::XMLElement::findAttribute ( std::string_view  attrName) const

◆ findAttributePointer()

XMLAttribute ** openmsx::XMLElement::findAttributePointer ( std::string_view  attrName)

Definition at line 145 of file XMLElement.cc.

◆ findChild() [1/2]

const XMLElement * openmsx::XMLElement::findChild ( std::string_view  childName) const

◆ findChild() [2/2]

const XMLElement * openmsx::XMLElement::findChild ( std::string_view  childName,
const XMLElement *&  hint 
) const

Definition at line 35 of file XMLElement.cc.

◆ getAttribute()

const XMLAttribute & openmsx::XMLElement::getAttribute ( std::string_view  attrName) const

Definition at line 106 of file XMLElement.cc.

References findAttribute().

Referenced by getAttributeValue().

◆ getAttributes()

AttributeRange openmsx::XMLElement::getAttributes ( ) const
inline

Definition at line 209 of file XMLElement.hh.

Referenced by numAttributes().

◆ getAttributeValue() [1/2]

std::string_view openmsx::XMLElement::getAttributeValue ( std::string_view  attrName) const

◆ getAttributeValue() [2/2]

std::string_view openmsx::XMLElement::getAttributeValue ( std::string_view  attrName,
std::string_view  defaultValue 
) const

Definition at line 119 of file XMLElement.cc.

References findAttribute().

◆ getAttributeValueAsBool()

bool openmsx::XMLElement::getAttributeValueAsBool ( std::string_view  attrName,
bool  defaultValue 
) const

Definition at line 127 of file XMLElement.cc.

References findAttribute(), and StringOp::stringToBool().

◆ getAttributeValueAsInt()

int openmsx::XMLElement::getAttributeValueAsInt ( std::string_view  attrName,
int  defaultValue 
) const

Definition at line 134 of file XMLElement.cc.

References findAttribute().

Referenced by openmsx::DeviceConfig::getAttributeValueAsInt().

◆ getChild()

const XMLElement & openmsx::XMLElement::getChild ( std::string_view  childName) const

◆ getChildData() [1/2]

std::string_view openmsx::XMLElement::getChildData ( std::string_view  childName) const

◆ getChildData() [2/2]

std::string_view openmsx::XMLElement::getChildData ( std::string_view  childName,
std::string_view  defaultValue 
) const

Definition at line 68 of file XMLElement.cc.

References findChild().

◆ getChildDataAsBool()

bool openmsx::XMLElement::getChildDataAsBool ( std::string_view  childName,
bool  defaultValue 
) const

Definition at line 75 of file XMLElement.cc.

References findChild(), and StringOp::stringToBool().

Referenced by openmsx::DeviceConfig::getChildDataAsBool().

◆ getChildDataAsInt()

int openmsx::XMLElement::getChildDataAsInt ( std::string_view  childName,
int  defaultValue 
) const

Definition at line 81 of file XMLElement.cc.

References findChild().

Referenced by openmsx::DeviceConfig::getChildDataAsInt().

◆ getChildren() [1/2]

ChildRange openmsx::XMLElement::getChildren ( ) const
inline

◆ getChildren() [2/2]

NamedChildRange openmsx::XMLElement::getChildren ( std::string_view  childName) const
inline

Definition at line 195 of file XMLElement.hh.

◆ getData()

std::string_view openmsx::XMLElement::getData ( ) const
inline

◆ getFirstChild()

const XMLElement * openmsx::XMLElement::getFirstChild ( ) const
inline

Definition at line 182 of file XMLElement.hh.

Referenced by openmsx::XMLDocument::serialize().

◆ getName()

std::string_view openmsx::XMLElement::getName ( ) const
inline

Definition at line 170 of file XMLElement.hh.

Referenced by openmsx::DeviceFactory::create().

◆ hasChildren()

bool openmsx::XMLElement::hasChildren ( ) const
inline

Definition at line 181 of file XMLElement.hh.

◆ numAttributes()

size_t openmsx::XMLElement::numAttributes ( ) const

Definition at line 162 of file XMLElement.cc.

References begin(), end(), and getAttributes().

◆ numChildren()

size_t openmsx::XMLElement::numChildren ( ) const

Definition at line 89 of file XMLElement.cc.

References begin(), end(), and getChildren().

◆ removeAttribute()

void openmsx::XMLElement::removeAttribute ( XMLAttribute **  attrPtr)
static

Definition at line 156 of file XMLElement.cc.

◆ setData()

XMLElement * openmsx::XMLElement::setData ( const char *  data_)
inline

Definition at line 176 of file XMLElement.hh.

Referenced by openmsx::HardwareConfig::createRomConfig().

◆ setFirstAttribute()

XMLAttribute * openmsx::XMLElement::setFirstAttribute ( XMLAttribute attribute)
inline

Definition at line 221 of file XMLElement.hh.

◆ setFirstChild()

XMLElement * openmsx::XMLElement::setFirstChild ( XMLElement child)
inline

Definition at line 211 of file XMLElement.hh.

Referenced by openmsx::CassettePlayer::CassettePlayer().

◆ setNextSibling()

XMLElement * openmsx::XMLElement::setNextSibling ( XMLElement sibling)
inline

Definition at line 216 of file XMLElement.hh.

Friends And Related Symbol Documentation

◆ XMLDocument

friend class XMLDocument
friend

Definition at line 234 of file XMLElement.hh.

◆ XMLDocumentHandler

friend class XMLDocumentHandler
friend

Definition at line 235 of file XMLElement.hh.


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