|
libxcks
0.1.0.1
|
Manages elements' attributes. More...
#include <xmlparser.hpp>
Public Member Functions | |
| XMLParserAttributes () | |
| Default constructor. More... | |
| XMLParserAttributes (const XMLParserAttributes &)=delete | |
| Deleted copy constructor. More... | |
| XMLParserAttributes & | operator= (const XMLParserAttributes &)=delete |
| Deleted copy assignment operator. More... | |
| void | addAttribute (const std::string &name, const std::string &value) |
| Adds an attribute to the end of the list. More... | |
| void | addAttribute (const XMLParserAttribute &&attribute) |
| Adds an attribute to the end of the list. More... | |
| void | clear () |
| Clears the attribute list for reuse. More... | |
| int | getIndex (const std::string &name) const |
| Looks up an attribute's index by name. More... | |
| size_t | getCount () const |
| Returns the number of attributes in the list. More... | |
| bool | getName (size_t index, std::string &name) const |
| Gets an attribute's name. More... | |
| bool | getValue (size_t index, std::string &value) const |
| Returns an attribute's value by index. More... | |
| bool | getValue (const std::string &name, std::string &value) const |
| Looks up an attribute's value by name. More... | |
Static Public Attributes | |
| static constexpr int | Not_Found = -1 |
| Not found index. More... | |
Protected Attributes | |
| std::vector< XMLParserAttribute > | attributes |
| Attributes. More... | |
Manages elements' attributes.
Definition at line 83 of file xmlparser.hpp.
|
inline |
Default constructor.
Definition at line 93 of file xmlparser.hpp.
|
delete |
Deleted copy constructor.
| void libxcks::XMLParserAttributes::addAttribute | ( | const std::string & | name, |
| const std::string & | value | ||
| ) |
Adds an attribute to the end of the list.
For the sake of speed, this method does no checking to see if the attribute is already in the list: that is the responsibility of the application.
| name | The attribute's name. |
| value | The attribute's value. |
Definition at line 168 of file xmlparser.cpp.
| void libxcks::XMLParserAttributes::addAttribute | ( | const XMLParserAttribute && | attribute | ) |
Adds an attribute to the end of the list.
For the sake of speed, this method does no checking to see if the attribute is already in the list: that is the responsibility of the application.
| attribute | The attribute. |
Definition at line 183 of file xmlparser.cpp.
| void libxcks::XMLParserAttributes::clear | ( | ) |
Clears the attribute list for reuse.
Definition at line 193 of file xmlparser.cpp.
| size_t libxcks::XMLParserAttributes::getCount | ( | ) | const |
Returns the number of attributes in the list.
Definition at line 230 of file xmlparser.cpp.
| int libxcks::XMLParserAttributes::getIndex | ( | const std::string & | name | ) | const |
Looks up an attribute's index by name.
| name | The name of the attribute. |
Not_Found if none matches. Definition at line 207 of file xmlparser.cpp.
| bool libxcks::XMLParserAttributes::getName | ( | size_t | index, |
| std::string & | name | ||
| ) | const |
Gets an attribute's name.
| index | The attribute's index (zero-based). | |
| [out] | name | The attribute's name, if the index is out of bounds this parameter's value is not changed. |
true if the index is valid, otherwise. Definition at line 245 of file xmlparser.cpp.
| bool libxcks::XMLParserAttributes::getValue | ( | const std::string & | name, |
| std::string & | value | ||
| ) | const |
Looks up an attribute's value by name.
| name | The attribute's name. | |
| [out] | value | The attribute's value, if there is no matching attribute this parameter's value is not changed. |
true if there is a matching attribute, otherwise. Definition at line 284 of file xmlparser.cpp.
| bool libxcks::XMLParserAttributes::getValue | ( | size_t | index, |
| std::string & | value | ||
| ) | const |
Returns an attribute's value by index.
| index | The attribute's index (zero-based). | |
| [out] | value | The attribute's value, if the index is out of bounds this parameter's value is not changed. |
true if the index is valid, otherwise. Definition at line 264 of file xmlparser.cpp.
|
delete |
Deleted copy assignment operator.
|
protected |
Attributes.
Definition at line 86 of file xmlparser.hpp.
|
staticconstexpr |
Not found index.
Definition at line 90 of file xmlparser.hpp.