ApplicationConfig.h
2.47 KB
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
#ifndef APPLICATIONCONFIG_H
#define APPLICATIONCONFIG_H
#include <string>
#include <map>
#include "../Common/TREPSTypes.h"
using namespace std;
using namespace TREPS::Common;
namespace TREPS
{
namespace Application
{
typedef map<const string, string> AppConfMap;
class ApplicationConfigClass
{
public :
ApplicationConfigClass(const char *appPath);
//load config file
bool load(const char *configFile);
//get workind dir path. All workind dir will be create in this dir
string getWorkingDirPath(void);
//get data dir (contain time formats definition file, logger config file, etc...)
string getDataDirPath(void);
//get xsd dir for xml validation
string getXSDDirPath(void);
//get the full path of the frames definition file
string getFramesFilePath(void);
//get the full path of the time formats definition file
string getTimesFilePath(void);
//get the full path of the units definition file
string getUnitsFilePath(void);
//get the full path of the exports definition file
string getExportsFilePath(void);
//get the full path of the file formats definition file
string getFormatsFilePath(void);
//proxy username to use
string getProxyUsername(void);
//proxy password to use
string getProxyPassword(void);
//get full path to the logger config file
string getLog4cxxConfigPath(void);
//get the logger name
string getLog4cxxLoggerName(void);
//get tags used to detect automatically a frame in a file
t_StringList getFramesTags(void);
//get the char used for ASCII header line
//default value to '#'
char getASCIIHeaderChar(void);
//use cache
//not finished and with some bugs => forced to false
bool getUseCache(void);
//life time of a working dir before to delete (in seconds)
//default to 86400 s
long int getWorkingDirLifeTime(void);
//max file size for source file (in octets)
//default to 20971520 octets (20 Mo)
long int getMaxSourceFileSize(void);
//max file records for source file
//default to 100000
long int getMaxSourceFileRecords(void);
//base URL to the CDPP/3DView tool
string get3DViewWSBaseURL(void);
private :
//current application path
string appPath;
//map that contains all config var
AppConfMap map;
//get config var
string get(const char *var);
//get config var list (the separator is a coma ',')
t_StringList getList(const char *var);
};
}
}
#endif