Wittyshare  0.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
WsLayoutProperties.cpp
Go to the documentation of this file.
1 /*
2  *
3  * Filename: WsLayoutProperties.cpp
4  *
5  * Description:
6  *
7  * Created: 03/29/2012 03:47:05 PM
8  *
9  * Author: Benoit Daccache, ben.daccache@gmail.com
10  *
11  */
12 
13 #include "WsLayoutProperties.h"
14 
15 #include <Logger/WsLogger.h>
16 
17 #include <Include/WsGlobalConfig.h>
18 
19 using namespace Json;
20 
22 
25 {
26 }
27 
29 {
30  if (m_instance == 0) {
32  LOG(DEBUG) << "WsLayoutProperties::instance() : Created instance";
33  }
34  return m_instance;
35 }
36 
37 std::string WsLayoutProperties::get(const std::string& section, const std::string& id, const std::string& def)
38 {
39  if (!m_parsed) {
41  }
42  Value val = m_root[section][id];
43  if (val == Value::null)
44  return def;
45  else
46  return val.asString();
47 }
#define DEBUG
Definition: WsLogger.h:27
Layout Properties.
int parse(const std::string &path)
parse the Json config file
#define LOG
Definition: WsLogger.h:22
Abstract Properties class.
const std::string Value
Definition: WsRequestType.h:39
static WsLayoutProperties * m_instance
std::string get(const std::string &section, const std::string &id, const std::string &def)
static WsLayoutProperties * instance()
Get the singleton instance.
WsLayoutProperties()
Default Constructor.
const std::string LayoutPropertiesPath