OpenDAFF C++ API  v1.7
Directional Audio File Format
DAFFMetadata.h
Go to the documentation of this file.
1 /*
2  * -------------------------------------------------------------------------------------
3  *
4  * OpenDAFF - A free, open source software package for directional audio data
5  * Copyright 2016 Institute of Technical Acoustics, RWTH Aachen University
6  * OpenDAFF is distributed under the Apache License Version 2.0.
7  *
8  * ------------------------------------------------------------------------------------
9  *
10  */
11 
12 #ifndef IW_DAFF_METADATA
13 #define IW_DAFF_METADATA
14 
15 #include <DAFFDefs.h>
16 #include <string>
17 #include <vector>
18 
20 
32 {
33 public:
35  enum {
36  DAFF_BOOL=0, //<! Boolean (true|false, yes|no)
37  DAFF_INT=1, //<! Integer number
38  DAFF_FLOAT=2, //<! Floating-point number
39  DAFF_STRING=3 //<! String
40  };
41 
43  inline virtual ~DAFFMetadata() {};
44 
46  static inline std::string GetKeyTypeString( int iType )
47  {
48  switch( iType )
49  {
51  return "String";
53  return "Bool";
55  return "Float";
57  return "Integer";
58  default:
59  return "Unkown";
60  }
61  };
62 
64  virtual bool isEmpty() const=0;
65 
67  virtual bool hasKey(const std::string& sKey) const=0;
68 
70  virtual void getKeys(std::vector< std::string >& vsKeyList) const=0;
71 
73  virtual int getKeyType(const std::string& sKey) const=0;
74 
76 
79  virtual std::string getKeyString(const std::string& sKey) const=0;
80 
82  virtual bool getKeyBool(const std::string& sKey) const=0;
83 
85  virtual int getKeyInt(const std::string& sKey) const=0;
86 
88 
91  virtual double getKeyFloat(const std::string& sKey) const=0;
92 
94  virtual std::string toString() const=0;
95 };
96 
97 #endif // IW_DAFF_METADATA
#define DAFF_API
Definition: DAFFDefs.h:29
static std::string GetKeyTypeString(int iType)
Returns a string describing the key type.
Definition: DAFFMetadata.h:46
Metadata interface.
Definition: DAFFMetadata.h:31
virtual ~DAFFMetadata()
Destructor.
Definition: DAFFMetadata.h:43
OpenDAFF is a project from the Institute of Technical Acoustics, RWTH Aachen University, Germany.