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

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