OpenDAFF C++ API  v1.7
Directional Audio File Format
DAFFMetadataImpl.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_METADATAIMPL
13 #define IW_DAFF_METADATAIMPL
14 
15 #include <DAFFMetadata.h>
16 #include <map>
17 
18 // Forward declarations
19 class DAFFMetadataKey;
20 
22 {
23 public:
26 
27  // Load data from a buffer
28  int load( void* pData, size_t &iBytesRead );
29 
30  // --= Implementation of the interface "DAFFMetadata" =--
31 
32  bool isEmpty() const;
33  bool hasKey(const std::string& sKey) const;
34  void getKeys(std::vector< std::string >& vsKeyList) const;
35  int getKeyType(const std::string& sKey) const;
36  std::string getKeyString(const std::string& sKey) const;
37  bool getKeyBool(const std::string& sKey) const;
38  int getKeyInt(const std::string& sKey) const;
39  double getKeyFloat(const std::string& sKey) const;
40 
41  std::string toString() const;
42 
43 private:
44  typedef std::pair<std::string, DAFFMetadataKey*> KeyPair;
45  typedef std::map<std::string, DAFFMetadataKey*> KeyMap;
46  typedef std::map<std::string, DAFFMetadataKey*>::const_iterator KeyMapConstIterator;
47 
48  KeyMap m_mKeys;
49 
51  void insertKey(const std::string& sName, DAFFMetadataKey* pKey);
52 
54  const DAFFMetadataKey* findKey(const std::string& sKey) const;
55 
57  static void deleteMetadataKeyPair(const KeyPair& pKeyPair);
58 };
59 
60 #endif // IW_DAFF_METADATAIMPL
std::string getKeyString(const std::string &sKey) const
Returns the value of a string key.
std::string toString() const
Return information on the metadata as string.
bool getKeyBool(const std::string &sKey) const
Returns the value (true|false) of a boolean key.
void getKeys(std::vector< std::string > &vsKeyList) const
Returns a list of all keys.
bool isEmpty() const
Returns if metadata does not contain any keys.
bool hasKey(const std::string &sKey) const
Checks for existence of a key.
int load(void *pData, size_t &iBytesRead)
int getKeyInt(const std::string &sKey) const
Returns the value of a integer number key.
Metadata interface.
Definition: DAFFMetadata.h:31
double getKeyFloat(const std::string &sKey) const
Returns the value of a floating-point number key.
int getKeyType(const std::string &sKey) const
Returns the datatype of a key.
OpenDAFF is a project from the Institute of Technical Acoustics, RWTH Aachen University, Germany.