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
MetaAttributeListpointer.
-
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
setAtwrite.
-
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
indexwithattr. Returnstrueon success.
-
inline bool insert(int32_t index, TMetaAttribute &&attr)¶
Inserts
attrbeforeindex, shifting later items. Returnstrueon success.
-
inline bool immutable() const¶
Returns
truewhen the list (and its parentMetadata) is immutable.
-
inline bool remove(int32_t index)¶
Removes the attribute at
index. Returnstrueon success.
-
inline bool clear()¶
Removes all attributes from the list. Returns
trueon success.
-
struct ItemRef¶
Proxy returned by the non-const lvalue
operator[](int32_t).Supports both read (implicit conversion to
TMetaAttribute) and write (operator=callssetAton 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; returnstrueon success.
Public Members
-
TMetaAttributeList &list_¶
The list this proxy refers to.
-
int32_t index_¶
Index of the item the proxy refers to.
-
inline operator TMetaAttribute() const¶
-
inline explicit TMetaAttributeList(primo::codecs::MetaAttributeList *list)¶