-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfbConfig.h
More file actions
71 lines (56 loc) · 1.44 KB
/
fbConfig.h
File metadata and controls
71 lines (56 loc) · 1.44 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
/* $Id: fbConfig.h,v 1.8 2008/04/23 00:41:11 ctubbsii Exp $ */
/*
* Copyright (c) 2008 Chris Tubbs
* All rights reserved.
* Do whatever you want with this code.
*
*/
#ifndef FBCONFIG_H
#define FBCONFIG_H
#include "global.h"
#include "fbErrorLogger.h"
#define FBCONFIG_DEFAULT_ADDR "127.0.0.1"
#define FBCONFIG_DEFAULT_PORT 8080
#define FBCONFIG_DEFAULT_WEBROOT "/usr/local/share/flashback/www/"
#define FBCONFIG_DEFAULT_DBPATH "/var/flashback/flashback.db"
#ifdef WIN32
#define FBCONFIG_DEFAULT_CONFIGFILE "flashback.txt"
#else
#define FBCONFIG_DEFAULT_CONFIGFILE "/etc/flashback"
#endif
/**
* fbConfig
*
* Provides an interface for loading and saving configuration data.
* @author Christopher Tubbs
* @date March 18, 2008
*/
class fbConfig
{
public:
fbConfig(fbErrorLogger* err);
fbConfig(fbErrorLogger* err, const char* filename);
~fbConfig();
void loadDefaults();
int load();
int save();
void setWebServerAddr(const string& strAddr);
void setWebServerPort(const int port);
void setWebServerRootPath(const string& strPath);
void setDBPath(const string& strPath);
string& getWebServerAddr();
int getWebServerPort();
string& getWebServerRootPath();
string& getDBPath();
private:
int load(const char *filename);
int save(const char *filename);
void setWebServerPort(const string& strPort);
string addr;
string webroot;
string dbpath;
int port;
fbErrorLogger* errlog;
bool dirty;
};
#endif