BRAT 2.4.5
Class index
Full class index
brahmlib
BRAHMS
ROOT page

BrAppOptionManager


class description - source file - inheritance tree

class BrAppOptionManager : public TObject

    private:
void AddHelpVersion() Bool_t ProcessLongOption(Char_t* argument) Bool_t ProcessShortOption(Char_t option, Bool_t& killNext, Char_t* value = "0") void SetOptionValue(Char_t option, Char_t* value) void SetOptionValue(Char_t* option, Char_t* value) public:
BrAppOptionManager BrAppOptionManager() BrAppOptionManager BrAppOptionManager(BrAppOptionManager&) void ~BrAppOptionManager() void AddOption(BrAppOption* option, Bool_t internal = kFALSE) static TClass* Class() BrAppOption* GetOption(Char_t option) BrAppOption* GetOption(Char_t* option) Bool_t HasParsed() const static BrAppOptionManager* Instance() virtual TClass* IsA() const Bool_t IsOk() const virtual void Print(Option_t* option) const 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() virtual void ShowMembers(TMemberInspector& insp, char* parent) Bool_t ShowVersion() virtual void Streamer(TBuffer& b) void StreamerNVirtual(TBuffer& b)

Data Members

    private:
THashList* fTable Int_t fMajorVersion Int_t fMinorVersion TString fProgName TString fHelpString TString fVersionString BrAppBoolOption* fHelpOption BrAppBoolOption* fVersionOption Char_t** fArgv Int_t* fArgc Bool_t fIsOk Bool_t fHasParsed static BrAppOptionManager* fgInstance

Class Description


BrAppOptionManager()
 Constructor.
 First two arguments are the major and version of this
 application. third is the version string, and fourth is the help
 string.

BrAppOptionManager* Instance()

void AddHelpVersion()
 Set the two default otptions

void AddOption(BrAppOption* option, Bool_t internal)
 Add an option to the manager

void SetCommandLine(Int_t& argc, Char_t** argv)

void SetHelp(const Char_t* helpString)
 Set the help string
 Set help string

void SetVersion(Int_t major, Int_t minor, const Char_t* versionString)
 Set the help string

BrAppOption* GetOption(Char_t option)
 Get the BrAppOption with short name 'option'

BrAppOption* GetOption(Char_t* option)
 Get the BrAppOption with long name "option"
 TIter next(fTable);
 BrAppOption* opt;
 while ((opt = (BrAppOption*)next())) {
   if (strcmp(opt->GetLongName(),option) == 0)
     return opt;
 }

void SetOptionValue(Char_t option, Char_t* value)
 Set the value of the option with short name 'option'

void SetOptionValue(Char_t* option, Char_t* value)
 Set the value of the option with long name "option"

Bool_t ProcessCommandLine()
 Process command line parameters. If this class was compiled with
 exceptions enabled, then a BrException is thrown in case of
 errors. If it wasn't compiled with exceptions enabled, it returns
 kFALSE in case of errors.

Bool_t ProcessLongOption(Char_t* argument)
 Deal  with long options of the form "--<option>=<value>". For
 Boolean typed options, the form is "--<option>"

Bool_t ProcessShortOption(Char_t option, Bool_t& killNext, Char_t* value)
 Process short options. These are of the form "-<option> <val>" or
 in the case of boolean flags "-<option>"

void Print(Option_t* option="") const
 Print the list of options

Bool_t ShowHelp(void)
 Show the help screen if either "-h" or "--help" was on the
 command line. Return true if so, otherwise false

Bool_t ShowVersion(void)
 Show the version screen if either "-V" or "--version" was on the
 command line. Return true if so, otherwise false



Inline Functions


                    Bool_t IsOk() const
                    Bool_t HasParsed() const
                   TClass* Class()
                   TClass* IsA() const
                      void ShowMembers(TMemberInspector& insp, char* parent)
                      void Streamer(TBuffer& b)
                      void StreamerNVirtual(TBuffer& b)
        BrAppOptionManager BrAppOptionManager(BrAppOptionManager&)
                      void ~BrAppOptionManager()

This page automatically generated by script docBrat by Christian Holm

Copyright ; 2002 BRAHMS Collaboration <brahmlib@rcf.rhic.bnl.gov>
Last Update on 2002/04/23 15:18:30 $ by hagel $

Validate HTML
Validate CSS