base_settings.hh

Go to the documentation of this file.
00001 /*
00014  * LEGAL:   COPYRIGHT (C) 2007 JIM E. BROOKS
00015  *          THIS SOURCE CODE IS RELEASED UNDER THE TERMS
00016  *          OF THE GNU GENERAL PUBLIC LICENSE VERSION 2 (GPL 2).
00017  *****************************************************************************/
00018 
00019 #ifndef BASE_SETTINGS_HH
00020 #define BASE_SETTINGS_HH 1
00021 
00022 #include "base_common.hh"
00023 #include "base_conf_reader.hh"
00024 
00025 namespace base {
00026 
00032 class Settings
00033 {
00034 private:
00042     class SettingsConfReader : public ConfReader
00043     {
00044     public:
00045         void ProcessField( string& field, ifstream& conf );
00046     };
00047 
00048 public:
00049             Settings( void );
00050 
00051     SettingsConfReader  mSettingsConfReader;
00052 
00053     // For use by p51/boing since module settings aren't available to them.
00054     CLASS_METHOD void SetIgnoreBadFields( bool f ) { msIgnoreBadFields = f; }
00055     CLASS_VAR bool msIgnoreBadFields;
00056 
00057     // Cmd-line args:
00058     int     mArgc;
00059     char**  mArgv;
00060     string  mArgv0;
00061     bool    mArgVerbose;
00062     bool    mArgQuiet;
00063 
00064     // settings.conf:
00065     bool    mVerbose;
00066     bool    mQuiet;
00067     uint    mRandomSeed;
00068 };
00069 
00070 ostream& operator<<( ostream& strm, const Settings& settings );
00071 
00072 #if BASE_SETTINGS_CC
00073 Settings gSettings;
00074 #else
00075 extern Settings gSettings;
00076 #endif
00077 
00078 const string&
00079 GetDataDir( void );
00080 
00081 } // namespace base
00082 
00083 #endif // BASE_SETTINGS_HH
Palomino 3D Engine documents generated by doxygen 1.5.3 on Fri Nov 23 11:26:06 2007