Enhance config file format.
[inoclam.git] / src / config.hxx
blob281dec81e733e408dad224f978994edeb3257eb2
1 /*
2 * inoclam - Inotify+ClamAV virus scanner
3 * Copyright (C) 2007 Vermont Department of Taxes
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 * Contributor(s):
20 * Tom Cort <tom.cort@state.vt.us>
21 * Matt Gagne <matt.gagne@state.vt.us>
24 #ifndef __CONFIG_HXX
25 #define __CONFIG_HXX
27 #include <list>
28 #include <confuse.h>
30 /**
31 * The default configuration file location.
33 #define DEFAULT_CONFIGFILE "/etc/inoclam.conf"
35 class config {
36 private:
37 char *directory;
39 cfg_bool_t file_email_enabled;
40 char *file_email_subject;
42 cfg_bool_t virus_removal_enabled;
43 cfg_bool_t virus_email_enabled;
44 char *virus_email_subject;
46 char *host;
47 int port;
48 char *from;
50 std::list<char*> *to;
51 public:
52 config();
53 ~config();
55 void setDirectory(char *new_dir);
56 char *getDirectory();
58 void setFileEMailEnabled(cfg_bool_t enabled);
59 cfg_bool_t getFileEMailEnabled();
60 void setFileEMailSubject(char *subject);
61 char *getFileEMailSubject();
63 void setVirusRemovalEnabled(cfg_bool_t enabled);
64 cfg_bool_t getVirusRemovalEnabled();
65 void setVirusEMailEnabled(cfg_bool_t enabled);
66 cfg_bool_t getVirusEMailEnabled();
67 void setVirusEMailSubject(char *subject);
68 char *getVirusEMailSubject();
70 char *getHost();
71 void setHost(char *h);
72 int getPort();
73 void setPort(int p);
74 char *getFrom();
75 void setFrom(char *f);
77 std::list<char*> *getTo();
78 void setTo(std::list<char*> *to);
81 /**
82 * Parses an inoclam.conf configuration file.
84 std::list<config::config*> *config_parse();
86 #endif