Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes

Settings Class Reference

Settings hold the user settings. It is an IOPar. More...

Inheritance diagram for Settings:
IOPar NamedObject CallBacker

List of all members.

Public Member Functions

bool write (bool read_before=true) const
bool reRead ()

Static Public Member Functions

static Settingscommon ()
static Settingsfetch (const char *settings_name=0)
static SettingsfetchExternal (const char *settings_name, const char *dtect_user, const char *usr_settings_dir)
 for sysadm purposes

Protected Member Functions

 Settings (const char *fnm)
 ~Settings ()
bool doRead (bool)

Static Protected Member Functions

static SettingsdoFetch (const char *, const char *, const char *, bool)

Protected Attributes

FileNameString fname

Detailed Description

Settings hold the user settings. It is an IOPar.

The common() settings are basic, global user settings. For a specific subject or from a plugin, just call fetch( yourkey ), and a new Settings instance will be made if necessary. You can provide defaults in a file yourkeySettings which must be located in OD's data subdirectory.

The data is stored in ~/.od/settings (common) and ~/.od/settings_yourkey for other keys. If $DTECT_USER is set, '.$DTECT_USER' is appended to the filename.


Constructor & Destructor Documentation

Settings::Settings ( const char *  fnm  )  [inline, protected]
Settings::~Settings (  )  [inline, protected]

Member Function Documentation

static Settings& Settings::common (  )  [inline, static]
static Settings* Settings::doFetch ( const char *  ,
const char *  ,
const char *  ,
bool   
) [static, protected]
bool Settings::doRead ( bool   )  [protected]
static Settings& Settings::fetch ( const char *  settings_name = 0  )  [static]
static Settings* Settings::fetchExternal ( const char *  settings_name,
const char *  dtect_user,
const char *  usr_settings_dir 
) [static]

for sysadm purposes

bool Settings::reRead (  )  [inline]

Needed in case you know that the file has been changed by user or external routine. It's not likely that you'll need this.

bool Settings::write ( bool  read_before = true  )  const

read_before should be true: this is the protection against another update being screwed by this one


Member Data Documentation

FileNameString Settings::fname [protected]