MyGUI 3.4.3
MyGUI::xml::Element Class Reference

#include <MyGUI_XmlDocument.h>

Public Member Functions

 Element (std::string_view _name, ElementPtr _parent, ElementType _type=ElementType::Normal, std::string_view _content={})
 
 Element (Element &&)=default
 
ElementPtr createChild (std::string_view _name, std::string_view _content={}, ElementType _type=ElementType::Normal)
 
void removeChild (ElementPtr _child)
 
template<typename T , typename = std::enable_if_t<!std::is_convertible_v<T, std::string_view>>>
void addAttribute (std::string_view _key, const T &_value)
 
void addAttribute (std::string_view _key, std::string_view _value)
 
void removeAttribute (std::string_view _key)
 
void setAttribute (std::string_view _key, std::string_view _value)
 
template<typename T , typename = std::enable_if_t<!std::is_convertible_v<T, std::string_view>>>
void addContent (const T &_content)
 
void addContent (std::string_view _content)
 
template<typename T , typename = std::enable_if_t<!std::is_convertible_v<T, std::string_view>>>
void setContent (const T &_content)
 
void setContent (std::string_view _content)
 
void clear ()
 
bool findAttribute (std::string_view _name, std::string &_value)
 
std::string_view findAttribute (std::string_view _name)
 
const std::string & getName () const
 
const std::string & getContent () const
 
const VectorAttributesgetAttributes () const
 
ElementPtr getParent () const
 
ElementEnumerator getElementEnumerator ()
 
ElementType getType () const
 
std::unique_ptr< ElementcreateCopy ()
 
template<typename T >
void addAttributes (std::string_view _key, const T &_value)
 
void addAttributes (std::string_view _key, std::string_view _value)
 
template<typename T >
void addBody (const T &_content)
 
void addBody (std::string_view _content)
 
template<typename T >
void setBody (const T &_content)
 
void setBody (std::string_view _content)
 
const std::string & getBody () const
 
ElementEnumerator getNodeIterator ()
 

Friends

class Document
 

Detailed Description

Definition at line 164 of file MyGUI_XmlDocument.h.

Constructor & Destructor Documentation

◆ Element() [1/2]

MyGUI::xml::Element::Element ( std::string_view _name,
ElementPtr _parent,
ElementType _type = ElementType::Normal,
std::string_view _content = {} )

Definition at line 145 of file MyGUI_XmlDocument.cpp.

◆ Element() [2/2]

MyGUI::xml::Element::Element ( Element && )
default

Member Function Documentation

◆ addAttribute() [1/2]

template<typename T , typename = std::enable_if_t<!std::is_convertible_v<T, std::string_view>>>
void MyGUI::xml::Element::addAttribute ( std::string_view _key,
const T & _value )
inline

Definition at line 187 of file MyGUI_XmlDocument.h.

◆ addAttribute() [2/2]

void MyGUI::xml::Element::addAttribute ( std::string_view _key,
std::string_view _value )

Definition at line 265 of file MyGUI_XmlDocument.cpp.

◆ addAttributes() [1/2]

template<typename T >
void MyGUI::xml::Element::addAttributes ( std::string_view _key,
const T & _value )
inline
Deprecated
"use : template <typename T> void Element::addAttribute(const std::string &_key, const T& _value)"

Definition at line 239 of file MyGUI_XmlDocument.h.

◆ addAttributes() [2/2]

void MyGUI::xml::Element::addAttributes ( std::string_view _key,
std::string_view _value )
inline
Deprecated
"use : void Element::addAttribute(std::string_view _key, std::string_view _value)"

Definition at line 244 of file MyGUI_XmlDocument.h.

◆ addBody() [1/2]

template<typename T >
void MyGUI::xml::Element::addBody ( const T & _content)
inline
Deprecated
"use : template <typename T> void Element::addContent(const T& _content)"

Definition at line 251 of file MyGUI_XmlDocument.h.

◆ addBody() [2/2]

void MyGUI::xml::Element::addBody ( std::string_view _content)
inline
Deprecated
"use : void Element::addContent(std::string_view _content)"

Definition at line 256 of file MyGUI_XmlDocument.h.

◆ addContent() [1/2]

template<typename T , typename = std::enable_if_t<!std::is_convertible_v<T, std::string_view>>>
void MyGUI::xml::Element::addContent ( const T & _content)
inline

