*** empty log message ***
[h316.git] / pc-tools / ldc2 / src / configuration_manager.hh
index 7849edf13cfdd46a827bae03722605a646a9d8b3..ffd77218a361074c40f832b325044858d20b9b6e 100644 (file)
@@ -23,36 +23,49 @@ using namespace std;
  *     (You want!!!)
  * Sould be easy to use..... Enjoy.
  */
-class argument_reader{
+class configuration_manager{
   
 public:
-  argument_reader(string name);
+  configuration_manager(string name);
 
-  void add_param (string  shortname,
-                 string  longname, 
-                 string  description, 
-                 int    *status, 
-                 bool    allow_commandline=true,
-                 bool    allow_config_file=true,
-                 string *target=NULL, 
-                 string  placeholder=string("<string>")
-                 );
+  void add_option_switch (string  shortname,
+                  string  longname, 
+                  string  description, 
+                  int    *status, 
+                  bool    allow_commandline=true,
+                  bool    allow_config_file=true
+                  );
+
+  void add_option_value (string  shortname,
+                  string  longname, 
+                  string  description, 
+                  int    *status, 
+                  bool    allow_commandline=true,
+                  bool    allow_config_file=true,
+                  string *target=NULL, 
+                  string  placeholder=string("<string>")
+                  );
   
+  void add_argument (string  longname, 
+                    string  description, 
+                    int    *status, 
+                    string *target=NULL, 
+                    string  placeholder=string("<string>")
+                    );
+
   vector<string> read_args(int argc, char ** args);
   vector<string> read_file(string filename);
  
   void get_help (vector<string> & target);
   vector<string> get_help();
 
-  void add_argument(string placeholder, string description, int * status, string * target);
-
 private:
   /*!
-   *\brief Container for one command line option.
+   *\brief Container for an option switch
    */
-  class opt_t{
+   class opt_switch_t{
   public:
-    opt_t (string shortname, string longname,string description, int * status, 
+    opt_switch_t (string shortname, string longname,string description, int * status 
               string * target=NULL, string placeholder=string("<string>"));
     string shortname;
     string longname;
@@ -61,11 +74,27 @@ private:
     string description;
     string placeholder;
   };
+  /*!
+   *\brief Container for an option value
+   */
+class opt_value_t{
+  public:
+  switch_t (string shortname, string longname,string description, int * status 
+           string * target=NULL, string placeholder=string("<string>"));
+  string shortname;
+  string longname;
+  int * status;
+  string * target;    
+  string description;
+  string placeholder;
+  bool allow_conffile;
+  bool allow_cmdline;
+};
 
   /*!
-   *\brief Container for one command line argument.
+   *\brief Container for a commandline argument
    */
-  class arg_t{
+  class cmd_arg_t{
   public:
     arg_t (string placeholder,string description,
                    int * status, string * target);
@@ -74,11 +103,13 @@ private:
     string description;
     string placeholder;
   };
-  vector<opt_t>opt_v;
-  vector<arg_t>arg_v;
+  
+  vector<opt_switch_t>option_switches;
+  vector<opt_value_t>option_values;
+  vector<cmd_arg_t>cmd_args;
   string app_name;
 
-}; // class argument_reader
+}; // class configuration_manager
 
 
 #endif