OpendTect-6_4  6.4
settings.h
Go to the documentation of this file.
1 #ifndef settings_h
2 #define settings_h
3 
4 /*+
5 ________________________________________________________________________
6 
7  (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
8  Author: A.H. Bril
9  Date: 4-11-1995
10  RCS: $Id$
11 ________________________________________________________________________
12 
13 
14 -*/
15 
16 #include "basicmod.h"
17 #include "iopar.h"
18 
19 
34 mExpClass(Basic) Settings : public IOPar
35 {
36 public:
37 
38  inline static Settings& common() { return fetch(); }
39 
40  static Settings& fetch(const char* settings_name=0);
41 
42  bool write(bool read_before=true) const;
46  bool reRead() { return doRead(false); }
50 
51  static Settings* fetchExternal(const char* settings_name,
52  const char* dtect_user,
53  const char* usr_settings_dir);
55 
56 protected:
57 
58  Settings( const char* fnm )
59  : fname_(fnm) {}
60  ~Settings() {}
61 
63 
64  static Settings* doFetch(const char*,const char*,const char*,
65  bool);
66  bool doRead(bool);
67 public:
68  void remove() { delete this; }
70 };
71 
72 
73 mExternC( Basic ) const char* GetSettingsDataDir(void);
74 
75 
77 #define mSettUse(fn,basekey,key,value) \
78  Settings::common().fn( IOPar::compKey(basekey,key), value )
79 #define mSettGet(basekey,key) \
81  Settings::common()[ IOPar::compKey(basekey,key) ]
82 #define mSettWrite() \
84  Settings::common().write();
85 
86 #endif
#define mExpClass(module)
Definition: commondefs.h:160
~Settings()
Definition: settings.h:60
bool reRead()
Definition: settings.h:46
Generalized set of parameters of the keyword-value type.
Definition: iopar.h:47
Settings(const char *fnm)
Definition: settings.h:58
#define mExternC(module)
Definition: commondefs.h:167
Settings class holds the user settings. It is an IOPar.
Definition: settings.h:34
BufferString fname_
Definition: settings.h:62
OD::String with its own variable length buffer. The buffer has a guaranteed minimum size...
Definition: bufstring.h:40
static Settings & common()
Definition: settings.h:38
Export_Basic const char * GetSettingsDataDir(void)

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