// -*- mode: c++ -*- // // $Id: BrAppOptionManager.h,v 1.3 2001/12/14 15:28:24 cholm Exp $ // #ifndef BRAT_BrAppOptionManager #define BRAT_BrAppOptionManager #ifndef ROOT_TString #include "TString.h" #endif #ifndef ROOT_TObjArray #include "TObjArray.h" #endif #ifndef ROOT_THashList #include "THashList.h" #endif #ifndef BRAT_BrAppOption #include "BrAppOption.h" #endif class BrAppOptionManager : public TObject { private: // TObjArray* fTable; THashList* fTable; Int_t fMajorVersion; Int_t fMinorVersion; TString fProgName; TString fHelpString; TString fVersionString; BrAppBoolOption* fHelpOption; BrAppBoolOption* fVersionOption; void AddHelpVersion(); void SetOptionValue(Char_t option, Char_t* value); void SetOptionValue(Char_t* option, Char_t* value); Bool_t ProcessLongOption(Char_t* argument); Bool_t ProcessShortOption(Char_t option, Bool_t& killNext, Char_t* value=0); Char_t** fArgv; Int_t* fArgc; Bool_t fIsOk; Bool_t fHasParsed; static BrAppOptionManager* fgInstance; public: BrAppOptionManager(); static BrAppOptionManager* Instance(); void AddOption(BrAppOption* option, Bool_t internal=kFALSE); BrAppOption* GetOption(Char_t option); BrAppOption* GetOption(Char_t* option); Bool_t IsOk() const { return fIsOk; } Bool_t HasParsed() const { return fHasParsed; } Bool_t ProcessCommandLine(); void SetCommandLine(Int_t& argc, Char_t** argv); void SetHelp(const Char_t* str=0); void SetVersion(Int_t major=0, Int_t minor=1, const Char_t* str=0); Bool_t ShowHelp(void); Bool_t ShowVersion(void); void Print(Option_t* option="") const; ClassDef(BrAppOptionManager,0) // Option mananger class } ; #endif // // $Log: BrAppOptionManager.h,v $ // Revision 1.3 2001/12/14 15:28:24 cholm // BrAppOption sublcasses now adds them selves to BrAppOptionManager // automatically. Also, the int, float, and string option class can now // hold multiple values. It's all fairly well documented in 'The Guide'. // // Revision 1.2 2001/08/21 14:24:57 cholm // Added member fHasParsed, so that we can check if we've parsed the // commandline. Not really needed now, but I left it in anyway. No real // harm in that. // // Revision 1.1.1.1 2001/06/21 14:55:15 hagel // Initial revision of brat2 // // Revision 1.2 2001/03/07 12:15:20 cholm // * Defined standard BrModule methods in BrIOModule. // * Add the (simple) class BrHistIOModule. // * BrAppOptionManager and BrAppOption classes changed to not use // BrExceptions. // * Added the method Int_t BrMainModule::Main() to do EVERYTHING. // * Made the method BrModule::Info() const obsolete in favour of // BrModule::Print(Option_t* option="B") const. Impact on other classes. // // Revision 1.1 2000/04/06 20:17:05 cholm // Added the classes BrAppOption, BrAppOptionManager, and // BrDetectorList. The first two are for command line processing, // the third for easy detector list, can be used for many purposes //