TMetaAttribute

primo::avblocks::modern::TMetaAttribute

class TMetaAttribute

Fluent wrapper for primo::codecs::MetaAttribute.

Owns the raw object through a primo::ref<MetaAttribute>. Non-copyable, movable. Constructed from a factory-owned object (via primo::ref) or from a non-owned pointer (via raw-pointer ctor, which retains it).

Unnamed Group

TMetaAttribute(TMetaAttribute&&) = default
TMetaAttribute &operator=(TMetaAttribute&&) = default

Move construction/assignment transfers ownership of the underlying object. The moved-from object no longer wraps anything.

Public Functions

inline TMetaAttribute()

Creates an empty meta attribute.

inline explicit TMetaAttribute(primo::ref<primo::codecs::MetaAttribute> attr)

Takes ownership of an existing MetaAttribute reference.

inline explicit TMetaAttribute(primo::codecs::MetaAttribute *attr)

Wraps a non-owned MetaAttribute pointer, retaining it.

TMetaAttribute(const TMetaAttribute&) = delete
TMetaAttribute &operator=(const TMetaAttribute&) = delete
inline const char *name() const

Returns the attribute name as an ANSI string (see primo::codecs::Meta constants).

inline std::string value() const

Returns the attribute value as a UTF-8 std::string.

inline bool immutable() const

Returns true if the attribute is immutable.

inline TMetaAttribute &name(const char *n)

Sets the attribute name (name is an ANSI string).

inline TMetaAttribute &value(const char *val)

Sets the attribute value (val is a UTF-8 C-string).

inline TMetaAttribute clone() const

Creates a full independent clone. The returned object is always mutable.

inline bool valid() const

Returns true when this handle wraps a non-null underlying object.

inline primo::codecs::MetaAttribute *get() const

Returns the raw underlying pointer. For interop with the core API only.