00001
00002
00003 #ifndef DBMCMDOPTIONS
00004 #define DBMCMDOPTIONS
00005
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00019
00020 #include <list>
00021 #include <map>
00022 #include <string>
00023
00024 #include "Rtypes.h"
00025
00026 class JobCommand;
00027
00028 class DbmCmdOptions
00029 {
00030
00031 public:
00032
00033
00034 DbmCmdOptions(const std::string& validOpts = "",
00035 JobCommand* jcmd = 0,
00036 const std::list<std::string>* defaultOpts =0);
00037
00038 virtual ~DbmCmdOptions();
00039
00040
00041 void GetOptIntList(const std::string& opt, std::list<int>& nos) const;
00042 Int_t GetOptInt(const std::string& opt) const;
00043 std::string GetOptString(const std::string& opt) const;
00044 std::string GetOpts() const;
00045 Bool_t IsValid() const { return fIsValid; }
00046 Bool_t IsValid(const std::string& opt) const;
00047 UInt_t NumOpts() const { return fOptsMap.size(); }
00048 Bool_t TestOpt(const std::string& opt) const;
00049
00050
00051 Bool_t AddOpt(const std::string& opt, JobCommand& jcmd);
00052 Bool_t AddOpt(const std::string& opt, const std::string& val);
00053 Bool_t ProcessCmd(JobCommand& jcmd,
00054 const std::list<std::string>* defaultOpts =0);
00055
00056
00057
00058
00059 Bool_t fIsValid;
00060 std::string fValidOpts;
00061 std::map<std::string,std::string> fOptsMap;
00062
00063
00064 ClassDef(DbmCmdOptions,0)
00065
00066 };
00067
00068
00069 #endif // DBMCMDOPTIONS