MythTV  master
Variables.cpp
Go to the documentation of this file.
1 /* Variables.cpp
2 
3  Copyright (C) David C. J. Matthews 2004 dm at prolingua.co.uk
4 
5  This program is free software; you can redistribute it and/or
6  modify it under the terms of the GNU General Public License
7  as published by the Free Software Foundation; either version 2
8  of the License, or (at your option) any later version.
9 
10  This program is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with this program; if not, write to the Free Software
17  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
18  Or, point your browser to http://www.gnu.org/copyleft/gpl.html
19 
20 */
21 #include "compat.h"
22 
23 #include "Variables.h"
24 #include "Ingredients.h"
25 #include "Root.h"
26 #include "BaseClasses.h"
27 #include "ParseNode.h"
28 #include "ASN1Codes.h"
29 #include "Engine.h"
30 #include "Logging.h"
31 
33 
34 static const char *TestToText(int tc)
35 {
36  switch (tc)
37  {
38  case TC_Equal:
39  return "Equal";
40  case TC_NotEqual:
41  return "NotEqual";
42  case TC_Less:
43  return "Less";
44  case TC_LessOrEqual:
45  return "LessOrEqual";
46  case TC_Greater:
47  return "Greater";
48  case TC_GreaterOrEqual:
49  return "GreaterOrEqual";
50  }
51 
52  return nullptr; // To keep the compiler happy
53 }
54 
55 // Normal activation behaviour.
57 {
58  if (m_fRunning)
59  {
60  return;
61  }
62 
64  m_fRunning = true;
65  engine->EventTriggered(this, EventIsRunning);
66 }
67 
69 {
70  MHVariable::Initialise(p, engine);
71  // Original value should be a bool.
73 
74  if (pInitial)
75  {
76  m_fOriginalValue = pInitial->GetArgN(0)->GetBoolValue();
77  }
78 }
79 
80 void MHBooleanVar::PrintMe(FILE *fd, int nTabs) const
81 {
82  PrintTabs(fd, nTabs);
83  fprintf(fd, "{:BooleanVar");
84  MHVariable::PrintMe(fd, nTabs + 1);
85  PrintTabs(fd, nTabs + 1);
86  fprintf(fd, ":OrigValue %s\n", m_fOriginalValue ? "true" : "false");
87  PrintTabs(fd, nTabs);
88  fprintf(fd, "}\n");
89 }
90 
92 {
93  if (m_fAvailable)
94  {
95  return;
96  }
97 
100 }
101 
102 // Implement the TestVariable action. Triggers a TestEvent event on the result.
103 void MHBooleanVar::TestVariable(int nOp, const MHUnion &parm, MHEngine *engine)
104 {
106  bool fRes = false;
107 
108  switch (nOp)
109  {
110  case TC_Equal:
111  fRes = m_fValue == parm.m_fBoolVal;
112  break;
113  case TC_NotEqual:
114  fRes = m_fValue != parm.m_fBoolVal;
115  break;
116  default:
117  MHERROR("Invalid comparison for bool");
118  }
119 
120  MHLOG(MHLogDetail, QString("Comparison %1 between %2 and %3 => %4").arg(TestToText(nOp))
121  .arg(m_fValue ? "true" : "false").arg(parm.m_fBoolVal ? "true" : "false").arg(fRes ? "true" : "false"));
122  engine->EventTriggered(this, EventTestEvent, fRes);
123 }
124 
125 // Get the variable value. Used in IndirectRef.
127 {
128  value.m_Type = MHUnion::U_Bool;
129  value.m_fBoolVal = m_fValue;
130 }
131 
132 // Implement the SetVariable action.
134 {
135  value.CheckType(MHUnion::U_Bool);
136  m_fValue = value.m_fBoolVal;
137  MHLOG(MHLogDetail, QString("Update %1 := %2").arg(m_ObjectReference.Printable()).arg(m_fValue ? "true" : "false"));
138 }
139 
140 
142 {
143  MHVariable::Initialise(p, engine);
144  // Original value should be an int.
145  MHParseNode *pInitial = p->GetNamedArg(C_ORIGINAL_VALUE);
146 
147  if (pInitial)
148  {
149  m_nOriginalValue = pInitial->GetArgN(0)->GetIntValue();
150  }
151 }
152 
153 void MHIntegerVar::PrintMe(FILE *fd, int nTabs) const
154 {
155  PrintTabs(fd, nTabs);
156  fprintf(fd, "{:IntegerVar");
157  MHVariable::PrintMe(fd, nTabs + 1);
158  PrintTabs(fd, nTabs + 1);
159  fprintf(fd, ":OrigValue %d\n", m_nOriginalValue);
160  PrintTabs(fd, nTabs);
161  fprintf(fd, "}\n");
162 }
163 
165 {
166  if (m_fAvailable)
167  {
168  return;
169  }
170 
172  MHVariable::Preparation(engine);
173 }
174 
175 // Implement the TestVariable action. Triggers a TestEvent event on the result.
176 void MHIntegerVar::TestVariable(int nOp, const MHUnion &parm, MHEngine *engine)
177 {
179  bool fRes = false;
180 
181  switch (nOp)
182  {
183  case TC_Equal:
184  fRes = m_nValue == parm.m_nIntVal;
185  break;
186  case TC_NotEqual:
187  fRes = m_nValue != parm.m_nIntVal;
188  break;
189  case TC_Less:
190  fRes = m_nValue < parm.m_nIntVal;
191  break;
192  case TC_LessOrEqual:
193  fRes = m_nValue <= parm.m_nIntVal;
194  break;
195  case TC_Greater:
196  fRes = m_nValue > parm.m_nIntVal;
197  break;
198  case TC_GreaterOrEqual:
199  fRes = m_nValue >= parm.m_nIntVal;
200  break;
201  default:
202  MHERROR("Invalid comparison for int"); // Shouldn't ever happen
203  }
204 
205  MHLOG(MHLogDetail, QString("Comparison %1 between %2 and %3 => %4").arg(TestToText(nOp))
206  .arg(m_nValue).arg(parm.m_nIntVal).arg(fRes ? "true" : "false"));
207  engine->EventTriggered(this, EventTestEvent, fRes);
208 }
209 
210 // Get the variable value. Used in IndirectRef.
212 {
213  value.m_Type = MHUnion::U_Int;
214  value.m_nIntVal = m_nValue;
215 }
216 
217 // Implement the SetVariable action. Also used as part of Add, Subtract etc
219 {
220  if (value.m_Type == MHUnion::U_String)
221  {
222  // Implicit conversion of string to integer.
223  int v = 0;
224  int p = 0;
225  bool fNegative = false;
226 
227  if (value.m_StrVal.Size() > 0 && value.m_StrVal.GetAt(0) == '-')
228  {
229  p++;
230  fNegative = true;
231  }
232 
233  for (; p < value.m_StrVal.Size(); p++)
234  {
235  unsigned char ch = value.m_StrVal.GetAt(p);
236 
237  if (ch < '0' || ch > '9')
238  {
239  break;
240  }
241 
242  v = v * 10 + ch - '0';
243  }
244 
245  if (fNegative)
246  {
247  m_nValue = -v;
248  }
249  else
250  {
251  m_nValue = v;
252  }
253  }
254  else
255  {
256  value.CheckType(MHUnion::U_Int);
257  m_nValue = value.m_nIntVal;
258  }
259 
260  MHLOG(MHLogDetail, QString("Update %1 := %2").arg(m_ObjectReference.Printable()).arg(m_nValue));
261 }
262 
263 
264 
266 {
267  MHVariable::Initialise(p, engine);
268  // Original value should be a string.
269  MHParseNode *pInitial = p->GetNamedArg(C_ORIGINAL_VALUE);
270 
271  if (pInitial)
272  {
273  pInitial->GetArgN(0)->GetStringValue(m_OriginalValue);
274  }
275 }
276 
277 void MHOctetStrVar::PrintMe(FILE *fd, int nTabs) const
278 {
279  PrintTabs(fd, nTabs);
280  fprintf(fd, "{:OStringVar");
281  MHVariable::PrintMe(fd, nTabs + 1);
282  PrintTabs(fd, nTabs + 1);
283  fprintf(fd, ":OrigValue ");
284  m_OriginalValue.PrintMe(fd, nTabs + 1);
285  fprintf(fd, "\n");
286  PrintTabs(fd, nTabs);
287  fprintf(fd, "}\n");
288 }
289 
291 {
292  if (m_fAvailable)
293  {
294  return;
295  }
296 
298  MHVariable::Preparation(engine);
299 }
300 
301 // Implement the TestVariable action. Triggers a TestEvent event on the result.
302 void MHOctetStrVar::TestVariable(int nOp, const MHUnion &parm, MHEngine *engine)
303 {
305  int nRes = m_Value.Compare(parm.m_StrVal);
306  bool fRes = false;
307 
308  switch (nOp)
309  {
310  case TC_Equal:
311  fRes = nRes == 0;
312  break;
313  case TC_NotEqual:
314  fRes = nRes != 0;
315  break;
316  /* case TC_Less: fRes = nRes < 0; break;
317  case TC_LessOrEqual: fRes = nRes <= 0; break;
318  case TC_Greater: fRes = nRes > 0; break;
319  case TC_GreaterOrEqual: fRes = nRes >= 0; break;*/
320  default:
321  MHERROR("Invalid comparison for string"); // Shouldn't ever happen
322  }
323 
324  MHOctetString sample1(m_Value, 0, 10);
325  MHOctetString sample2(parm.m_StrVal, 0, 10);
326  MHLOG(MHLogDetail, QString("Comparison %1 %2 and %3 => %4").arg(TestToText(nOp))
327  .arg(sample1.Printable()).arg(sample2.Printable()).arg(fRes ? "true" : "false"));
328  engine->EventTriggered(this, EventTestEvent, fRes);
329 }
330 
331 // Get the variable value. Used in IndirectRef.
333 {
334  value.m_Type = MHUnion::U_String;
335  value.m_StrVal.Copy(m_Value);
336 }
337 
338 // Implement the SetVariable action.
340 {
341  if (value.m_Type == MHUnion::U_Int)
342  {
343  // Implicit conversion of int to string.
344  char buff[30]; // 30 chars is more than enough.
345  snprintf(buff, sizeof(buff), "%0d", value.m_nIntVal);
346  m_Value.Copy(buff);
347  }
348  else
349  {
351  m_Value.Copy(value.m_StrVal);
352  }
353 
354  // Debug
355  MHOctetString sample(m_Value, 0, 60);
356  MHLOG(MHLogDetail, QString("Update %1 := %2").arg(m_ObjectReference.Printable())
357  .arg(sample.Printable()));
358 }
359 
360 
362 {
363  MHVariable::Initialise(p, engine);
364  // Original value should be an object reference.
365  MHParseNode *pInitial = p->GetNamedArg(C_ORIGINAL_VALUE);
366 
367  // and this should be a ObjRef node.
368  if (pInitial)
369  {
370  MHParseNode *pArg = pInitial->GetNamedArg(C_OBJECT_REFERENCE);
371 
372  if (pArg)
373  {
374  m_OriginalValue.Initialise(pArg->GetArgN(0), engine);
375  }
376  }
377 }
378 
379 void MHObjectRefVar::PrintMe(FILE *fd, int nTabs) const
380 {
381  PrintTabs(fd, nTabs);
382  fprintf(fd, "{:ObjectRefVar");
383  MHVariable::PrintMe(fd, nTabs + 1);
384  PrintTabs(fd, nTabs + 1);
385  fprintf(fd, ":OrigValue ");
386  m_OriginalValue.PrintMe(fd, nTabs + 1);
387  fprintf(fd, "\n");
388  PrintTabs(fd, nTabs);
389  fprintf(fd, "}\n");
390 }
391 
393 {
394  if (m_fAvailable)
395  {
396  return;
397  }
398 
400  MHVariable::Preparation(engine);
401 }
402 
403 // Implement the TestVariable action. Triggers a TestEvent event on the result.
404 void MHObjectRefVar::TestVariable(int nOp, const MHUnion &parm, MHEngine *engine)
405 {
407  bool fRes = false;
408 
409  switch (nOp)
410  {
411  case TC_Equal:
412  fRes = m_Value.Equal(parm.m_ObjRefVal, engine);
413  break;
414  case TC_NotEqual:
415  fRes = ! m_Value.Equal(parm.m_ObjRefVal, engine);
416  break;
417  default:
418  MHERROR("Invalid comparison for object ref");
419  }
420 
421  engine->EventTriggered(this, EventTestEvent, fRes);
422 }
423 
424 // Get the variable value. Used in IndirectRef.
426 {
427  value.m_Type = MHUnion::U_ObjRef;
428  value.m_ObjRefVal.Copy(m_Value);
429 }
430 
431 // Implement the SetVariable action.
433 {
435  m_Value.Copy(value.m_ObjRefVal);
436  MHLOG(MHLogDetail, QString("Update %1 := %2").arg(m_ObjectReference.Printable()).arg(m_Value.Printable()));
437 }
438 
439 
441 {
442  MHVariable::Initialise(p, engine);
443  // Original value should be a content reference.
444  MHParseNode *pInitial = p->GetNamedArg(C_ORIGINAL_VALUE);
445 
446  // and this should be a ContentRef node.
447  if (pInitial)
448  {
449  MHParseNode *pArg = pInitial->GetNamedArg(C_CONTENT_REFERENCE);
450 
451  if (pArg)
452  {
453  m_OriginalValue.Initialise(pArg->GetArgN(0), engine);
454  }
455  }
456 }
457 
458 void MHContentRefVar::PrintMe(FILE *fd, int nTabs) const
459 {
460  PrintTabs(fd, nTabs);
461  fprintf(fd, "{:ContentRefVar");
462  MHVariable::PrintMe(fd, nTabs + 1);
463  PrintTabs(fd, nTabs + 1);
464  fprintf(fd, ":OrigValue ");
465  m_OriginalValue.PrintMe(fd, nTabs + 1);
466  fprintf(fd, "\n");
467  PrintTabs(fd, nTabs);
468  fprintf(fd, "}\n");
469 }
470 
472 {
473  if (m_fAvailable)
474  {
475  return;
476  }
477 
479  MHVariable::Preparation(engine);
480 }
481 
482 // Implement the TestVariable action. Triggers a TestEvent event on the result.
483 void MHContentRefVar::TestVariable(int nOp, const MHUnion &parm, MHEngine *engine)
484 {
486  bool fRes = false;
487 
488  switch (nOp)
489  {
490  case TC_Equal:
491  fRes = m_Value.Equal(parm.m_ContentRefVal, engine);
492  break;
493  case TC_NotEqual:
494  fRes = !m_Value.Equal(parm.m_ContentRefVal, engine);
495  break;
496  default:
497  MHERROR("Invalid comparison for content ref");
498  }
499 
500  engine->EventTriggered(this, EventTestEvent, fRes);
501 }
502 
503 // Get the variable value. Used in IndirectRef.
505 {
506  value.m_Type = MHUnion::U_ContentRef;
508 }
509 
510 // Implement the SetVariable action.
512 {
515  MHLOG(MHLogDetail, QString("Update %1 := %2").arg(m_ObjectReference.Printable()).arg(m_Value.Printable()));
516 }
517 
518 // Actions
520 {
521  MHElemAction::Initialise(p, engine); // Target
522  m_NewValue.Initialise(p->GetArgN(1), engine); // Value to store
523 }
524 
526 {
527  MHObjectRef target;
528  m_Target.GetValue(target, engine); // Get the target
529  MHUnion newValue;
530  newValue.GetValueFrom(m_NewValue, engine); // Get the actual value to set.
531  engine->FindObject(target)->SetVariableValue(newValue); // Set the value.
532 }
533 
534 
536 {
537  MHElemAction::Initialise(p, engine); // Target
538  m_nOperator = p->GetArgN(1)->GetIntValue(); // Test to perform
539  m_Comparison.Initialise(p->GetArgN(2), engine); // Value to compare against
540 }
541 
542 void MHTestVariable::PrintArgs(FILE *fd, int /*nTabs*/) const
543 {
544  fprintf(fd, " %d ", m_nOperator);
545  m_Comparison.PrintMe(fd, 0);
546 }
547 
549 {
550  MHObjectRef target;
551  m_Target.GetValue(target, engine); // Get the target
552  MHUnion testValue;
553  testValue.GetValueFrom(m_Comparison, engine); // Get the actual value to compare.
554  engine->FindObject(target)->TestVariable(m_nOperator, testValue, engine); // Do the test.
555 }
556 
558 {
559  MHElemAction::Initialise(p, engine); // Target
560  MHParseNode *pOp = p->GetArgN(1);
561  m_Operand.Initialise(pOp, engine); // Operand to add, subtract etc.
562 }
563 
565 {
566  MHUnion targetVal;
567  // Find the target and get its current value. The target can be an indirect reference.
568  MHObjectRef parm;
569  m_Target.GetValue(parm, engine);
570  MHRoot *pTarget = engine->FindObject(parm);
571  pTarget->GetVariableValue(targetVal, engine);
572  targetVal.CheckType(MHUnion::U_Int);
573  // Get the value of the operand.
574  int nOperand = m_Operand.GetValue(engine);
575  // Set the value of targetVal to the new value and store it.
576  targetVal.m_nIntVal = DoOp(targetVal.m_nIntVal, nOperand);
577  pTarget->SetVariableValue(targetVal);
578 }
579 
581 {
582  MHElemAction::Initialise(p, engine); // Target
583  m_Operand.Initialise(p->GetArgN(1), engine); // Operand to append
584 }
585 
587 {
588  MHUnion targetVal;
589  // Find the target and get its current value. The target can be an indirect reference.
590  MHObjectRef parm;
591  m_Target.GetValue(parm, engine);
592  MHRoot *pTarget = engine->FindObject(parm);
593  pTarget->GetVariableValue(targetVal, engine);
594  targetVal.CheckType(MHUnion::U_String);
595  // Get the string to append.
596  MHOctetString toAppend;
597  m_Operand.GetValue(toAppend, engine);
598  targetVal.m_StrVal.Append(toAppend); // Add it on the end
599  pTarget->SetVariableValue(targetVal); // Set the target to the result.
600 }
void Initialise(MHParseNode *p, MHEngine *engine)
bool m_fBoolVal
Definition: BaseClasses.h:293
void PrintMe(FILE *fd, int nTabs) const
Definition: BaseClasses.h:179
void Preparation(MHEngine *engine) override
void Initialise(MHParseNode *p, MHEngine *engine)
void Append(const MHOctetString &str)
int m_nIntVal
Definition: BaseClasses.h:292
void PrintMe(FILE *fd, int nTabs) const override
Definition: Variables.cpp:379
void TestVariable(int nOp, const MHUnion &parm, MHEngine *engine) override
Definition: Variables.cpp:302
void Initialise(MHParseNode *p, MHEngine *engine) override
Definition: Variables.cpp:580
void SetVariableValue(const MHUnion &value) override
Definition: Variables.cpp:218
void PrintMe(FILE *fd, int nTabs) const override
#define MHERROR(__text)
Definition: Logging.h:42
void PrintMe(FILE *fd, int nTabs) const
void TestVariable(int nOp, const MHUnion &parm, MHEngine *engine) override
Definition: Variables.cpp:404
void Initialise(MHParseNode *p, MHEngine *engine) override
Definition: Variables.cpp:557
void GetVariableValue(MHUnion &value, MHEngine *) override
Definition: Variables.cpp:425
void Initialise(MHParseNode *p, MHEngine *engine) override
Definition: Variables.cpp:361
void SetVariableValue(const MHUnion &value) override
Definition: Variables.cpp:511
virtual void SetVariableValue(const MHUnion &)
Definition: Root.h:101
MHGenericObjectRef m_Target
Definition: BaseActions.h:46
void Preparation(MHEngine *engine) override
Definition: Variables.cpp:392
virtual void GetVariableValue(MHUnion &, MHEngine *)
Definition: Root.h:100
void Preparation(MHEngine *engine) override
Definition: Variables.cpp:91
virtual void Activation(MHEngine *engine)
Definition: Root.cpp:69
bool m_fAvailable
Definition: Root.h:207
void PrintMe(FILE *fd, int nTabs) const override
Definition: Variables.cpp:277
QString Printable() const
MHContentRef m_OriginalValue
Definition: Variables.h:146
void PrintMe(FILE *fd, int nTabs) const override
Definition: Variables.cpp:153
MHContentRef m_Value
Definition: Variables.h:146
void GetVariableValue(MHUnion &value, MHEngine *) override
Definition: Variables.cpp:211
int GetValue(MHEngine *engine) const
void Copy(const MHObjectRef &objr)
void GetValue(MHOctetString &str, MHEngine *engine) const
MHObjectRef m_OriginalValue
Definition: Variables.h:125
unsigned char GetAt(int i) const
Definition: BaseClasses.h:121
void TestVariable(int nOp, const MHUnion &parmm, MHEngine *engine) override
Definition: Variables.cpp:176
void GetVariableValue(MHUnion &value, MHEngine *) override
Definition: Variables.cpp:504
void TestVariable(int nOp, const MHUnion &parm, MHEngine *engine) override
Definition: Variables.cpp:103
MHContentRef m_ContentRefVal
Definition: BaseClasses.h:296
void GetValueFrom(const MHParameter &value, MHEngine *engine)
void Activation(MHEngine *engine) override
Definition: Variables.cpp:56
MHOctetString m_Value
Definition: Variables.h:104
void Initialise(MHParseNode *p, MHEngine *engine) override
Definition: Variables.cpp:68
bool Equal(const MHContentRef &cr, MHEngine *engine) const
void Preparation(MHEngine *engine) override
Definition: Variables.cpp:290
void Copy(const MHContentRef &cr)
Definition: BaseClasses.h:180
void GetValue(MHObjectRef &ref, MHEngine *engine) const
void TestVariable(int nOp, const MHUnion &parm, MHEngine *engine) override
Definition: Variables.cpp:483
void CheckType(enum UnionTypes) const
void PrintMe(FILE *fd, int nTabs) const override
Definition: Variables.cpp:458
static const char * TestToText(int tc)
Definition: Variables.cpp:34
void PrintTabs(FILE *fd, int n)
Definition: ParseNode.cpp:34
void PrintMe(FILE *fd, int nTabs) const override
Definition: Variables.cpp:80
void Initialise(MHParseNode *p, MHEngine *engine) override
Definition: Variables.cpp:519
void SetVariableValue(const MHUnion &value) override
Definition: Variables.cpp:339
void Copy(const MHOctetString &str)
void Initialise(MHParseNode *p, MHEngine *engine) override
Definition: Variables.cpp:535
int Size() const
Definition: BaseClasses.h:117
void Initialise(MHParseNode *p, MHEngine *engine) override
Definition: Ingredients.cpp:49
#define C_CONTENT_REFERENCE
Definition: ASN1Codes.h:102
QString Printable() const
Definition: BaseClasses.h:184
int GetIntValue()
Definition: ParseNode.cpp:170
int m_nValue
Definition: Variables.h:83
void Perform(MHEngine *engine) override
Definition: Variables.cpp:564
QString Printable() const
Definition: BaseClasses.h:125
void EventTriggered(MHRoot *pSource, enum EventType ev)
Definition: Engine.h:93
void GetStringValue(MHOctetString &str)
Definition: ParseNode.cpp:203
MHParseNode * GetNamedArg(int nTag)
Definition: ParseNode.cpp:110
void GetVariableValue(MHUnion &value, MHEngine *) override
Definition: Variables.cpp:332
void PrintMe(FILE *fd, int nTabs) const
void Initialise(MHParseNode *p, MHEngine *engine) override
Definition: Variables.cpp:440
bool m_fOriginalValue
Definition: Variables.h:60
#define C_OBJECT_REFERENCE
Definition: ASN1Codes.h:101
Definition: Root.h:43
void PrintMe(FILE *fd, int nTabs) const
bool m_fRunning
Definition: Root.h:208
MHObjectRef m_ObjectReference
Definition: Root.h:203
bool Equal(const MHObjectRef &objr, MHEngine *engine) const
int FILE
Definition: mythburn.py:110
void Initialise(MHParseNode *p, MHEngine *engine)
MHGenericInteger m_Operand
Definition: Variables.h:189
int m_nOriginalValue
Definition: Variables.h:82
MHParameter m_NewValue
Definition: Variables.h:160
MHParameter m_Comparison
Definition: Variables.h:173
void Initialise(MHParseNode *p, MHEngine *engine)
MHRoot * FindObject(const MHObjectRef &oRef, bool failOnNotFound=true)
Definition: Engine.cpp:575
MHOctetString m_StrVal
Definition: BaseClasses.h:294
MHGenericOctetString m_Operand
Definition: Variables.h:244
#define C_ORIGINAL_VALUE
Definition: ASN1Codes.h:100
#define MHLOG(__level, __text)
Definition: Logging.h:36
virtual void Initialise(MHParseNode *p, MHEngine *engine)
Definition: BaseActions.cpp:31
void PrintArgs(FILE *fd, int nTabs) const override
Definition: Variables.cpp:542
bool GetBoolValue()
Definition: ParseNode.cpp:192
void Perform(MHEngine *engine) override
Definition: Variables.cpp:586
void Initialise(MHParseNode *p, MHEngine *engine)
void SetVariableValue(const MHUnion &value) override
Definition: Variables.cpp:432
bool m_fValue
Definition: Variables.h:61
MHObjectRef m_Value
Definition: Variables.h:125
MHObjectRef m_ObjRefVal
Definition: BaseClasses.h:295
MHParseNode * GetArgN(int n)
Definition: ParseNode.cpp:78
void Preparation(MHEngine *engine) override
Definition: Variables.cpp:164
void Initialise(MHParseNode *p, MHEngine *engine) override
Definition: Variables.cpp:141
virtual void TestVariable(int, const MHUnion &, MHEngine *)
Definition: Root.h:99
int Compare(const MHOctetString &str) const
virtual int DoOp(int arg1, int arg2)=0
void Preparation(MHEngine *engine) override
Definition: Variables.cpp:471
void Perform(MHEngine *engine) override
Definition: Variables.cpp:548
MHOctetString m_OriginalValue
Definition: Variables.h:104
TestCodes
Definition: Variables.cpp:32
void Initialise(MHParseNode *p, MHEngine *engine) override
Definition: Variables.cpp:265
void GetVariableValue(MHUnion &value, MHEngine *) override
Definition: Variables.cpp:126
void SetVariableValue(const MHUnion &value) override
Definition: Variables.cpp:133
void Perform(MHEngine *engine) override
Definition: Variables.cpp:525