Definition at line 199 of file MyGUI_XmlDocument.h.

◆ addContent() [2/2]

void MyGUI::xml::Element::addContent ( std::string_view _content)

Definition at line 310 of file MyGUI_XmlDocument.cpp.

◆ clear()

void MyGUI::xml::Element::clear ( )

Definition at line 235 of file MyGUI_XmlDocument.cpp.

◆ createChild()

ElementPtr MyGUI::xml::Element::createChild ( std::string_view _name,
std::string_view _content = {},
ElementType _type = ElementType::Normal )

Definition at line 218 of file MyGUI_XmlDocument.cpp.

◆ createCopy()

std::unique_ptr< Element > MyGUI::xml::Element::createCopy ( )

Definition at line 282 of file MyGUI_XmlDocument.cpp.

◆ findAttribute() [1/2]

std::string_view MyGUI::xml::Element::findAttribute ( std::string_view _name)

Definition at line 255 of file MyGUI_XmlDocument.cpp.

◆ findAttribute() [2/2]

bool MyGUI::xml::Element::findAttribute ( std::string_view _name,
std::string & _value )

Definition at line 242 of file MyGUI_XmlDocument.cpp.

◆ getAttributes()

const VectorAttributes & MyGUI::xml::Element::getAttributes ( ) const

Definition at line 338 of file MyGUI_XmlDocument.cpp.

◆ getBody()

const std::string & MyGUI::xml::Element::getBody ( ) const
inline
Deprecated
"use : const std::string& Element::getContent()"

Definition at line 273 of file MyGUI_XmlDocument.h.

◆ getContent()

const std::string & MyGUI::xml::Element::getContent ( ) const

Definition at line 333 of file MyGUI_XmlDocument.cpp.

◆ getElementEnumerator()

ElementEnumerator MyGUI::xml::Element::getElementEnumerator ( )

Definition at line 348 of file MyGUI_XmlDocument.cpp.

◆ getName()

const std::string & MyGUI::xml::Element::getName ( ) const

Definition at line 328 of file MyGUI_XmlDocument.cpp.

◆ getNodeIterator()

ElementEnumerator MyGUI::xml::Element::getNodeIterator ( )
inline
Deprecated
"use : ElementEnumerator Element::getElementEnumerator()"

Definition at line 278 of file MyGUI_XmlDocument.h.

◆ getParent()

ElementPtr MyGUI::xml::Element::getParent ( ) const

Definition at line 343 of file MyGUI_XmlDocument.cpp.

◆ getType()

ElementType MyGUI::xml::Element::getType ( ) const

Definition at line 353 of file MyGUI_XmlDocument.cpp.

◆ removeAttribute()

void MyGUI::xml::Element::removeAttribute ( std::string_view _key)

Definition at line 270 of file MyGUI_XmlDocument.cpp.

◆ removeChild()

void MyGUI::xml::Element::removeChild ( ElementPtr _child)

Definition at line 223 of file MyGUI_XmlDocument.cpp.

◆ setAttribute()

void MyGUI::xml::Element::setAttribute ( std::string_view _key,
std::string_view _value )

Definition at line 297 of file MyGUI_XmlDocument.cpp.

◆ setBody() [1/2]

template<typename T >
void MyGUI::xml::Element::setBody ( const T & _content)
inline
Deprecated
"use : template <typename T> void Element::setContent(const T& _content)"

Definition at line 262 of file MyGUI_XmlDocument.h.

◆ setBody() [2/2]

void MyGUI::xml::Element::setBody ( std::string_view _content)
inline
Deprecated
"use : void Element::setContent(std::string_view _content)"

Definition at line 267 of file MyGUI_XmlDocument.h.

◆ setContent() [1/2]

template<typename T , typename = std::enable_if_t<!std::is_convertible_v<T, std::string_view>>>
void MyGUI::xml::Element::setContent ( const T & _content)
inline

Definition at line 207 of file MyGUI_XmlDocument.h.

◆ setContent() [2/2]

void MyGUI::xml::Element::setContent ( std::string_view _content)

Definition at line 323 of file MyGUI_XmlDocument.cpp.

Friends And Related Symbol Documentation

◆ Document

friend class Document
friend

Definition at line 166 of file MyGUI_XmlDocument.h.


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