Subversion Repositories heating

Rev

Rev 17 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
3 andreas 1
/*
2
 * Copyright (C) 2015 by Andreas Theofilu. All rights reserved!
3
 *
4
 * All rights reserved. No warranty, explicit or implicit, provided.
5
 *
6
 * NOTICE:  All information contained herein is, and remains
7
 * the property of Andreas Theofilu and his suppliers, if any.
8
 * The intellectual and technical concepts contained
9
 * herein are proprietary to Andreas Theofilu and its suppliers and
10
 * may be covered by European and Foreign Patents, patents in process,
11
 * and are protected by trade secret or copyright law.
12
 * Dissemination of this information or reproduction of this material
13
 * is strictly forbidden unless prior written permission is obtained
14
 * from Andreas Theofilu.
15
 * 
16
 * Author: Andreas Theofilu <andreas@theosys.at>
17
 */
18
#ifndef __CONFIG_H__
19
#define __CONFIG_H__
20
 
21
#include <iostream>   // std::cout
22
#include <string>     // std::basic_string, std::char_traits
23
#include <cctype>     // std::tolower
24
#include <cstddef>    // std::size_t
25
 
26
#include "helper.h"
27
 
28
typedef struct CONFIGURE
29
{
30
	// Part 1: Daemon
17 andreas 31
	int port;					// Port number the daemon will listen on
32
	char pidfile[128];			// The where the daemon writes it current PID
33
	char user[32];				// The user the daemon will use to run
34
	char group[32];				// The group the daemon will use to run
35
	int html_port;				// The port number a HTML server should listen on
3 andreas 36
	// Part 2: heating
37
	char heatconf[128];			// Path to config file of heating
38
	char home[128];				// Path to directory with working database
5 andreas 39
	char serial[128];			// Path to serial device with digital thermometer
3 andreas 40
	// Part 3: Development
41
	bool debug;
42
}CONFIGURE;
43
 
44
extern CONFIGURE Configure;
54 andreas 45
extern bool bcmInitialized;
3 andreas 46
 
47
class config : private helper
48
{
49
	public:
50
		config();
51
		bool is_initialized() { return initialized; }
52
		CONFIGURE getConfig();
53
 
54
	private:
55
		void readConf();
56
 
57
		bool initialized;
58
};
59
 
60
#endif