Fixed SMTP code code style
[fmail.git] / include / libfmail / configuration.h
blob32f882780b6a173ca6787c10d5271bb8714516b1
1 /*
2 libfmail: Simple Configuration Class
4 Copyright (C) 2007 Carlos Daniel Ruvalcaba Valenzuela <clsdaniel@gmail.com>
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License along
17 with this program; if not, write to the Free Software Foundation, Inc.,
18 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21 class Configuration{
22 private:
23 std::map<std::string, std::string> conf_map;
24 public:
25 Configuration(const char *filename = 0);
26 ~Configuration();
28 int Load(const char *filename);
29 int Save(const char *filename);
31 std::string getString(const char *key, const char *default_value);
32 const char *getCString(const char *key, const char *default_value);
33 int getInt(const char *key, int default_value);
34 float getFloat(const char *key, float default_value);
36 void setString(const char *key, const char *value);
37 void setInt(const char *key, int value);
38 void setFloat(const char *key, float value);