XMLParserCPP 1.0
Loading...
Searching...
No Matches
XMLElement Class Reference

The XMLElement class. More...

#include <XMLElement.h>

Public Types

enum  Type {
  ProgramControlElement , CharData , Comment , SpecialElement ,
  OrdinaryElement , ElementContent
}
 XML elements types enumerator. More...

Public Member Functions

 XMLElement ()
 XMLElement constructor.
 XMLElement (const XMLElement &other)
 XMLElement copy constructor.
 XMLElement (XMLElement &&other)
 XMLElement move constructor.
XMLElementoperator= (const XMLElement &other)
 operator =

Public Attributes

std::string element_name
 XML element name.
std::vector< XMLElementAttributeelement_attributes
 Vector of XML element attributes.
std::vector< XMLElementelements
 Vector of XML element subelements.
std::string content
 XML element content if any.
Type element_type = Type::OrdinaryElement
 XMLElement type.
bool empty = false
 If true indicates XML elements without content.

Detailed Description

The XMLElement class.

This class contains different XML element parameters.

Member Enumeration Documentation

◆ Type

XML elements types enumerator.

Enumerator
ProgramControlElement 

"Header" XML elements like

<?xml version="1.0" encoding="UTF-8"?>
CharData 

Char data elements

<![CDATA[]]>
Comment 

XML comments

<!-- Comment -->
SpecialElement 

Special XML elements like

<!DOCTYPE html>
OrdinaryElement 

"Ordinary" XML elements like

<element>
ElementContent 

Indicates XMLElement containing XML element content (element_name is empty string)

Constructor & Destructor Documentation

◆ XMLElement() [1/2]

XMLElement::XMLElement ( const XMLElement & other)

XMLElement copy constructor.

Parameters
otherXMLElement to be copied.

◆ XMLElement() [2/2]

XMLElement::XMLElement ( XMLElement && other)

XMLElement move constructor.

Parameters
otherXMLElement to be moved.

Member Function Documentation

◆ operator=()

XMLElement & XMLElement::operator= ( const XMLElement & other)

operator =

Parameters
otherXMLElement to be copied.
Returns
XMLElement.

Member Data Documentation

◆ empty

bool XMLElement::empty = false

If true indicates XML elements without content.

Example:

<empty-line/>