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 72 of file XML.cpp.

72{}

◆ XAttrib() [2/3]

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

Definition at line 74 of file XML.cpp.

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

◆ XAttrib() [3/3]

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

Definition at line 81 of file XML.cpp.

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

Member Function Documentation

◆ toString()

std::string XAttrib::toString ( ) const

Definition at line 86 of file XML.cpp.

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

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: