-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathGConfig.h
executable file
·75 lines (63 loc) · 2.22 KB
/
GConfig.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
62
63
64
65
66
67
68
69
70
71
72
73
74
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/*
* File: Config.h
* Author: gedas
*
* Created on Antradienis, 2016, balandis 5, 23.10
*/
#ifndef CONFIG_H
#define CONFIG_H
#include <libconfig.h++>
#include "GObject.h"
#include "GLogger.h"
namespace GServer {
class GLogger;
class GObject;
class GConfig : public GObject {
public:
// ##### Kintamieji #####
// ##### END Kintamieji #####
// #####################################################################
// ##### Metodai #####
GConfig(GServer::GLogger* logger);
virtual ~GConfig();
/** getSetting **
* Metodas skirtas grazinti prasomo nustatymo reiksme, stringo pavidale
* name- nurimo nustatymo pavadinimas */
std::string getStringSetting(std::string name);
int getIntSetting(std::string name);
bool getBoolSetting(std::string name);
// ##### END Metodai #####
private:
// ##### Kintamieji #####
/** CONFIG_FILE_NAME **
* Kintamasis skirtas saugoti konfiguracinio failo pavadinima */
const std::string CONFIG_FILE_NAME;
/** logger **
* Kintamasis skirtas saugoti nuoroda i pranesimu rasymo objekta */
GServer::GLogger* logger;
/** conf **
* Kintamasis skirtas saugoti nuoroda i konfiguracinio failo nuskaitymo
* objekta */
libconfig::Config* conf;
// ##### END Kintamieji #####
// #####################################################################
// ##### Metodai #####
/** openConfigFile **
* Metodas skritas atverti ir pradeti nustatymu nuskaityma is nustatymu
* failo. */
void openConfigFile();
/** openSetting **
* Metodas skirtas nuskaityti norimą nustatyma.
* name- ieskomo nustatymu pavadinimas
* returnValue - kintasis, i kuri bus grazinama nuskaityta reiksme */
template<typename TYPE>
void openSetting(std::string name, TYPE &returnValue);
// ##### END Metodai #####
};
}
#endif /* CONFIG_H */