conf.h

Go to the documentation of this file.
00001 /* Log configuration directives.
00002  *
00003  * PegSoft log subsystem library (c) 2005 PegSoft
00004  * Contact us at pegsoft@pegsoft.net
00005  *
00006  * This program is free software; you can redistribute it and/or modify
00007  * it under the terms of the GNU General Public License version 2 as
00008  * published by the Free Software Foundation.
00009  *
00010  * This program is distributed in the hope that it will be useful, but
00011  * WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013  * General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU General Public License
00016  * along with this software (the COPYING file); if not, write to the
00017  * Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139,
00018  * USA.
00019  *
00020  */
00021 
00027 #ifndef LOG_CONF_H
00028 #define LOG_CONF_H
00029 
00030 /*************************************************************************/
00031 
00032 # include <conf/directives.h>
00033 
00034 /*************************************************************************/
00035 
00037 
00038 namespace xlog
00039 {
00040 
00041 /*************************************************************************/
00042 
00043 class LogLevel;
00044 
00045 /*************************************************************************/
00046 
00048 
00053 class LogRules : public conf::ConfRules
00054 {
00055     public:
00057         enum
00058         {
00060             lrAccept = 1,
00062             lrReject = 0
00063         };
00064         
00066         LogRules(std::string const &name, bool reloadable) :
00067                 conf::ConfRules(name, reloadable),
00068                 m_accept("accept", reloadable, m_rules, lrAccept),
00069                 m_reject("reject", reloadable, m_rules, lrReject) { }
00071         LogRules(LogRules const &lr) : conf::ConfRules(lr),
00072                 m_accept(lr.m_accept), m_reject(lr.m_reject) { }
00074         virtual LogRules &operator=(LogRules const &right);
00075         
00077 
00082         ConfRules::Rule const *match(LogLevel const &level) const;
00083     protected:
00084         virtual bool add(conf::Conf &conf, conf::Conf &new_conf);
00085     private:
00086         ConfRule m_accept;
00087         ConfRule m_reject;
00088 };
00089 
00090 /*************************************************************************/
00091 
00092 } /* namespace xlog */
00093 
00094 /*************************************************************************/
00095 
00096 #endif /* LOG_CONF_H */

Generated on Wed Aug 15 00:37:21 2007 for Epona API by  doxygen 1.5.2