libbbb
1.2.1
Groups common code used in some applications and libraries.
libbbb
Classes
Files
File List
src
antenna
autothread
backjob
bytebuffer
core
doevents
dynstack
jobinterf
lists
markup
memtrack
refcount
rexscript
predefined-commands.cc
rexeval.h
rexscript-predefined-commands.h
rexscript.cc
rexscript.h
rexscriptblock.h
templates
timer
usermsg
varmap
File Members
•
All
Classes
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
rexscriptblock.h
1
/* ========================================================================= */
2
/* ------------------------------------------------------------------------- */
/*
12
13
14
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15
Please read COPYING and README files in root folder
16
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
17
*/
18
/* ------------------------------------------------------------------------- */
19
/* ========================================================================= */
20
#ifndef __REXBLOCK_INC__
21
#define __REXBLOCK_INC__
22
//
23
//
24
//
25
//
26
/* INCLUDES ------------------------------------------------------------ */
27
28
#include <libbbb/libbbb.h>
29
#include <libbbb/amorph.h>
30
#include <libbbb/list2d.h>
31
#include <QString>
32
#include <QStringList>
33
34
/* INCLUDES ============================================================ */
35
//
36
//
37
//
38
//
39
/* DEFINITIONS --------------------------------------------------------- */
40
41
namespace
bbb {
42
class
RexScript;
43
class
RexScriptBlock;
44
class
RexSBCallBack;
45
47
typedef
bool (*blockRoutine) ( RexScript * rexs,
const
RexSBCallBack * blk );
48
49
/* DEFINITIONS ========================================================= */
50
//
51
//
52
//
53
//
54
/* CLASS --------------------------------------------------------------- */
55
59
class
RexScriptBlock
:
public
List2De
{
60
61
//
62
//
63
//
64
//
65
/* DEFINITIONS ----------------------------------------------------- */
66
67
friend
class
bbb::RexScript
;
68
69
/* DEFINITIONS ===================================================== */
70
//
71
//
72
//
73
//
74
/* DATA ------------------------------------------------------------ */
75
76
protected
:
77
79
RexScript
*
rex_
;
80
82
int
file_idx_
;
83
85
int
line_idx_
;
86
87
88
/* DATA ============================================================ */
89
//
90
//
91
//
92
//
93
/* FUNCTIONS ------------------------------------------------------- */
94
95
public
:
96
98
RexScriptBlock
(
99
RexScript
* rex
100
);
101
103
virtual
~RexScriptBlock
(
void
);
104
106
virtual
bool
appendLine
(
const
QString & s_line ) = 0;
107
109
virtual
void
error
(
int
line ) { Q_UNUSED(line); }
110
112
115
virtual
bool
blockEnd
(
RexScript
* rexs ) { Q_UNUSED(rexs);
return
true
; }
116
117
/* FUNCTIONS ======================================================= */
118
//
119
//
120
//
121
//
122
};
/* class RexScriptBlock */
123
124
/* CLASS =============================================================== */
125
//
126
//
127
//
128
//
129
/* CLASS --------------------------------------------------------------- */
130
134
class
RexSBCallBack
:
public
RexScriptBlock
{
135
136
//
137
//
138
//
139
//
140
/* DEFINITIONS ----------------------------------------------------- */
141
142
friend
class
bbb::RexScript
;
143
144
/* DEFINITIONS ===================================================== */
145
//
146
//
147
//
148
//
149
/* DATA ------------------------------------------------------------ */
150
151
protected
:
152
154
blockRoutine
kb_
;
155
157
QString
s_end_
;
158
160
QStringList
sl_content_
;
161
163
Amorph
user_data_
;
164
165
/* DATA ============================================================ */
166
//
167
//
168
//
169
//
170
/* FUNCTIONS ------------------------------------------------------- */
171
172
public
:
173
175
RexSBCallBack
(
176
RexScript
* rex,
177
blockRoutine call_back,
178
const
QString & s_end =
"END"
179
);
180
182
virtual
~RexSBCallBack
(
void
);
183
185
virtual
bool
appendLine
(
const
QString & s_line );
186
188
virtual
void
error
(
int
line );
189
191
194
virtual
bool
blockEnd
(
RexScript
* rexs );
195
197
const
QStringList &
content
(
void
)
const
198
{
return
sl_content_
; }
199
201
const
Amorph
&
userData
(
void
)
const
202
{
return
user_data_
; }
203
205
void
setUserData
(
void
* p )
206
{
user_data_
.p_ = p; }
207
209
void
setUserData
(
double
d )
210
{
user_data_
.d_ = d; }
211
213
void
setUserData
(
int
i )
214
{
user_data_
.i_ = i; }
215
216
217
/* FUNCTIONS ======================================================= */
218
//
219
//
220
//
221
//
222
223
};
/* class RexSBCallBack */
224
225
/* CLASS =============================================================== */
226
//
227
//
228
//
229
//
230
231
}
// namespace bbb
232
233
#endif // __REXBLOCK_INC__
234
/* ------------------------------------------------------------------------- */
235
/* ========================================================================= */
src
rexscript
rexscriptblock.h
Generated on Thu Aug 8 2013 20:10:33 for libbbb by
1.8.3.1