scram::mef::Attribute
MEF Element Attributes. More...
#include <element.h>
Public Functions
| Name | |
|---|---|
| Attribute(std::string name, std::string value, std::string type ="") | |
| const std::string & | name() const |
| void | name(std::string name) |
| const std::string & | value() const |
| void | value(std::string value) |
| const std::string & | type() const |
| void | type(std::string type) |
Detailed Description
cpp
class scram::mef::Attribute;MEF Element Attributes.
Note: Attribute values are all free-form strings. The strings are not sanitized or normalized to be meaningful. If not careful, it is possible to end-up with values that XML schema validators won't accept (e.g., special chars).
Attributes carry extra (arbitrary) data for the elements. The interpretation of the attribute data is tool-dependent or up-to-the-user.
Public Functions Documentation
function Attribute
cpp
inline Attribute(
std::string name,
std::string value,
std::string type =""
)Parameters:
- name The name for the attribute.
- value The value for the attribute.
- type The optional type of the attribute value.
Exceptions:
- LogicError if any required values are empty.
function name
cpp
inline const std::string & name() constReturn: The name of the attribute.
function name
cpp
inline void name(
std::string name
)Parameters:
- name The name for the attribute.
Exceptions:
- LogicError The name is empty.
function value
cpp
inline const std::string & value() constReturn: The value of the attribute.
function value
cpp
inline void value(
std::string value
)Parameters:
- value The value for the attribute.
Exceptions:
- LogicError The value is empty.
function type
cpp
inline const std::string & type() constReturn: The type of the attribute value. Empty string if the type is not set.
function type
cpp
inline void type(
std::string type
)Parameters:
- type The value type. Empty string to remove the type.
Updated on 2025-11-11 at 16:51:08 +0000
