HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
OCIO_NAMESPACE::FormatMetadata Class Referenceabstract

#include <OpenColorTransforms.h>

Public Member Functions

virtual const char * getElementName () const noexcept=0
 
virtual void setElementName (const char *)=0
 Name has to be a non-empty string. Top-level element can't be renamed. 'ROOT' is reserved. More...
 
virtual const char * getElementValue () const noexcept=0
 
virtual void setElementValue (const char *)=0
 
virtual int getNumAttributes () const noexcept=0
 
virtual const char * getAttributeName (int i) const noexcept=0
 Get the name of a attribute ("" if attribute does not exist). More...
 
virtual const char * getAttributeValue (int i) const noexcept=0
 Get the value of a attribute ("" if attribute does not exist). More...
 
virtual const char * getAttributeValue (const char *name) const noexcept=0
 Get the value of a attribute of a given name ("" if attribute does not exist). More...
 
virtual void addAttribute (const char *name, const char *value)=0
 
virtual int getNumChildrenElements () const noexcept=0
 
virtual const FormatMetadatagetChildElement (int i) const =0
 
virtual FormatMetadatagetChildElement (int i)=0
 
virtual void addChildElement (const char *name, const char *value)=0
 
virtual void clear () noexcept=0
 Remove all children, all attributes and the value. More...
 
virtual FormatMetadataoperator= (const FormatMetadata &rhs)=0
 
virtual const char * getName () const noexcept=0
 
virtual void setName (const char *name) noexcept=0
 
virtual const char * getID () const noexcept=0
 
virtual void setID (const char *id) noexcept=0
 
 FormatMetadata (const FormatMetadata &rhs)=delete
 
virtual ~FormatMetadata ()=default
 Do not use (needed only for pybind11). More...
 

Protected Member Functions

 FormatMetadata ()=default
 

Detailed Description

The FormatMetadata class is intended to be a generic container to hold metadata from various file formats.

This class provides a hierarchical metadata container. A metadata object is similar to an element in XML. The top level element is named "ROOT" and can't be renamed. Several transforms have a FormatMetadata. The root element and all of the sub-elements may contain:

  • A name string (e.g. "ROOT", "Description"...). Name can't be empty.
  • A value string (e.g. "updated viewing LUT"). Value can be empty.
  • A list of attributes (name, value) string pairs (e.g. "version", "1.5"). There are helper functions to get and set "id" and "name" attributes. Attribute names are unique.
  • And a list of child sub-elements, which are also objects implementing FormatMetadata. There can be several sub-elements with the same name.

Definition at line 44 of file OpenColorTransforms.h.

Constructor & Destructor Documentation

OCIO_NAMESPACE::FormatMetadata::FormatMetadata ( const FormatMetadata rhs)
delete
virtual OCIO_NAMESPACE::FormatMetadata::~FormatMetadata ( )
virtualdefault

Do not use (needed only for pybind11).

OCIO_NAMESPACE::FormatMetadata::FormatMetadata ( )
protecteddefault

Member Function Documentation

virtual void OCIO_NAMESPACE::FormatMetadata::addAttribute ( const char *  name,
const char *  value 
)
pure virtual

Add an attribute with a given name and value. If an attribute with the same name already exists, its value is replaced. Throw if name is NULL or empty.

virtual void OCIO_NAMESPACE::FormatMetadata::addChildElement ( const char *  name,
const char *  value 
)
pure virtual

Add a child element with a given name and value.

Name has to be non-empty. Value may be empty, particularly if this element will have children. Element is added after all existing children. Use getChildElement(getNumChildrenElements()-1) to access the added element.

virtual void OCIO_NAMESPACE::FormatMetadata::clear ( )
pure virtualnoexcept

Remove all children, all attributes and the value.

virtual const char* OCIO_NAMESPACE::FormatMetadata::getAttributeName ( int  i) const
pure virtualnoexcept

Get the name of a attribute ("" if attribute does not exist).

virtual const char* OCIO_NAMESPACE::FormatMetadata::getAttributeValue ( int  i) const
pure virtualnoexcept

Get the value of a attribute ("" if attribute does not exist).

virtual const char* OCIO_NAMESPACE::FormatMetadata::getAttributeValue ( const char *  name) const
pure virtualnoexcept

Get the value of a attribute of a given name ("" if attribute does not exist).

virtual const FormatMetadata& OCIO_NAMESPACE::FormatMetadata::getChildElement ( int  i) const
pure virtual

Access a child element.

Note
Adding siblings might cause a reallocation of the container and thus might make the reference unusable. Index i has to be positive and less than getNumChildrenElements() or the function will throw.
virtual FormatMetadata& OCIO_NAMESPACE::FormatMetadata::getChildElement ( int  i)
pure virtual
virtual const char* OCIO_NAMESPACE::FormatMetadata::getElementName ( ) const
pure virtualnoexcept
virtual const char* OCIO_NAMESPACE::FormatMetadata::getElementValue ( ) const
pure virtualnoexcept
virtual const char* OCIO_NAMESPACE::FormatMetadata::getID ( ) const
pure virtualnoexcept

Convenience method to easily get/set the 'id' attribute. This corresponds to the ProcessNode id attribute from a CLF/CTF file or the ColorCorrection id attribute from a CC/CCC/CDL file.

virtual const char* OCIO_NAMESPACE::FormatMetadata::getName ( ) const
pure virtualnoexcept

Convenience method to easily get/set the 'name' attribute. This corresponds to the ProcessNode name attribute from a CLF / CTF file or the name key of a transform in the config YAML.

virtual int OCIO_NAMESPACE::FormatMetadata::getNumAttributes ( ) const
pure virtualnoexcept
virtual int OCIO_NAMESPACE::FormatMetadata::getNumChildrenElements ( ) const
pure virtualnoexcept
virtual FormatMetadata& OCIO_NAMESPACE::FormatMetadata::operator= ( const FormatMetadata rhs)
pure virtual
virtual void OCIO_NAMESPACE::FormatMetadata::setElementName ( const char *  )
pure virtual

Name has to be a non-empty string. Top-level element can't be renamed. 'ROOT' is reserved.

virtual void OCIO_NAMESPACE::FormatMetadata::setElementValue ( const char *  )
pure virtual
virtual void OCIO_NAMESPACE::FormatMetadata::setID ( const char *  id)
pure virtualnoexcept
virtual void OCIO_NAMESPACE::FormatMetadata::setName ( const char *  name)
pure virtualnoexcept

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