Xbase64 4.0.1
C++ Library for handling Xbase (DBF) format type files
xbexpnode.h
Go to the documentation of this file.
1/* xbexpnode.h
2
3XBase64 Software Library
4
5Copyright (c) 1997,2003,2014,2022 Gary A Kunkel
6
7The xb64 software library is covered under the terms of the GPL Version 3, 2007 license.
8
9Email Contact:
10
11 XDB-devel@lists.sourceforge.net
12 XDB-users@lists.sourceforge.net
13
14*/
15
16
17#ifndef __XB_EXPNODE_H__
18#define __XB_EXPNODE_H__
19
20// #ifdef CMAKE_COMPILER_IS_GNUCC
21// #pragma interface
22// #endif
23
24#ifdef XB_EXPRESSION_SUPPORT
25
26
27namespace xb{
28
29//class XBDLLEXPORT xbDbf;
30
31/************************************************************************/
33
46class XBDLLEXPORT xbExpNode {
47 public:
48 xbExpNode();
49 xbExpNode( xbString &sNodeText, char cReturnType, char cNodeType );
50 xbExpNode( xbString &sNodeText, char cNodeType );
51 xbExpNode( char cNodeType );
52
53 virtual ~xbExpNode();
54 xbInt16 AddChild( xbExpNode *n );
55 xbExpNode *GetChild( xbUInt32 ulChildNo ) const;
56 xbUInt32 GetChildCnt() const;
57 xbUInt32 GetChildNo() const;
58 xbDbf *GetDbf() const;
59 xbInt16 GetFieldNo() const;
60 xbExpNode *GetFirstNode();
61 xbExpNode *GetNextNode() const;
62 void GetNodeText( xbString &sNodeText ) const;
63 char GetNodeType() const;
64 xbExpNode *GetParent() const;
65 xbString &GetStringResult();
66 xbBool GetBoolResult() const;
67 xbDouble GetNumericResult() const;
68 xbUInt32 GetResultLen() const;
69 xbExpNode *GetRightSibling() const;
70 char GetReturnType() const;
71 xbInt16 GetWeight() const;
72 xbBool HasRightSibling() const;
73 xbBool IsOperator() const;
74 xbBool IsUnaryOperator() const;
75 void RemoveLastChild();
76 void SetResultLen( xbUInt32 ulResultLen );
77 void SetDbfInfo( xbDbf *dbf );
78 void SetDbfInfo( xbDbf *dbf, xbInt16 iFieldNo );
79 void SetNodeText( xbString &sNodeText );
80 void SetNodeType( char cNodeType );
81 void SetParent( xbExpNode *n );
82 void SetResult( xbString &sResult );
83 void SetResult( xbDate &dtResult );
84 void SetResult( xbBool bResult );
85 void SetResult( xbDouble dResult );
86 void SetReturnType( char cReturnType );
87 void SetWeight( xbInt16 iWeight );
88
89 #ifdef XB_DEBUG_SUPPORT
90 void DumpNode( xbInt16 iOption ) const; // 0 = no children, 1 = and children
91 #endif
92
93 private:
94 xbString sNodeText; // expression text
95 char cReturnType; // one of: XB_EXP_CHAR, XB_EXP_DATE, XB_EXP_LOGICAL, XB_EXP_NUMERIC
96 char cNodeType; // one of: XB_EXP_CONSTANT, XB_EXP_FUNCTION, XB_EXP_FIELD, XB_EXP_OPERATOR
97 xbString sResult; // char result, and operator
98 xbDouble dResult; // numeric and bool results
99 xbExpNode * nParent; // pointer to parent
100 xbLinkList<xbExpNode *> llChildren; // linked list of descendent nodes
101 xbDbf *dbf; // pointer to dbf, used for field, RECNO() and RECCOUNT()
102 xbInt16 iFieldNo; // field no if DBF field
103 xbUInt32 ulResultLen; // for string results, accumulated length of character operations
104 // includes the sum of all nodes under this + this
105 // date = 8, numeric = 4, logical = 1
106 xbInt16 iWeight; // used for buildign the tree of nodes, assigned to operators
107 // the higher the number, the lower it goes on the tree
108
109};
110
111/************************************************************************/
112
113/* Expression handler */
114
115
116};
117#endif // XB_EXPRESSION_SUPPORT
118#endif // __XB_EXP_H__
119
120
Definition: xbdate.cpp:19
double xbDouble
Definition: xbtypes.h:23
short int xbBool
Definition: xbtypes.h:24
class XBDLLEXPORT xbDbf
Definition: xbtblmgr.h:28