OpendTect-6_4  6.4
identifierman.h
Go to the documentation of this file.
1 #ifndef identifierman_h
2 #define identifierman_h
3 
4 /*+
5 ________________________________________________________________________
6 
7  (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
8  Author: Jaap Glas
9  Date: March 2011
10  RCS: $Id$
11 ________________________________________________________________________
12 
13 -*/
14 
15 #include "uicmddrivermod.h"
16 #include "objectset.h"
17 #include "separstr.h"
18 
19 
20 namespace CmdDrive
21 {
22 
24 {
25 public:
26  IdentifierManager();
27  ~IdentifierManager();
28 
29  void reInit();
30  void raiseScopeLevel(bool up=true);
31 
32  void set(const char* name,const char* val="",
33  bool islink=false);
34  void set(const char* name,int);
35  void set(const char* name,double);
36  void unset(const char* name,bool followlinks=true);
37 
38  bool isPredefined(const char* name) const;
39  bool doesExist(const char* name) const;
40  const char* getValue(const char* name) const;
41 
42  bool getInteger(const char* name,int&) const;
43  bool getDouble(const char* name,double&) const;
44 
45  const char* lastLinkedIdentStr() const;
46 
47  int substitute(const char* src,BufferString& dest);
48  // Returns failed (<0) or successful (>=0) nr. subst
49 
50  bool tryFilePathPlaceholders(BufferString& filepath);
51 
52 protected:
53 
54  mClass(uiCmdDriver) Identifier
55  {
56  public:
57  Identifier(const char* name,const char* val="",
58  bool islink=false)
59  : name_(name), val_(val), islink_(islink)
60  , predefined_(false)
61  , filepathplaceholder_(false)
62  , refresh_(false) {}
63 
66 
67  bool islink_;
70  bool refresh_;
71  };
72 
73  bool findCurIdent(const char* name,bool followlinks=true,
74  bool singlescope=false);
75  void setFilePathPlaceholder(const char* nm,const char* val);
76 
77  void tryFilePathPlaceholder(const char* prefixsrc,
78  const char* filepathsrc,
79  BufferString& filepathdest);
80 
81  Identifier* curident_; // Always points to last identifier set/read
82  int curlevel_; // Always points to last level searched
83 
85 
87 };
88 
89 
90 }; // namespace CmdDrive
91 
92 
93 #endif
#define mExpClass(module)
Definition: commondefs.h:160
Command Drive
Definition: canvascommands.h:22
List encoded in a string.
Definition: separstr.h:33
bool predefined_
Definition: identifierman.h:68
ObjectSet< ObjectSet< Identifier > > identifiers_
Definition: identifierman.h:86
Set of pointers to objects.
Definition: commontypes.h:32
Identifier(const char *name, const char *val="", bool islink=false)
Definition: identifierman.h:57
SeparString lastlinkedidentstr_
Definition: identifierman.h:84
bool islink_
Definition: identifierman.h:67
Definition: identifierman.h:23
Identifier * curident_
Definition: identifierman.h:81
bool refresh_
Definition: identifierman.h:70
OD::String with its own variable length buffer. The buffer has a guaranteed minimum size...
Definition: bufstring.h:40
bool filepathplaceholder_
Definition: identifierman.h:69
BufferString val_
Definition: identifierman.h:65
#define mClass(module)
Definition: commondefs.h:164
Definition: identifierman.h:54
BufferString name_
Definition: identifierman.h:64
int curlevel_
Definition: identifierman.h:82

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