Subversion Repositories heating

Rev

Rev 3 | 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
31
	int port;
32
	char pidfile[128];
33
	char user[32];
34
	char group[32];
35
	// Part 2: heating
36
	char heatconf[128];			// Path to config file of heating
37
	char home[128];				// Path to directory with working database
5 andreas 38
	char serial[128];			// Path to serial device with digital thermometer
3 andreas 39
	// Part 3: Development
40
	bool debug;
41
}CONFIGURE;
42
 
43
extern CONFIGURE Configure;
44
 
45
class config : private helper
46
{
47
	public:
48
		config();
49
		bool is_initialized() { return initialized; }
50
		CONFIGURE getConfig();
51
 
52
	private:
53
		void readConf();
54
 
55
		bool initialized;
56
};
57
 
58
#endif