Mana
Loading...
Searching...
No Matches
Classes | Public Member Functions | Private Member Functions | Private Attributes | List of all members
XML::Node Class Reference

#include <xml.h>

Classes

class  Children
 Helper class to iterate over the children of a node. More...
 

Public Member Functions

 Node (xmlNodePtr node=nullptr)
 
 operator bool () const
 
std::string_view name () const
 
std::string_view textContent () const
 
template<typename T >
bool attribute (const char *name, T &value) const
 
bool hasAttribute (const char *name) const
 
int getProperty (const char *name, int def) const
 
double getFloatProperty (const char *name, double def) const
 
std::string getProperty (const char *name, const std::string &def) const
 
bool getBoolProperty (const char *name, bool def) const
 
Node findFirstChildByName (const char *name) const
 
Children children () const
 

Private Member Functions

const char * attribute (const char *name) const
 

Private Attributes

xmlNodePtr node
 

Detailed Description

Definition at line 37 of file xml.h.

Constructor & Destructor Documentation

◆ Node()

XML::Node::Node ( xmlNodePtr  node = nullptr)
inline

Definition at line 40 of file xml.h.

Member Function Documentation

◆ attribute() [1/2]

const char * XML::Node::attribute ( const char *  name) const
inlineprivate

Definition at line 112 of file xml.h.

◆ attribute() [2/2]

template<typename T >
bool XML::Node::attribute ( const char *  name,
T &  value 
) const
inline

Definition at line 129 of file xml.h.

◆ children()

Children XML::Node::children ( ) const
inline

Definition at line 97 of file xml.h.

◆ findFirstChildByName()

Node XML::Node::findFirstChildByName ( const char *  name) const
inline

Definition at line 176 of file xml.h.

◆ getBoolProperty()

bool XML::Node::getBoolProperty ( const char *  name,
bool  def 
) const
inline

Definition at line 168 of file xml.h.

◆ getFloatProperty()

double XML::Node::getFloatProperty ( const char *  name,
double  def 
) const
inline

Definition at line 152 of file xml.h.

◆ getProperty() [1/2]

std::string XML::Node::getProperty ( const char *  name,
const std::string &  def 
) const
inline

Definition at line 160 of file xml.h.

◆ getProperty() [2/2]

int XML::Node::getProperty ( const char *  name,
int  def 
) const
inline

Definition at line 144 of file xml.h.

◆ hasAttribute()

bool XML::Node::hasAttribute ( const char *  name) const
inline

Definition at line 139 of file xml.h.

◆ name()

std::string_view XML::Node::name ( ) const
inline

Definition at line 46 of file xml.h.

◆ operator bool()

XML::Node::operator bool ( ) const
inline

Definition at line 44 of file xml.h.

◆ textContent()

std::string_view XML::Node::textContent ( ) const
inline

Definition at line 105 of file xml.h.

Member Data Documentation

◆ node

xmlNodePtr XML::Node::node
private

Definition at line 102 of file xml.h.


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