-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathconfig.h
61 lines (47 loc) · 1.84 KB
/
config.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#ifndef DAETOOLS_CONFIG_H
#define DAETOOLS_CONFIG_H
#include <string>
#if !defined(__MINGW32__) && (defined(_WIN32) || defined(WIN32) || defined(WIN64) || defined(_WIN64))
#ifdef DAE_DLL_INTERFACE
#ifdef CONFIG_EXPORTS
#define DAE_CONFIG_API __declspec(dllexport)
#else
#define DAE_CONFIG_API __declspec(dllimport)
#endif
#else
#define DAE_CONFIG_API
#endif
#else // WIN32
#define DAE_CONFIG_API
#endif // WIN32
class DAE_CONFIG_API daeConfig
{
public:
daeConfig();
~daeConfig(void);
public:
void Reload(void);
bool HasKey(const std::string& strPropertyPath) const;
bool GetBoolean(const std::string& strPropertyPath);
double GetFloat(const std::string& strPropertyPath);
int GetInteger(const std::string& strPropertyPath);
std::string GetString(const std::string& strPropertyPath);
bool GetBoolean(const std::string& strPropertyPath, const bool defValue);
double GetFloat(const std::string& strPropertyPath, const double defValue);
int GetInteger(const std::string& strPropertyPath, const int defValue);
std::string GetString(const std::string& strPropertyPath, const std::string& defValue);
void SetBoolean(const std::string& strPropertyPath, const bool value);
void SetFloat(const std::string& strPropertyPath, const double value);
void SetInteger(const std::string& strPropertyPath, const int value);
void SetString(const std::string& strPropertyPath, const std::string& value);
static daeConfig& GetConfig(void);
static std::string GetBONMINOptionsFile();
static std::string GetConfigFolder();
std::string toString(void) const;
std::string GetConfigFileName(void) const;
protected:
std::string configfile;
};
DAE_CONFIG_API void daeSetConfigFile(const std::string& strConfigFile);
DAE_CONFIG_API daeConfig& daeGetConfig(void);
#endif