TMetaAttributeList

primo::avblocks::modern::TMetaAttributeList

class TMetaAttributeList

Non-owning view of a MetaAttributeList.

Returned by TMetadata::attributes().

Public Functions

inline explicit TMetaAttributeList(primo::codecs::MetaAttributeList *list)

Wraps a non-owned MetaAttributeList pointer.

inline int32_t count() const

Returns the number of attributes.

inline TMetaAttribute at(int32_t index) const

Returns the attribute at index (non-owning, retaining).

inline ItemRef operator[](int32_t index) &

Non-const lvalue subscript — returns a proxy supporting read and setAt write.

inline TMetaAttribute itemByName(const char *name) const

Returns the first attribute whose name matches name (non-owning, retaining).

Check TMetaAttribute::valid() before use.

inline TMetaAttribute operator[](const char *name) const &

Subscript by name — same as itemByName(name).

inline bool setAt(int32_t index, TMetaAttribute &&attr)

Replaces the attribute at index with attr. Returns true on success.

inline bool insert(int32_t index, TMetaAttribute &&attr)

Inserts attr before index, shifting later items. Returns true on success.

inline bool immutable() const

Returns true when the list (and its parent Metadata) is immutable.

inline bool remove(int32_t index)

Removes the attribute at index. Returns true on success.

inline bool clear()

Removes all attributes from the list. Returns true on success.

struct ItemRef

Proxy returned by the non-const lvalue operator[](int32_t).

Supports both read (implicit conversion to TMetaAttribute) and write (operator= calls setAt on the parent list).

Public Functions

inline operator TMetaAttribute() const

Read — implicit conversion to a non-owning attribute wrapper.

inline bool operator=(TMetaAttribute &&a)

Write — calls setAt; returns true on success.

Public Members

TMetaAttributeList &list_

The list this proxy refers to.

int32_t index_

Index of the item the proxy refers to.