Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

configuration.h

Go to the documentation of this file.
00001 #ifndef CONFIGURATION_H
00002 #define CONFIGURATION_H
00003 // $Id: configuration.h,v 1.2 2001/04/12 15:26:18 dvermeir Exp $
00004 
00005 #include <iostream>
00006 #include <set>
00007 #include "expression.h"
00008 
00010 class Configuration {
00011 public:
00012   enum CRITERIUM { DATE, PATH, DOMAIN, NONE };
00013   Configuration();
00014   ~Configuration();
00015 
00016   CRITERIUM       format() const { return format_; }
00017   unsigned int    max_level() const { return max_level_; }
00018   const set<unsigned int>& levels() const { return levels_; }
00019   const Expression*     select() const { return select_; }
00020 
00021   bool parse(istream&);
00022 
00023 
00024   friend ostream& operator<<(ostream&,const Configuration&);
00025 
00026 protected: 
00027   bool parse_format(istream&);
00028   bool parse_select(istream&);
00029   bool parse_exclude(istream&);
00030   Expression* parse_expression(istream&);
00031   CRITERIUM parse_criterium(istream&);
00032   bool parse_levels(istream&,set<unsigned int>& levels);
00033   void add_expression(Expression* e);
00034 private:
00035   CRITERIUM         format_;
00036   set<unsigned int> levels_;
00037   unsigned int      max_level_;
00038   AndExpression*    select_;
00039 };
00040 
00041 ostream& operator<<(ostream&,const Configuration::CRITERIUM&);
00042 #endif
00043 

httpstats-stage02b [ 7 April, 2001]