// static functions
// sets the config object, returns the previous pointer
static wxConfigBase *Set(wxConfigBase *pConfig);
- // get the config object, creates it on demand
+ // get the config object, creates it on demand unless DontCreateOnDemand
+ // was called
static wxConfigBase *Get() { if ( !ms_pConfig ) Create(); return ms_pConfig; }
// create a new config object: this function will create the "best"
// implementation of wxConfig available for the current platform, see
// comments near definition wxCONFIG_WIN32_NATIVE for details. It returns
// the created object and also sets it as ms_pConfig.
static wxConfigBase *Create();
+ // should Get() try to create a new log object if the current one is NULL?
+ static void DontCreateOnDemand() { ms_bAutoCreate = FALSE; }
// ctor & virtual dtor
// environment variable expansion is on by default
- wxConfigBase() { m_bExpandEnvVars = TRUE; }
+ wxConfigBase() { m_bExpandEnvVars = TRUE; m_bRecordDefaults = FALSE; }
// empty but ensures that dtor of all derived classes is virtual
virtual ~wxConfigBase() { }
// (this option is on by default, you can turn it on/off at any time)
bool IsExpandingEnvVars() const { return m_bExpandEnvVars; }
void SetExpandEnvVars(bool bDoIt = TRUE) { m_bExpandEnvVars = bDoIt; }
- // does expansion only if needed
+ // recording of default values
+ void SetRecordDefaults(bool bDoIt = TRUE) { m_bRecordDefaults = bDoIt; }
+ bool IsRecordingDefaults() const { return m_bRecordDefaults; }
+ // does expansion only if needed
wxString ExpandEnvVars(const wxString& str) const
{
wxString tmp; // Required for BC++
private:
// are we doing automatic environment variable expansion?
bool m_bExpandEnvVars;
-
+ // do we record default values?
+ bool m_bRecordDefaults;
+
// static variables
static wxConfigBase *ms_pConfig;
+ static bool ms_bAutoCreate;
};
// ----------------------------------------------------------------------------
#define wxConfig wxFileConfig
#endif
-#endif //_wxCONFIG_H
\ No newline at end of file
+#endif //_wxCONFIG_H
+