OpendTect-6_4  6.4
Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
Settings Class Reference

Settings class holds the user settings. It is an IOPar. More...

Inheritance diagram for Settings:
[legend]

Public Member Functions

bool write (bool read_before=true) const
 
bool reRead ()
 
void remove ()
 Only specialist use i.e. on program closing. More...
 
- Public Member Functions inherited from IOPar
 IOPar (const char *nm=0)
 empty More...
 
 IOPar (ascistream &)
 
 IOPar (const IOPar &)
 
 ~IOPar ()
 
IOParoperator= (const IOPar &)
 
bool operator== (const IOPar &iop) const
 
bool operator!= (const IOPar &iop) const
 
int size () const
 
int indexOf (const char *key) const
 
bool isPresent (const char *ky) const
 
bool isEmpty () const
 
bool isEqual (const IOPar &, bool need_same_order=false) const
 
FixedString getKey (int) const
 
FixedString getValue (int) const
 
bool setKey (int, const char *)
 
void setValue (int, const char *)
 
bool hasKey (const char *s) const
 
const char * findKeyFor (const char *, int nr=0) const
 returns null if value not found More...
 
void remove (int)
 
void removeWithKey (const char *key)
 
void removeWithKeyPattern (const char *globexpression)
 
void setEmpty ()
 remove all entries (doesn't clear name) More...
 
void merge (const IOPar &)
 merge entries using the set() command More...
 
void addFrom (const IOPar &)
 merge entries but do not overwrite More...
 
IOParsubselect (const char *) const
 returns iopar with key that start with <str>. More...
 
IOParsubselect (int) const
 returns iopar with key that start with number. More...
 
IOParsubselect (const OD::String &fs) const
 
void removeSubSelection (const char *)
 removes with key that start with <str>. More...
 
void removeSubSelection (int)
 removes with key that start with number. More...
 
void removeSubSelection (const OD::String &fs)
 
void mergeComp (const IOPar &, const char *)
 merge entries, where IOPar's entries get a prefix More...
 
const char * find (const char *) const
 returns null if not found More...
 
FixedString operator[] (const char *ky) const
 
bool get (const char *, int &) const
 
bool get (const char *, int &, int &) const
 
bool get (const char *, int &, int &, int &) const
 
bool get (const char *, int &, int &, int &, int &) const
 
bool get (const char *, unsigned int &) const
 
bool get (const char *, unsigned int &, unsigned int &) const
 
bool get (const char *, unsigned int &, unsigned int &, unsigned int &) const
 
bool get (const char *, unsigned int &, unsigned int &, unsigned int &, unsigned int &) const
 
bool get (const char *, int64_t &) const
 
bool get (const char *, int64_t &, int64_t &) const
 
bool get (const char *, int64_t &, int64_t &, int64_t &) const
 
bool get (const char *, int64_t &, int64_t &, int64_t &, int64_t &) const
 
bool get (const char *, uint64_t &) const
 
bool get (const char *, uint64_t &, uint64_t &) const
 
bool get (const char *, uint64_t &, uint64_t &, uint64_t &) const
 
bool get (const char *, uint64_t &, uint64_t &, uint64_t &, uint64_t &) const
 
bool get (const char *, float &) const
 
bool get (const char *, float &, float &) const
 
bool get (const char *, float &, float &, float &) const
 
bool get (const char *, float &, float &, float &, float &) const
 
bool get (const char *, double &) const
 
bool get (const char *, double &, double &) const
 
bool get (const char *, double &, double &, double &) const
 
bool get (const char *, double &, double &, double &, double &) const
 
bool getYN (const char *, bool &) const
 
bool getYN (const char *, bool &, bool &) const
 
bool getYN (const char *, bool &, bool &, bool &) const
 
bool getYN (const char *, bool &, bool &, bool &, bool &) const
 
bool isTrue (const char *key) const
 
bool isFalse (const char *key) const
 
bool get (const char *, int &, int &, float &) const
 
bool get (const char *, TypeSet< int > &) const
 
bool get (const char *, TypeSet< unsigned int > &) const
 
bool get (const char *, TypeSet< int64_t > &) const
 
bool get (const char *, TypeSet< uint64_t > &) const
 
bool get (const char *, TypeSet< double > &) const
 
bool get (const char *, TypeSet< float > &) const
 
bool get (const char *, BinID &) const
 
bool get (const char *, TrcKey &) const
 
bool get (const char *, Coord &) const
 
bool get (const char *, Coord3 &) const
 
bool get (const char *, MultiID &) const
 
bool get (const char *, Color &) const
 
bool get (const char *, SeparString &) const
 
bool get (const char *, uiString &) const
 
bool get (const char *, BufferString &) const
 
bool get (const char *, BufferString &, BufferString &) const
 
bool get (const char *, BufferString &, BufferString &, BufferString &) const
 
bool get (const char *, BufferStringSet &) const
 
template<class T >
bool get (const char *, Interval< T > &) const
 
template<class T >
bool get (const char *, SamplingData< T > &) const
 
bool getPtr (const char *, void *&) const
 
bool getScaled (const char *, float &, float applied_scale, bool set_to_undef_if_not_found) const
 
bool getScaled (const char *, float &, float &, float, bool) const
 
bool getScaled (const char *, float &, float &, float &, float, bool) const
 
bool getScaled (const char *, float &, float &, float &, float &, float, bool) const
 
bool getScaled (const char *, double &, double applied_scale, bool set_to_undef_if_not_found) const
 
bool getScaled (const char *, double &, double &, double, bool) const
 
bool getScaled (const char *, double &, double &, double &, double, bool) const
 
bool getScaled (const char *, double &, double &, double &, double &, double, bool) const
 
void set (const char *ky, const char *val)
 
void add (const char *ky, const char *val)
 
void add (const char *ky, const OD::String &val)
 
void update (const char *ky, const char *val)
 
void set (const char *, int)
 
void set (const char *, int, int)
 
void set (const char *, int, int, int)
 
void set (const char *, int, int, int, int)
 
void set (const char *, unsigned int)
 
void set (const char *, unsigned int, unsigned int)
 
void set (const char *, unsigned int, unsigned int, unsigned int)
 
void set (const char *, unsigned int, unsigned int, unsigned int, unsigned int)
 
void set (const char *, int64_t)
 
void set (const char *, int64_t, int64_t)
 
void set (const char *, int64_t, int64_t, int64_t)
 
void set (const char *, int64_t, int64_t, int64_t, int64_t)
 
void set (const char *, uint64_t)
 
void set (const char *, uint64_t, uint64_t)
 
void set (const char *, uint64_t, uint64_t, uint64_t)
 
void set (const char *, uint64_t, uint64_t, uint64_t, uint64_t)
 
void set (const char *, float)
 
void set (const char *, float, float)
 
void set (const char *, float, float, float)
 
void set (const char *, float, float, float, float)
 
void set (const char *, double)
 
void set (const char *, double, double)
 
void set (const char *, double, double, double)
 
void set (const char *, double, double, double, double)
 
void add (const char *, int)
 
void add (const char *, int, int)
 
void add (const char *, int, int, int)
 
void add (const char *, int, int, int, int)
 
void add (const char *, unsigned int)
 
void add (const char *, unsigned int, unsigned int)
 
void add (const char *, unsigned int, unsigned int, unsigned int)
 
void add (const char *, unsigned int, unsigned int, unsigned int, unsigned int)
 
void add (const char *, int64_t)
 
void add (const char *, int64_t, int64_t)
 
void add (const char *, int64_t, int64_t, int64_t)
 
void add (const char *, int64_t, int64_t, int64_t, int64_t)
 
void add (const char *, uint64_t)
 
void add (const char *, uint64_t, uint64_t)
 
void add (const char *, uint64_t, uint64_t, uint64_t)
 
void add (const char *, uint64_t, uint64_t, uint64_t, uint64_t)
 
void add (const char *, float)
 
void add (const char *, float, float)
 
void add (const char *, float, float, float)
 
void add (const char *, float, float, float, float)
 
void add (const char *, double)
 
void add (const char *, double, double)
 
void add (const char *, double, double, double)
 
void add (const char *, double, double, double, double)
 
void setYN (const char *, bool)
 
void setYN (const char *, bool, bool)
 
void setYN (const char *, bool, bool, bool)
 
void setYN (const char *, bool, bool, bool, bool)
 
void addYN (const char *, bool)
 
void addYN (const char *, bool, bool)
 
void addYN (const char *, bool, bool, bool)
 
void addYN (const char *, bool, bool, bool, bool)
 
void set (const char *, int, int, float)
 
void setPtr (const char *, void *)
 
void set (const char *, const char *, const char *)
 
void set (const char *, const char *, const char *, const char *)
 
void set (const char *, const BinID &)
 
void set (const char *, const TrcKey &)
 
void set (const char *, const Coord &)
 
void set (const char *, const Coord3 &)
 
void set (const char *, const MultiID &)
 
void set (const char *, const Color &)
 
void set (const char *, const SeparString &)
 
void set (const char *, const uiString &)
 
void set (const char *, const OD::String &)
 
void set (const char *, const OD::String &, const OD::String &)
 
void set (const char *, const OD::String &, const OD::String &, const OD::String &)
 
void set (const char *, const BufferStringSet &)
 
template<class T >
void set (const char *, const Interval< T > &)
 
template<class T >
void set (const char *, const SamplingData< T > &)
 
void set (const char *, const TypeSet< int > &)
 
void set (const char *, const TypeSet< unsigned int > &)
 
void set (const char *, const TypeSet< int64_t > &)
 
void set (const char *, const TypeSet< uint64_t > &)
 
void set (const char *, const TypeSet< double > &)
 
void set (const char *, const TypeSet< float > &)
 
void setToDateTime (const char *ky=0)
 
void setToUser (const char *ky=0)
 
void setStdCreationEntries ()
 
void getFrom (const char *)
 
void getParsFrom (const char *)
 
void putTo (BufferString &) const
 
void putParsTo (BufferString &) const
 
void getFrom (ascistream &)
 
void putTo (ascostream &) const
 
bool read (const char *filename, const char *filetype, bool chktype=false)
 
bool read (od_istream &, const char *filetype, bool chktype=false)
 
bool write (const char *filename, const char *filetype) const
 
bool write (od_ostream &, const char *filetyp) const
 
int majorVersion () const
 Only set if read from file. Otherwise set to current. More...
 
int minorVersion () const
 Only set if read from file. Otherwise set to current. More...
 
int odVersion () const
 
void dumpPretty (BufferString &) const
 
void dumpPretty (od_ostream &) const
 
- Public Member Functions inherited from NamedObject
 NamedObject (const char *nm=0)
 
 NamedObject (const NamedObject *linkedto)
 
 NamedObject (const NamedObject &)
 
virtual ~NamedObject ()
 
void setLinkedTo (NamedObject *)
 
bool operator== (const NamedObject &oth) const
 
virtual const OD::Stringname () const
 
virtual const OD::StringannotName () const
 
virtual void setName (const char *)
 
void setCleanName (const char *)
 cleans string first More...
 
void deleteNotify (const CallBack &)
 
- Public Member Functions inherited from CallBacker
 CallBacker ()
 
 CallBacker (const CallBacker &)
 
virtual ~CallBacker ()
 
bool attachCB (NotifierAccess &, const CallBack &, bool onlyifnew=false)
 
bool attachCB (NotifierAccess *notif, const CallBack &cb, bool onlyifnew=false)
 
void detachCB (NotifierAccess &, const CallBack &)
 
void detachCB (NotifierAccess *notif, const CallBack &cb)
 
bool isNotifierAttached (NotifierAccess *) const
 Only for debugging purposes, don't use. More...
 

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 More...
 
- Static Public Member Functions inherited from IOPar
static const char * compKey (const char *, const char *)
 The composite key: (a,b) -> a.b. More...
 
static const char * compKey (const char *, int)
 The composite key where int will be –> string. More...
 
static const char * compKey (const char *ky1, const OD::String &ky2)
 
static const char * sKeyDumpPretty ()
 
static const char * sKeyHdr ()
 
static const char * sKeySubHdr ()
 

Protected Member Functions

 Settings (const char *fnm)
 
 ~Settings ()
 
bool doRead (bool)
 
- Protected Member Functions inherited from CallBacker
void detachAllNotifiers ()
 Call from the destructor of your inherited object. More...
 

Static Protected Member Functions

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

Protected Attributes

BufferString fname_
 
- Protected Attributes inherited from IOPar
int majorversion_
 
int minorversion_
 
BufferStringSetkeys_
 
BufferStringSetvals_
 
- Protected Attributes inherited from NamedObject
BufferStringname_
 
NamedObjectlinkedto_
 
CallBackSetdelnotify_
 

Detailed Description

Settings class holds 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)
inlineprotected
Settings::~Settings ( )
inlineprotected

Member Function Documentation

static Settings& Settings::common ( )
inlinestatic
static Settings* Settings::doFetch ( const char *  ,
const char *  ,
const char *  ,
bool   
)
staticprotected
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

void Settings::remove ( )
inline

Only specialist use i.e. on program closing.

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

BufferString Settings::fname_
protected

Generated at for the OpendTect seismic interpretation project. Copyright (C): dGB Beheer B. V. 2019