CSEngine
Loading...
Searching...
No Matches
XAttrib Class Reference

Public Member Functions

 XAttrib (const std::string &str)
 
 XAttrib (const char *_name, const char *_value)
 
std::string toString () const
 

Public Attributes

std::string name
 
std::string value
 

Detailed Description

Definition at line 29 of file XML.h.

Constructor & Destructor Documentation

◆ XAttrib() [1/3]

XAttrib::XAttrib ( )

Definition at line 71 of file XML.cpp.

71{}

◆ XAttrib() [2/3]

XAttrib::XAttrib ( const std::string &  str)

Definition at line 73 of file XML.cpp.

73 {
74 size_t index = str.find('=');
75 name = str.substr(0, index); // copy the name from the indices: 0 to the equal to sign's index
76 value = str.substr(index + 2, str.substr(index + 2).size() -
77 1); // copy the value, skip the equal to sign and the 2 quotation marks
78}

◆ XAttrib() [3/3]

XAttrib::XAttrib ( const char *  _name,
const char *  _value 
)

Definition at line 80 of file XML.cpp.

80 {
81 this->name = std::string(_name);
82 this->value = std::string(_value);
83}

Member Function Documentation

◆ toString()

std::string XAttrib::toString ( ) const

Definition at line 85 of file XML.cpp.

85 {
86 return (name + "=\"" + value + "\"");
87}

Member Data Documentation

◆ name

std::string XAttrib::name

Definition at line 31 of file XML.h.

◆ value

std::string XAttrib::value

Definition at line 32 of file XML.h.


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