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

parameter.h

Go to the documentation of this file.
00001 
00002 // copyright (C) 1999-2003 by Tobias Erbsland <te@profzone.ch>
00003 // ------------------------------------------------------------------------
00004 // This program is free software; you can redistribute it and/or modify it
00005 // under the terms of the GNU General Public License as published by the
00006 // Free Software Foundation; either version 2 of the License, or (at your
00007 // option) any later version.
00008 // ========================================================================
00009 
00010 #ifndef PARAMETER_H
00011 #define PARAMETER_H
00012 #ifdef HAVE_CONFIG_H
00013 #include <config.h>
00014 #endif
00015 
00016 #include <string>
00017 #include <map>
00018 #include <list>
00019 
00026 class Parameter
00027 {
00028 
00029 private:
00031   const char * const str_unknown;
00033   const char * const str_none;
00034 
00035 public:
00046   enum param_e { FLAG, G_FLAG, STRING, G_STRING, INTEGER, G_INTEGER, DATE, G_DATE };
00047 
00050   struct param_t
00051   {
00054     std::string Info;
00057     std::string Help;
00060     param_e Typ;
00063     std::string Value;
00064   };
00065 
00069   struct param_user_t
00070   {
00073     param_t Param;
00076     std::list< Parameter * > User;
00077   };
00078 
00079 protected:
00083   std::map< std::string, param_t > mapParam;
00084 
00090   void addParam( const std::string &prefix, const std::string &info, const std::string &help,
00091                  const param_e typ, const std::string &value );
00095   long getIntParam( const std::string &prefix );
00099   std::string getStringParam( const std::string &prefix );
00103   bool getFlagParam( const std::string &prefix );
00104 
00105 public:
00106 
00107   Parameter();
00111   virtual std::map< std::string, param_t > &Param( void ) { return mapParam; };
00115   virtual const char * Prefix( void ) const = 0;
00118   virtual const char * Name( void ) const { return str_unknown; };
00121   virtual const char * Version( void ) const { return str_unknown; };
00125   virtual const char * Author( void ) const { return str_unknown; };
00128   virtual const char * Help( void ) const { return str_none; };
00131   virtual ~Parameter();
00132 };
00133 
00134 #endif

Generated on Wed Oct 15 13:54:51 2003 for Anteater.kdevelop by doxygen1.2.18