Main Page | Class Hierarchy | Class List | Directories | File List | Class Members

options.h

00001 #ifndef OPTIONS_H
00002 #define OPTIONS_H
00003 
00004 #include "doomed.h"
00005 #include <assert.h>
00006 char* pathAlloc(int *size);
00007 
00008 class GetPot;
00009 //====================================================
00017 //====================================================
00018 class Options
00019 {
00020  public:
00022   static Options& instance() { assert(msp_options); return *msp_options; } 
00023 
00025   static void     build(int argc, char* argv[], const char* fn = ".traceString" );
00026 
00028   ~Options();                              
00029 
00030   int         filter()         { return m_filter;       } 
00031   int         flush()          { return m_flush;        } 
00032   int         indent()         { return m_indent;       } 
00033   int         noOp()           { return m_noOp;         } 
00034   int         printStates()    { return m_printStates;  } 
00035   int         remove()         { return m_remove;       } 
00036   int         rtest()          { return m_rtest;        } 
00037   int         verbose()        { return m_verbose;      } 
00038   int         warnings()       { return m_warnings;     } 
00039   int         writeNames()     { return m_writeNames;   } 
00040   const char* patternFn()      { return mp_patternFn;   } 
00041   const char* activeFn()       { return mp_activeFn;    } 
00042   const char* inactiveFn()     { return mp_inactiveFn;  } 
00043   const char* execDirName()    { return mp_execDirName; } 
00044   const char* defaultPatName() { return mp_default;     } 
00045   const char* tsMarker()       { return mp_tsMarker;    } 
00046 
00047 
00049   int         iarg()           { return m_iarg;         } 
00050 
00052   const char* operator[](int i);                          
00053 
00054   int         size();                                     
00055   void        printHelp(const char* application);         
00056 
00057  private:
00058   void        setPatternFn(const char* fn); 
00059   Options(int c, char* v[], const char* f); 
00060   Options(const Options&);                  
00061   Options& operator=(const Options&);       
00062  
00063  private:
00064   unsigned int    m_iarg;                   
00065   int             m_rtest;                  
00066   int             m_verbose;                
00067   int             m_printStates;            
00068   int             m_filter;                 
00069   int             m_writeNames;             
00070   int             m_noOp;                   
00071   int             m_flush;                  
00072   int             m_indent;                 
00073   int             m_remove;                 
00074   int             m_warnings;               
00075   char*           mp_patternFn;             
00076   char*           mp_execDirName;           
00077   char*           mp_activeFn;              
00078   char*           mp_inactiveFn;            
00079   char*           mp_default;               
00080   char*           mp_tsMarker;              
00081   GetPot*         mp_cl;                    
00082 
00083   static Options* msp_options;              
00084   static SingletonDestroyer<Options> ms_destroyer; 
00085 };
00086 
00087 
00088 #endif //OPTIONS_H
00089 
00090 



Project Hosted By:
SourceForge.net Logo