Sese Framework  2.3.0
A cross-platform framework
Loading...
Searching...
No Matches
sese::xml::Element Class Reference

XML Element. More...

#include <XmlTypes.h>

Public Types

using Ptr = std::shared_ptr<Element>
 
using AttrType = std::map<std::string, std::string>
 
using SubType = std::vector<Element::Ptr>
 

Public Member Functions

 Element (const std::string &name)
 
const std::string & getName () const
 
const std::string & getValue () const
 
void setValue (std::string var)
 
const AttrTypegetAttributes () const
 
const SubTypegetElements () const
 
void addElement (const Element::Ptr &element)
 
void setAttribute (const std::string &name, const std::string &value)
 
const std::string & getAttribute (const std::string &name, const std::string &default_value) const
 
void removeAttribute (const std::string &name)
 

Public Attributes

SubType elements
 

Private Attributes

std::string name
 
std::string value
 
AttrType attributes
 

Detailed Description

XML Element.

Member Typedef Documentation

◆ AttrType

using sese::xml::Element::AttrType = std::map<std::string, std::string>

◆ Ptr

using sese::xml::Element::Ptr = std::shared_ptr<Element>

◆ SubType

Constructor & Destructor Documentation

◆ Element()

sese::xml::Element::Element ( const std::string & name)
explicit

References name.

Member Function Documentation

◆ addElement()

void sese::xml::Element::addElement ( const Element::Ptr & element)

References elements.

◆ getAttribute()

const std::string & sese::xml::Element::getAttribute ( const std::string & name,
const std::string & default_value ) const
nodiscard

References attributes, and name.

◆ getAttributes()

const Element::AttrType & sese::xml::Element::getAttributes ( ) const
nodiscard

References attributes.

◆ getElements()

const Element::SubType & sese::xml::Element::getElements ( ) const
nodiscard

References elements.

◆ getName()

const std::string & sese::xml::Element::getName ( ) const
nodiscard

References name.

◆ getValue()

const std::string & sese::xml::Element::getValue ( ) const
nodiscard

References value.

◆ removeAttribute()

void sese::xml::Element::removeAttribute ( const std::string & name)

References attributes, and name.

◆ setAttribute()

void sese::xml::Element::setAttribute ( const std::string & name,
const std::string & value )

References attributes, name, and value.

◆ setValue()

void sese::xml::Element::setValue ( std::string var)

References value.

Member Data Documentation

◆ attributes

AttrType sese::xml::Element::attributes
private

◆ elements

SubType sese::xml::Element::elements

Referenced by addElement(), and getElements().

◆ name

std::string sese::xml::Element::name
private

◆ value

std::string sese::xml::Element::value
private

Referenced by getValue(), setAttribute(), and setValue().


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