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

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