Assimp v5.2.2 (January 2022)
The Asset-Importer-Lib API documentation.
aiMetadata Struct Reference

Container for holding metadata. More...

#include <metadata.h>

Public Member Functions

template<typename T >
void Add (const std::string &key, const T &value)
 
 aiMetadata () AI_NO_EXCEPT
 The default constructor, set all members to zero by default. More...
 
 aiMetadata (const aiMetadata &rhs)
 
template<typename T >
bool Get (const aiString &key, T &value) const
 
template<typename T >
bool Get (const std::string &key, T &value) const
 
bool Get (size_t index, const aiString *&key, const aiMetadataEntry *&entry) const
 Return metadata entry for analyzing it by user. More...
 
template<typename T >
bool Get (unsigned index, T &value) const
 
bool HasKey (const char *key) const
 Check whether there is a metadata entry for the given key. More...
 
aiMetadataoperator= (aiMetadata rhs)
 
template<typename T >
bool Set (const std::string &key, const T &value)
 
template<typename T >
bool Set (unsigned index, const std::string &key, const T &value)
 
 ~aiMetadata ()
 The destructor. More...
 

Static Public Member Functions

static aiMetadataAlloc (unsigned int numProperties)
 Allocates property fields + keys. More...
 
static void Dealloc (aiMetadata *metadata)
 Deallocates property fields + keys. More...
 

Public Attributes

C_STRUCT aiStringmKeys
 Arrays of keys, may not be NULL. More...
 
unsigned int mNumProperties
 Length of the mKeys and mValues arrays, respectively. More...
 
C_STRUCT aiMetadataEntrymValues
 Arrays of values, may not be NULL. More...
 

Friends

bool CompareKeys (const aiMetadata &lhs, const aiMetadata &rhs)
 
bool CompareValues (const aiMetadata &lhs, const aiMetadata &rhs)
 
bool operator!= (const aiMetadata &lhs, const aiMetadata &rhs)
 
bool operator== (const aiMetadata &lhs, const aiMetadata &rhs)
 

Detailed Description

Container for holding metadata.

Metadata is a key-value store using string keys and values.

Constructor & Destructor Documentation

◆ aiMetadata() [1/2]

aiMetadata::aiMetadata ( )
inline

The default constructor, set all members to zero by default.

◆ aiMetadata() [2/2]

aiMetadata::aiMetadata ( const aiMetadata rhs)
inline

◆ ~aiMetadata()

aiMetadata::~aiMetadata ( )
inline

The destructor.

Member Function Documentation

◆ Add()

template<typename T >
void aiMetadata::Add ( const std::string &  key,
const T &  value 
)
inline

◆ Alloc()

static aiMetadata * aiMetadata::Alloc ( unsigned int  numProperties)
inlinestatic

Allocates property fields + keys.

Parameters
numPropertiesNumber of requested properties.

◆ Dealloc()

static void aiMetadata::Dealloc ( aiMetadata metadata)
inlinestatic

Deallocates property fields + keys.

◆ Get() [1/4]

template<typename T >
bool aiMetadata::Get ( const aiString key,
T &  value 
) const
inline

◆ Get() [2/4]

template<typename T >
bool aiMetadata::Get ( const std::string &  key,
T &  value 
) const
inline

◆ Get() [3/4]

bool aiMetadata::Get ( size_t  index,
const aiString *&  key,
const aiMetadataEntry *&  entry 
) const
inline

Return metadata entry for analyzing it by user.

Parameters
[in]pIndex- index of the entry.
[out]pKey- pointer to the key value.
[out]pEntry- pointer to the entry: type and value.
Returns
false - if pIndex is out of range, else - true.

◆ Get() [4/4]

template<typename T >
bool aiMetadata::Get ( unsigned  index,
T &  value 
) const
inline

◆ HasKey()

bool aiMetadata::HasKey ( const char *  key) const
inline

Check whether there is a metadata entry for the given key.

Parameters
[in]Key- the key value value to check for.

◆ operator=()

aiMetadata & aiMetadata::operator= ( aiMetadata  rhs)
inline

◆ Set() [1/2]

template<typename T >
bool aiMetadata::Set ( const std::string &  key,
const T &  value 
)
inline

◆ Set() [2/2]

template<typename T >
bool aiMetadata::Set ( unsigned  index,
const std::string &  key,
const T &  value 
)
inline

Friends And Related Function Documentation

◆ CompareKeys

bool CompareKeys ( const aiMetadata lhs,
const aiMetadata rhs 
)
friend

◆ CompareValues

bool CompareValues ( const aiMetadata lhs,
const aiMetadata rhs 
)
friend

◆ operator!=

bool operator!= ( const aiMetadata lhs,
const aiMetadata rhs 
)
friend

◆ operator==

bool operator== ( const aiMetadata lhs,
const aiMetadata rhs 
)
friend

Member Data Documentation

◆ mKeys

C_STRUCT aiString* aiMetadata::mKeys

Arrays of keys, may not be NULL.

Entries in this array may not be NULL as well.

◆ mNumProperties

unsigned int aiMetadata::mNumProperties

Length of the mKeys and mValues arrays, respectively.

◆ mValues

C_STRUCT aiMetadataEntry* aiMetadata::mValues

Arrays of values, may not be NULL.

Entries in this array may be NULL if the corresponding property key has no assigned value.


The documentation for this struct was generated from the following file: