#include <tag.h>
An XML element's attribute.
- Author
- Jakob Schröter js@ca.nosp@m.maya.nosp@m..net
- Since
- 1.0
Definition at line 59 of file tag.h.
◆ Attribute() [1/3]
Attribute |
( |
Tag * |
parent, |
|
|
const std::string & |
name, |
|
|
const std::string & |
value, |
|
|
const std::string & |
xmlns = EmptyString |
|
) |
| |
Creates a new Attribute from name
, value
and optional xmlns
and attaches it to the given Tag.
In the future: If xmlns
is not empty, and if it is different from the Tag's default namespace, an appropriate and unique namespace declaration (prefix) will be added to the Tag and the attribute will be prefixed accordingly.
- Parameters
-
parent | The Tag to attach the Attribute to. |
name | The attribute's name. Invalid (non-UTF-8) input will be ignored. |
value | The attribute's value. Invalid (non-UTF-8) input will be ignored. |
xmlns | The attribute's namespace. Invalid (non-UTF-8) input will be ignored. |
Definition at line 26 of file tag.cpp.
◆ Attribute() [2/3]
Attribute |
( |
const std::string & |
name, |
|
|
const std::string & |
value, |
|
|
const std::string & |
xmlns = EmptyString |
|
) |
| |
Creates a new Attribute from name
, value
and optional xmlns
.
- Parameters
-
name | The attribute's name. Invalid (non-UTF-8) input will be ignored. |
value | The attribute's value. Invalid (non-UTF-8) input will be ignored. |
xmlns | The attribute's namespace. Invalid (non-UTF-8) input will be ignored. |
Definition at line 36 of file tag.cpp.
◆ Attribute() [3/3]
Copy constructor.
- Parameters
-
Definition at line 43 of file tag.cpp.
◆ ~Attribute()
Destructor.
Definition at line 98 of file tag.h.
◆ name()
const std::string& name |
( |
| ) |
const |
|
inline |
Returns the attribute's name.
- Returns
- The attribute's name.
Definition at line 104 of file tag.h.
◆ operator bool()
Returns true if the Attribute is valid, false otherwise.
Definition at line 171 of file tag.h.
◆ operator!=()
bool operator!= |
( |
const Attribute & |
right | ) |
const |
|
inline |
Checks two Attributes for inequality.
- Parameters
-
Definition at line 165 of file tag.h.
◆ operator==()
bool operator== |
( |
const Attribute & |
right | ) |
const |
|
inline |
Checks two Attributes for equality.
- Parameters
-
Definition at line 158 of file tag.h.
◆ prefix()
const std::string & prefix |
( |
| ) |
const |
Returns the attribute's namespace prefix.
- Returns
- The namespace prefix.
Definition at line 106 of file tag.cpp.
◆ setPrefix()
bool setPrefix |
( |
const std::string & |
prefix | ) |
|
Sets the attribute's namespace prefix.
- Parameters
-
prefix | The new namespace prefix. |
- Returns
- True if the input is valid UTF-8, false otherwise. Invalid input will be ignored.
Definition at line 86 of file tag.cpp.
◆ setValue()
bool setValue |
( |
const std::string & |
value | ) |
|
Sets the attribute's value.
- Parameters
-
- Returns
- True if the input is valid UTF-8, false otherwise. Invalid input will be ignored.
Definition at line 68 of file tag.cpp.
◆ setXmlns()
bool setXmlns |
( |
const std::string & |
xmlns | ) |
|
Sets the attribute's namespace.
- Parameters
-
- Returns
- True if the input is valid UTF-8, false otherwise. Invalid input will be ignored.
Definition at line 77 of file tag.cpp.
◆ value()
const std::string& value |
( |
| ) |
const |
|
inline |
Returns the attribute's value.
- Returns
- The attribute's value.
Definition at line 110 of file tag.h.
◆ xml()
const std::string xml |
( |
| ) |
const |
Returns a string representation of the attribute.
- Returns
- A string representation.
Definition at line 117 of file tag.cpp.
◆ xmlns()
const std::string xmlns |
( |
| ) |
const |
Returns the attribute's namespace.
- Returns
- The attribute's namespace.
Definition at line 95 of file tag.cpp.
The documentation for this class was generated from the following files: