载入中...
搜索中...
未找到
eve::xml::Element类 参考

#include <Xml.h>

Public 成员函数

 Element ()=default
 
 operator bool () const
 
bool operator== (const Element &other) const
 
bool operator!= (const Element &other) const
 
std::string tagName () const
 
Element parent () const
 
bool hasAttribute (const char *name) const
 
std::string getAttribute (const char *name, const std::string &fallback={}) const
 
int getIntAttribute (const char *name, int fallback=0) const
 
std::vector< Element > children (const char *tag=nullptr) const
 
std::vector< Element > elementsByTag (const char *tag) const
 

友元

class Document
 

详细描述

Handle to one element of a parsed Document. Cheap to copy; valid while the owning Document lives.

在文件 Xml.h 第 29 行定义.

构造及析构函数说明

◆ Element()

eve::xml::Element::Element ( )
default

被这些函数引用 children(), elementsByTag() , 以及 parent().

成员函数说明

◆ children()

std::vector< Element > eve::xml::Element::children ( const char *  tag = nullptr) const

Direct child elements. When tag is non-null, only children whose tag equals tag are returned.

在文件 Xml.cpp 第 340 行定义.

引用了 eve::xml::Node::children, Element() , 以及 tag.

◆ elementsByTag()

std::vector< Element > eve::xml::Element::elementsByTag ( const char *  tag) const

Descendant elements with the given tag (document order), matching the common getElementsByTagName shape used by config loaders.

在文件 Xml.cpp 第 349 行定义.

引用了 Element(), node , 以及 tag.

◆ getAttribute()

std::string eve::xml::Element::getAttribute ( const char *  name,
const std::string &  fallback = {} 
) const

在文件 Xml.cpp 第 325 行定义.

引用了 eve::xml::Node::attributes , 以及 name.

被这些函数引用 getIntAttribute().

◆ getIntAttribute()

int eve::xml::Element::getIntAttribute ( const char *  name,
int  fallback = 0 
) const

在文件 Xml.cpp 第 331 行定义.

引用了 getAttribute(), hasAttribute() , 以及 name.

◆ hasAttribute()

bool eve::xml::Element::hasAttribute ( const char *  name) const

在文件 Xml.cpp 第 321 行定义.

引用了 eve::xml::Node::attributes , 以及 name.

被这些函数引用 getIntAttribute().

◆ operator bool()

eve::xml::Element::operator bool ( ) const
inlineexplicit

True when this handle refers to an actual element.

在文件 Xml.h 第 34 行定义.

◆ operator!=()

bool eve::xml::Element::operator!= ( const Element &  other) const
inline

在文件 Xml.h 第 37 行定义.

◆ operator==()

bool eve::xml::Element::operator== ( const Element &  other) const
inline

在文件 Xml.h 第 36 行定义.

◆ parent()

Element eve::xml::Element::parent ( ) const

Parent element, or a null Element for the document root / invalid.

在文件 Xml.cpp 第 317 行定义.

引用了 Element() , 以及 eve::xml::Node::parent.

◆ tagName()

std::string eve::xml::Element::tagName ( ) const

Local tag name (no namespace prefix stripping). Empty when invalid.

在文件 Xml.cpp 第 315 行定义.

引用了 eve::xml::Node::tag.

友元及相关函数文档

◆ Document

friend class Document
friend

在文件 Xml.h 第 62 行定义.


该类的文档由以下文件生成: