VideoCodec/Configuration/ConfigurationElement.h
#ifndef CONFIGURATIONELEMENT_H_
#define CONFIGURATIONELEMENT_H_
#define CONFIGURATION_PAIRS 0
#define CONFIGURATION_LIST 1
#define CONFIGURATION_STRING 2
#define CONFIGURATION_INTEGER 3
#define CONFIGURATION_FLOAT 4
#define CONFIGURATION_EMPTY 5
#include <map>
#include <vector>
#include <string>
#include <stdio.h>
using namespace std;
namespace VideoCodec
{
struct stringComparer
{
bool operator()(std::string* s1, std::string* s2) const
{
return *s1 < *s2;
}
};
class ConfigurationElement;
typedef map<string*, ConfigurationElement*, stringComparer> configurationPairs;
typedef vector<ConfigurationElement*> configurationList;
class ConfigurationElement
{
public:
ConfigurationElement();
virtual ~ConfigurationElement();
void SetPairs(configurationPairs* pairs);
void SetList(vector<ConfigurationElement*>* list);
void SetString(string* value);
void SetInteger(int* value);
void SetFloat(float* value);
int GetType();
ConfigurationElement* GetValue(string path);
configurationPairs* GetPairs();
vector<ConfigurationElement*>* GetList();
std::string* GetString();
int* GetInteger();
float* GetFloat();
private:
configurationPairs* pairs;
vector<ConfigurationElement*>* list;
std::string* stringValue;
int* intValue;
float* floatValue;
int type;
};
}
#endif /*CONFIGURATIONELEMENT_H_*/