Skip to content

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
voidname(std::string name)
const std::string &value() const
voidvalue(std::string value)
const std::string &type() const
voidtype(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:

function name

cpp
inline const std::string & name() const

Return: The name of the attribute.

function name

cpp
inline void name(
    std::string name
)

Parameters:

  • name The name for the attribute.

Exceptions:

function value

cpp
inline const std::string & value() const

Return: The value of the attribute.

function value

cpp
inline void value(
    std::string value
)

Parameters:

  • value The value for the attribute.

Exceptions:

function type

cpp
inline const std::string & type() const

Return: 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