source: trunk/MagicSoft/Mars/mbase/MArgs.h@ 2273

Last change on this file since 2273 was 2273, checked in by tbretz, 21 years ago
*** empty log message ***
File size: 1.2 KB
Line 
1#ifndef MARS_MArgs
2#define MARS_MArgs
3
4#ifndef MARS_MAGIC
5#include "MAGIC.h"
6#endif
7
8#ifndef ROOT_TNamed
9#include <TNamed.h>
10#endif
11
12#ifndef ROOT_TList
13#include <TList.h>
14#endif
15
16class MArgsEntry : public TString, public TObject
17{
18public:
19 MArgsEntry(const char *c) : TString(c), TObject() {}
20
21 void Print(const Option_t *o) const;
22
23 ClassDef(MArgsEntry, 0)
24};
25
26class MArgs : public TNamed
27{
28private:
29 Int_t fArgc;
30 TList fArgv;
31
32public:
33 MArgs(int argc, const char **argv);
34
35 void Print(const Option_t *o="") const;
36
37 // FIXME: Add max, min option
38 // FIXME: Add default option
39
40 Int_t GetInt(const TString name) const;
41 Double_t GetFloat(const TString name) const;
42 TString GetString(const TString name) const;
43
44 Int_t GetIntAndRemove(const TString name);
45 Double_t GetFloatAndRemove(const TString name);
46 TString GetStringAndRemove(const TString name);
47
48 Bool_t Has(const TString name) const;
49 Bool_t HasOption(const TString name) const;
50
51 TString GetArgumentStr(Int_t i) const;
52 Int_t GetArgumentInt(Int_t i) const;
53 Float_t GetArgumentFloat(Int_t i) const;
54 Int_t GetNumArguments() const;
55
56 ClassDef(MArgs, 0) //Class to parse command line arguments
57};
58
59#endif
Note: See TracBrowser for help on using the repository browser.