OpendTect  6.3
interpretexpr.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 "bufstring.h"
15 
16 
17 namespace CmdDrive
18 {
19 
20 class CmdDriver;
21 
23 {
24 public:
25  ExprInterpreter(const CmdDriver&);
26 
27  const char* process(const char* exprstr,BufferString& val,
28  bool isargument=false);
29 
30  bool isResultTrivial() const { return trivialresult_; }
31  const char* parsedExpr() const { return parsedexpr_.buf(); }
32  const char* breakPrefix() const { return breakprefix_.buf(); }
33  bool isParseError() const;
34  const char* errMsg() const;
35 
36 protected:
37  const char* interpretSingleExpr(const char* parstr,
38  BufferString& val);
39  const char* interpretCompositeExpr(const char* parstr,
40  BufferString& val);
41  void setBreakPrefix(const char* endptr,
42  BufferString& breakprefix) const;
43 
44  const char* exprstr_;
48 
50  // Start with '~'-symbol to denote parsing error
51 
52  const CmdDriver& drv_;
53 };
54 
55 
56 }; // namespace CmdDrive
#define mExpClass(module)
Definition: commondefs.h:157
Command Drive
Definition: canvascommands.h:20
BufferString errmsg_
Definition: interpretexpr.h:49
Definition: interpretexpr.h:22
const char * breakPrefix() const
Definition: interpretexpr.h:32
const char * parsedExpr() const
Definition: interpretexpr.h:31
const CmdDriver & drv_
Definition: interpretexpr.h:52
OD::String with its own variable length buffer. The buffer has a guaranteed minimum size...
Definition: bufstring.h:38
bool trivialresult_
Definition: interpretexpr.h:45
BufferString breakprefix_
Definition: interpretexpr.h:47
const char * errMsg() const
Definition: horizontracker.h:59
bool isResultTrivial() const
Definition: interpretexpr.h:30
Definition: cmddriver.h:102
BufferString parsedexpr_
Definition: interpretexpr.h:46
const char * exprstr_
Definition: interpretexpr.h:44

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