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

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