Nuke binary plugins 15.0.5
 
Loading...
Searching...
No Matches
DD::Image::MetaData::Bundle Class Reference

#include <MetaData.h>

Public Types

typedef std::shared_ptr< const Foundry::Property::Base > PropertyPtr
 
typedef std::map< std::string, PropertyPtr, CompareKey > data_t
 all the metadata contained in the bundle
 
using const_iterator = data_t::const_iterator
 iterator over all the metadata
 

Public Member Functions

 Bundle ()
 create an empty bundle
 
 Bundle (const MetaData::Bundle &otherBundle)
 create a new bundle based upon other bundles. This performs a shallow copy.
 
void operator= (const MetaData::Bundle &otherBundle)
 assign this bundle based upon another bundle. This performs a shallow copy.
 
bool operator== (const MetaData::Bundle &otherBundle) const
 compare two bundles. Returns true if they are identical.
 
size_t size () const
 how many metadata elements there are in this bundle
 
const_iterator begin () const
 get iterator to the first piece of metadata
 
const_iterator end () const
 get iterator pointing past the last piece of metadata
 
const_iterator find (const char *key) const
 find a particular piece of metadata by key. returns end() if not present.
 
const_iterator find (const std::string &key) const
 find a particular piece of metadata by key. returns end() if not present.
 
const_iterator erase (const_iterator it)
 
const_iterator erase (const char *key)
 
const_iterator erase (const std::string &key)
 
const data_tmeta () const
 return the underlying std::map for the metadata
 
PropertyPtr getData (const char *key) const
 return the pointer to the named metadata element
 
PropertyPtr getData (const std::string &key) const
 return the pointer to the named metadata element
 
double getDouble (const char *key) const
 return the named metadata element as a double. this will convert strings to numbers. XXX: need to convert rationals as well.
 
unsigned char getUnsignedChar (const char *key) const
 return the named metadata element as an unsigned int. this will convert strings to numbers. XXX: need to convert rationals as well.
 
std::string getString (const char *key) const
 return the named metadata as a string. this involves converting ints and doubles to strings, and formatting arrays by inserting commas
 
mFnDeprecatedInNuke14("Use setData instead.") void setDataCopy(const std void setData (const std::string &key, const PropertyPtr &property)
 set the given key to point at a copy of the given object
 
void setDataIfNotNan (const std::string &key, double number)
 set the given key to the given number, if and only if number is not NAN. A deep copy may be performed if necessary
 
void setDataIfNotEmpty (const std::string &key, const std::string &data)
 set the given key to the given string, if and only if data is not empty. A deep copy may be performed if necessary
 
void setData (const std::string &key, float data)
 set the given key to the given data. A deep copy may be performed if necessary
 
void setData (const std::string &key, const float *data, unsigned count)
 set the given key to the given data. A deep copy may be performed if necessary
 
void setData (const std::string &key, double data)
 set the given key to the given data. A deep copy may be performed if necessary
 
void setData (const std::string &key, const double *data, unsigned count)
 set the given key to the given data. A deep copy may be performed if necessary
 
void setData (const std::string &key, int data)
 set the given key to the given data. A deep copy may be performed if necessary
 
void setData (const std::string &key, const int *data, unsigned count)
 set the given key to the given data. A deep copy may be performed if necessary
 
template<class T >
void setData (const std::string &key, const std::vector< T > &data)
 set the given key to the given data. A deep copy may be performed if necessary
 
void setData (const std::string &key, unsigned int data)
 set the given key to the given data. A deep copy may be performed if necessary
 
void setData (const std::string &key, const std::string &data)
 set the given key to the given data. A deep copy may be performed if necessary
 
void setData (const std::string &key, const char *data)
 set the given key to the given data. A deep copy may be performed if necessary
 
void setTimeStamp (const std::string &key, const std::string &timestamp)
 
void copyFrom (const Bundle &otherBundle)
 

Detailed Description

a group of metadata, associated with keys to values. values consist of Doubles, Ints, or Strings, or arrays of same

Member Typedef Documentation

◆ PropertyPtr

typedef std::shared_ptr<const Foundry::Property::Base> DD::Image::MetaData::Bundle::PropertyPtr

opaque data type for the metadata properties themselves. use helper functions isPropertyInt etc to access these

Member Function Documentation

◆ erase() [1/3]

const_iterator DD::Image::MetaData::Bundle::erase ( const_iterator  it)
inline

remove a particular piece of metadata. A deep copy may be performed if necessary return const_iterator following the last removed element or end() if it->first does not exist Note that existing iterators may be invalidated or no longer refer to this bundle including end()

◆ erase() [2/3]

const_iterator DD::Image::MetaData::Bundle::erase ( const char *  key)
inline

remove a particular piece of metadata. A deep copy may be performed if necessary return const_iterator following the last removed element or end() if key does not exist Note that existing iterators may be invalidated or no longer refer to this bundle including end()

◆ erase() [3/3]

MetaData::Bundle::const_iterator DD::Image::MetaData::Bundle::erase ( const std::string &  key)

remove a particular piece of metadata. A deep copy may be performed if necessary return const_iterator following the last removed element or end() if key does not exist Note that existing iterators may be invalidated or no longer refer to this bundle including end()

◆ setData()

void DD::Image::MetaData::Bundle::setData ( const std::string &  key,
const PropertyPtr property 
)

set the given key to point at a copy of the given object

set the given key to point at the given object. A deep copy may be performed if necessary

Referenced by DD::Image::Read::_fetchMetaData(), and setDataIfNotNan().

◆ setTimeStamp()

void DD::Image::MetaData::Bundle::setTimeStamp ( const std::string &  key,
const std::string &  timestamp 
)

set the given key to the given, which is in the format of the timestamp this will reformat 'YYYY:MM:DD HH:MM:SS', 'YYYY:MM:DD:HH:MM:SS', and 'YYYY-MM-DD HH-MM:SS' as the ISO 8601-compliant 'YYYY-MM-DD HH:MM:SS' A deep copy may be performed if necessary

◆ copyFrom()

void DD::Image::MetaData::Bundle::copyFrom ( const Bundle otherBundle)

copy all the data from the given metadata bundle Note that any existing keys will be replaced and a deep copy may be performed if necessary

References begin(), and end().



©2024 The Foundry Visionmongers, Ltd. All Rights Reserved.
www.foundry.com