OpenDAFF C++ API  v1.7
Directional Audio File Format
Public Types | Public Member Functions | Static Public Member Functions | List of all members
DAFFMetadata Class Referenceabstract

Metadata interface. More...

#include <DAFFMetadata.h>

Inheritance diagram for DAFFMetadata:
DAFFMetadataImpl

Public Types

enum  { DAFF_BOOL =0, DAFF_INT =1, DAFF_FLOAT =2, DAFF_STRING =3 }
 Metadata types. More...
 

Public Member Functions

virtual ~DAFFMetadata ()
 Destructor. More...
 
virtual bool isEmpty () const =0
 Returns if metadata does not contain any keys. More...
 
virtual bool hasKey (const std::string &sKey) const =0
 Checks for existence of a key. More...
 
virtual void getKeys (std::vector< std::string > &vsKeyList) const =0
 Returns a list of all keys. More...
 
virtual int getKeyType (const std::string &sKey) const =0
 Returns the datatype of a key. More...
 
virtual std::string getKeyString (const std::string &sKey) const =0
 Returns the value of a string key. More...
 
virtual bool getKeyBool (const std::string &sKey) const =0
 Returns the value (true|false) of a boolean key. More...
 
virtual int getKeyInt (const std::string &sKey) const =0
 Returns the value of a integer number key. More...
 
virtual double getKeyFloat (const std::string &sKey) const =0
 Returns the value of a floating-point number key. More...
 
virtual std::string toString () const =0
 Return information on the metadata as string. More...
 

Static Public Member Functions

static std::string GetKeyTypeString (int iType)
 Returns a string describing the key type. More...
 

Detailed Description

Metadata interface.

This purely abstract class defines the interface for accessing the metadata of DAFF files. The metadata contains an arbitrary number of (key, value) pairs. Keys are indexed by their name (case-insensitive). Values are types. Valid datatypes are boolean, integer, floating-point and string.

Note: The method getKeyString can be used for each key datatype. Other methods cause errors when they are called on keys of wrong datatype. (e.g. getKeyBool for a floating-point key)

Definition at line 31 of file DAFFMetadata.h.

Member Enumeration Documentation

anonymous enum

Metadata types.

Enumerator
DAFF_BOOL 
DAFF_INT 
DAFF_FLOAT 
DAFF_STRING 

Definition at line 35 of file DAFFMetadata.h.

Constructor & Destructor Documentation

virtual DAFFMetadata::~DAFFMetadata ( )
inlinevirtual

Destructor.

Definition at line 43 of file DAFFMetadata.h.

Member Function Documentation

virtual bool DAFFMetadata::getKeyBool ( const std::string &  sKey) const
pure virtual

Returns the value (true|false) of a boolean key.

Implemented in DAFFMetadataImpl.

virtual double DAFFMetadata::getKeyFloat ( const std::string &  sKey) const
pure virtual

Returns the value of a floating-point number key.

Note: This method may also be called for INT keys

Implemented in DAFFMetadataImpl.

virtual int DAFFMetadata::getKeyInt ( const std::string &  sKey) const
pure virtual

Returns the value of a integer number key.

Implemented in DAFFMetadataImpl.

virtual void DAFFMetadata::getKeys ( std::vector< std::string > &  vsKeyList) const
pure virtual

Returns a list of all keys.

Implemented in DAFFMetadataImpl.

virtual std::string DAFFMetadata::getKeyString ( const std::string &  sKey) const
pure virtual

Returns the value of a string key.

Note: This method may be called for every key, no matter what type

Implemented in DAFFMetadataImpl.

virtual int DAFFMetadata::getKeyType ( const std::string &  sKey) const
pure virtual

Returns the datatype of a key.

Implemented in DAFFMetadataImpl.

static std::string DAFFMetadata::GetKeyTypeString ( int  iType)
inlinestatic

Returns a string describing the key type.

Definition at line 46 of file DAFFMetadata.h.

virtual bool DAFFMetadata::hasKey ( const std::string &  sKey) const
pure virtual

Checks for existence of a key.

Implemented in DAFFMetadataImpl.

virtual bool DAFFMetadata::isEmpty ( ) const
pure virtual

Returns if metadata does not contain any keys.

Implemented in DAFFMetadataImpl.

virtual std::string DAFFMetadata::toString ( ) const
pure virtual

Return information on the metadata as string.

Implemented in DAFFMetadataImpl.


The documentation for this class was generated from the following file:
OpenDAFF is a project from the Institute of Technical Acoustics, RWTH Aachen University, Germany.