Wittyshare
0.2
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Pages
wscore
src
ConfigManager
WsAbstractProperties.cpp
Go to the documentation of this file.
1
14
#include "
WsAbstractProperties.h
"
15
16
#include <
Include/WsGlobalConfig.h
>
17
#include <
Logger/WsLogger.h
>
18
19
#include <fstream>
20
21
using namespace
Json;
22
23
WsAbstractProperties::WsAbstractProperties
():
24
m_parsed(false)
25
{
26
}
27
28
int
WsAbstractProperties::parse
(
const
std::string& path)
29
{
30
Reader reader;
31
std::ifstream conf(path.c_str(), std::ifstream::binary);
32
if
(! conf.good()) {
33
LOG
(
DEBUG
) <<
"WsAbstractProperties::parse() : Conf file not found : "
<< path;
34
m_parsed
=
true
;
35
return
ErrorCode::Success
;
36
}
37
bool
bOk = reader.parse(conf,
m_root
,
false
);
38
conf.close();
39
if
( !bOk ) {
40
/* Parse failed */
41
return
ErrorCode::Failure
;
42
}
else
{
43
m_parsed
=
true
;
44
return
ErrorCode::Success
;
45
}
46
}
47
DEBUG
#define DEBUG
Definition:
WsLogger.h:27
WsLogger.h
ErrorCode::Failure
const int Failure
Definition:
WsGlobalConfig.h:21
WsAbstractProperties::parse
int parse(const std::string &path)
parse the Json config file
Definition:
WsAbstractProperties.cpp:28
WsAbstractProperties::m_root
Json::Value m_root
Definition:
WsAbstractProperties.h:60
LOG
#define LOG
Definition:
WsLogger.h:22
WsAbstractProperties::WsAbstractProperties
WsAbstractProperties()
Default constructor.
Definition:
WsAbstractProperties.cpp:23
WsGlobalConfig.h
WsAbstractProperties::m_parsed
bool m_parsed
Definition:
WsAbstractProperties.h:66
ErrorCode::Success
const int Success
Definition:
WsGlobalConfig.h:20
WsAbstractProperties.h
Abstract class for properties.
Generated on Wed Apr 23 2014 14:00:10 for Wittyshare by
1.8.6