Class to represent a single attribute.
More...
#include <tag.h>
|
int | id () const |
| Attribute Id.
|
|
const std::string & | value () |
| Get the current string value for the attribute.
|
|
int | integer () const |
| Return the current value as an integer. More...
|
|
void | value (const std::string &value) |
| Set the value of the attribute. More...
|
|
void | has_value (bool has) |
| Set if the attribute has a value associated with it. More...
|
|
bool | has_value () const |
| Check if the attribute has a value. More...
|
|
TagAttribute * | next () |
| Get the next attribute for the same tag. More...
|
|
Class to represent a single attribute.
◆ TagAttribute() [1/2]
TagAttribute::TagAttribute |
( |
int |
id | ) |
|
|
protected |
Construct an attribute without a value.
- Parameters
-
id | ID of the name for this type of tag attribute |
◆ TagAttribute() [2/2]
TagAttribute::TagAttribute |
( |
int |
id, |
|
|
const std::string & |
value |
|
) |
| |
|
protected |
Construct an attribute with the given value.
- Parameters
-
id | ID of the name for this type of tag attribute |
value | value of the tag attribute |
◆ has_value() [1/2]
bool tbx::TagAttribute::has_value |
( |
| ) |
const |
|
inline |
Check if the attribute has a value.
- Returns
- true if the attribute has a value
◆ has_value() [2/2]
void tbx::TagAttribute::has_value |
( |
bool |
has | ) |
|
|
inline |
Set if the attribute has a value associated with it.
- Parameters
-
has | true if the attribute has a value |
◆ integer()
int tbx::TagAttribute::integer |
( |
| ) |
const |
|
inline |
Return the current value as an integer.
- Returns
- integer value or 0 if the current value is not an integer
◆ next()
Get the next attribute for the same tag.
- Returns
- next attribute or 0 if there are no more attributes
◆ value()
void tbx::TagAttribute::value |
( |
const std::string & |
value | ) |
|
|
inline |
Set the value of the attribute.
- Parameters
-
value | the new string value of the attribute |
The documentation for this class was generated from the following files: