Newer
Older
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
#include "../inc/ConfigSvc.h"
#include "Poco/Util/LoggingConfigurator.h"
#include "Poco/Util/SystemConfiguration.h"
#include "Poco/Util/PropertyFileConfiguration.h"
namespace Mantid
{
// Initialise the instance pointer to zero
ConfigSvc* ConfigSvc::m_instance=0;
//private constructor
ConfigSvc::ConfigSvc()
{
//getting at system details
m_pSysConfig = new WrappedObject<Poco::Util::SystemConfiguration>;
m_pConf = 0;
}
//destructor
ConfigSvc::~ConfigSvc()
{
delete m_pSysConfig;
delete m_pConf;
}
void ConfigSvc::loadConfig(const std::string& filename)
{
delete m_pConf;
m_pConf = new WrappedObject<Poco::Util::PropertyFileConfiguration>(filename);
//configure the logging framework
Poco::Util::LoggingConfigurator configurator;
configurator.configure(m_pConf);
}
std::string ConfigSvc::getString(const std::string& keyName)
{
return m_pConf->getString(keyName);
}
int ConfigSvc::getInt(const std::string& keyName)
{
return 1;
}
double ConfigSvc::getDouble(const std::string& keyName)
{
return 1.0;
}
std::string ConfigSvc::getEnvironment(const std::string& keyName)
{
return m_pSysConfig->getString("system.env." + keyName);
}
std::string ConfigSvc::getOSName()
{
return m_pSysConfig->getString("system.osName");
}
std::string ConfigSvc::getOSArchitecture()
{
return m_pSysConfig->getString("system.osArchitecture");
}
std::string ConfigSvc::getComputerName()
{
return m_pSysConfig->getString("system.nodeName");
}
/* Removed as the use of these throughs a debug assertion about an invlid heap pointer
File dbgheap.c
Expression _CrtIsValidHeapPointer(pUserData)
std::string ConfigSvc::getOSVersion()
{
return m_pSysConfig->getString("system.osVersion");
}
std::string ConfigSvc::getCurrentDir()
{
return m_pSysConfig->getString("system.currentDir");
}
std::string ConfigSvc::getHomeDir()
{
return m_pSysConfig->getString("system.homeDir");
}
std::string ConfigSvc::getTempDir()
{
return m_pSysConfig->getString("system.tempDir");
}
*/