File: config.h

package info (click to toggle)
sms-pl 2.1.0-4
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 376 kB
  • ctags: 355
  • sloc: cpp: 2,618; perl: 109; makefile: 103; sh: 26
file content (30 lines) | stat: -rw-r--r-- 662 bytes parent folder | download
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
#ifndef __config_h
#define __config_h

#include <map>
#include <string>
#include <iostream>

class Config {
	typedef std::map<const std::string, std::string> Params;
	Params params;

	void ReadFile(const std::string &filename = "");
	void ReadEnv();
	void ReadConfigFiles();
	std::string EmailAddress();
public:
	Config();

	void ReRead(const std::string &name);
	std::string &operator[](const std::string &name) { return params[name]; };
	void AddLine(const std::string &line);
	bool isTrue(const std::string &s);
	
	std::string ParseConfigLine(const std::string &line);
	void ReParse();
	
	friend std::ostream &operator<<(std::ostream &, Config &);
};

#endif