MythTV master
BaseClasses.cpp
Go to the documentation of this file.
1/* BaseClasses.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
22#include "BaseClasses.h"
23
24#include <algorithm>
25
26#include "ParseNode.h"
27#include "Engine.h"
28#include "ASN1Codes.h"
29#include "Logging.h"
30
31#ifdef _DEBUG
32#undef THIS_FILE
33static char THIS_FILE[] = __FILE__;
34#define new DEBUG_NEW
35#endif
36
37// Construct from a string
38MHOctetString::MHOctetString(const char *str, int nLen)
39{
40 if (nLen < 0)
41 {
42 nLen = strlen(str);
43 }
44
45 m_nLength = nLen;
46
47 if (nLen == 0)
48 {
49 m_pChars = nullptr;
50 }
51 else
52 {
53 m_pChars = (unsigned char *)malloc(nLen + 1);
54
55 if (! m_pChars)
56 {
57 throw "Out of memory";
58 }
59
60 memcpy(m_pChars, str, nLen);
61 }
62}
63
64MHOctetString::MHOctetString(const unsigned char *str, int nLen)
65 : m_nLength(nLen)
66{
67 if (nLen == 0)
68 {
69 m_pChars = nullptr;
70 }
71 else
72 {
73 m_pChars = (unsigned char *)malloc(nLen + 1);
74
75 if (! m_pChars)
76 {
77 throw "Out of memory";
78 }
79
80 memcpy(m_pChars, str, nLen);
81 }
82}
83
84// Construct a substring.
85MHOctetString::MHOctetString(const MHOctetString &str, int nOffset, int nLen)
86{
87 if (nLen < 0)
88 {
89 nLen = str.Size() - nOffset; // The rest of the string.
90 }
91
92 nLen = std::clamp(nLen, 0, str.Size());
93
94 m_nLength = nLen;
95
96 if (nLen == 0)
97 {
98 m_pChars = nullptr;
99 }
100 else
101 {
102 m_pChars = (unsigned char *)malloc(nLen + 1);
103
104 if (! m_pChars)
105 {
106 throw "Out of memory";
107 }
108
109 memcpy(m_pChars, str.m_pChars + nOffset, nLen);
110 }
111}
112
114{
115 free(m_pChars);
116}
117
118// Copy a string
120{
121 free(m_pChars);
122 m_pChars = nullptr;
123 m_nLength = str.m_nLength;
124
125 if (str.m_pChars)
126 {
127 // Allocate a copy of the string. For simplicity we always add a null.
128 m_pChars = (unsigned char *)malloc(m_nLength + 1);
129
130 if (m_pChars == nullptr)
131 {
132 throw "Out of memory";
133 }
134
135 memcpy(m_pChars, str.m_pChars, m_nLength);
136 m_pChars[m_nLength] = 0;
137 }
138}
139
140// Print the string in a suitable format.
141// For the moment it uses quoted printable.
142void MHOctetString::PrintMe(FILE *fd, int /*nTabs*/) const
143{
144 putc('\'', fd);
145
146 for (int i = 0; i < m_nLength; i++)
147 {
148 unsigned char ch = m_pChars[i];
149
150 // Escape a non-printable character or an equal sign or a quote.
151 if (ch == '=' || ch == '\'' || ch < ' ' || ch >= 127)
152 {
153 fprintf(fd, "=%02X", ch);
154 }
155 else
156 {
157 putc(ch, fd);
158 }
159 }
160
161 putc('\'', fd);
162}
163
164// Test strings.
166{
167 int nLength = m_nLength;
168
169 nLength = std::min(nLength, str.m_nLength);
170
171 // Test up to the length of the shorter string.
172 int nTest = 0;
173
174 if (nLength > 0)
175 {
176 nTest = memcmp(str.m_pChars, m_pChars, nLength);
177 }
178
179 // If they differ return the result
180 if (nTest != 0)
181 {
182 return nTest;
183 }
184
185 // If they are the same then the longer string is greater.
186 if (m_nLength == str.m_nLength)
187 {
188 return 0;
189 }
190 if (m_nLength < str.m_nLength)
191 {
192 return -1;
193 }
194 return 1;
195}
196
197// Add text to the end of the string.
199{
200 if (str.m_nLength == 0)
201 {
202 return; // Nothing to do and it simplifies the code
203 }
204
205 int newLen = m_nLength + str.m_nLength;
206 // Allocate a new string big enough to contain both and initialised to the first string.
207 auto *p = (unsigned char *)realloc(m_pChars, newLen);
208
209 if (p == nullptr)
210 {
211 throw "Out of memory";
212 }
213
214 m_pChars = p;
215 // Copy the second string onto the end of the first.
216 memcpy(m_pChars + m_nLength, str.m_pChars, str.m_nLength);
217 m_nLength = newLen;
218}
219
220// Colour
222{
223 if (p->m_nNodeType == MHParseNode::PNInt)
224 {
225 m_nColIndex = p->GetIntValue();
226 }
227 else
228 {
229 p->GetStringValue(m_colStr);
230 }
231}
232
233void MHColour::PrintMe(FILE *fd, int nTabs) const
234{
235 if (m_nColIndex >= 0)
236 {
237 fprintf(fd, " %d ", m_nColIndex);
238 }
239 else
240 {
241 m_colStr.PrintMe(fd, nTabs);
242 }
243}
244
245void MHColour::SetFromString(const char *str, int nLen)
246{
247 m_nColIndex = -1;
248 m_colStr.Copy(MHOctetString(str, nLen));
249}
250
251void MHColour::Copy(const MHColour &col)
252{
255}
256
257// An object reference is used to identify and refer to an object.
258// Internal objects have the m_groupId field empty.
259
260MHObjectRef MHObjectRef::Null; // This has zero for the object number and an empty group id.
261
262// An object reference is either an integer or a pair of a group id and an integer.
264{
265 if (p->m_nNodeType == MHParseNode::PNInt)
266 {
267 m_nObjectNo = p->GetIntValue();
268 // Set the group id to the id of this group.
269 m_groupId.Copy(engine->GetGroupId());
270 }
271 else if (p->m_nNodeType == MHParseNode::PNSeq)
272 {
273 MHParseNode *pFirst = p->GetSeqN(0);
274 MHOctetString groupId;
275 pFirst->GetStringValue(m_groupId);
276 m_nObjectNo = p->GetSeqN(1)->GetIntValue();
277 }
278 else
279 {
280 MHParseNode::Failure("ObjectRef: Argument is not int or sequence");
281 }
282}
283
284void MHObjectRef::PrintMe(FILE *fd, int nTabs) const
285{
286 if (m_groupId.Size() == 0)
287 {
288 fprintf(fd, " %d ", m_nObjectNo);
289 }
290 else
291 {
292 fprintf(fd, " ( ");
293 m_groupId.PrintMe(fd, nTabs);
294 fprintf(fd, " %d ) ", m_nObjectNo);
295 }
296}
297
299{
300 if (m_groupId.Size() == 0)
301 {
302 return QString(" %1 ").arg(m_nObjectNo);
303 }
304 return QString(" ( ") + m_groupId.Printable() + QString(" %1 ").arg(m_nObjectNo);
305}
306
307// Make a copy of an object reference.
309{
312}
313
314// The object references may not be identical but may nevertheless refer to the same
315// object. The only safe way to do this is to compare the canonical paths.
316bool MHObjectRef::Equal(const MHObjectRef &objr, MHEngine *engine) const
317{
318 return m_nObjectNo == objr.m_nObjectNo && engine->GetPathName(m_groupId) == engine->GetPathName(objr.m_groupId);
319}
320
321bool MHContentRef::Equal(const MHContentRef &cr, MHEngine *engine) const
322{
323 return engine->GetPathName(m_contentRef) == engine->GetPathName(cr.m_contentRef);
324}
325
326// "Generic" versions of int, bool etc can be either the value or the an indirect reference.
327
329{
331 {
332 // Indirect reference.
333 m_fIsDirect = false;
334 m_indirect.Initialise(pArg->GetArgN(0), engine);
335 }
336 else // Simple integer value.
337 {
338 m_fIsDirect = true;
339 m_fDirect = pArg->GetBoolValue();
340 }
341}
342
343void MHGenericBoolean::PrintMe(FILE *fd, int nTabs) const
344{
345 if (m_fIsDirect)
346 {
347 fprintf(fd, "%s ", m_fDirect ? "true" : "false");
348 }
349 else
350 {
351 fprintf(fd, ":IndirectRef ");
352 m_indirect.PrintMe(fd, nTabs + 1);
353 }
354}
355
356// Return the value, looking up any indirect ref.
358{
359 if (m_fIsDirect)
360 {
361 return m_fDirect;
362 }
363
364 MHUnion result;
365 MHRoot *pBase = engine->FindObject(m_indirect);
366 pBase->GetVariableValue(result, engine);
368 return result.m_fBoolVal;
369}
370
371// Return the indirect reference or fail if it's direct
373{
374 if (m_fIsDirect)
375 {
376 MHERROR("Expected indirect reference");
377 }
378
379 return &m_indirect;
380}
381
383{
385 {
386 // Indirect reference.
387 m_fIsDirect = false;
388 m_indirect.Initialise(pArg->GetArgN(0), engine);
389 }
390 else // Simple integer value.
391 {
392 m_fIsDirect = true;
393 m_nDirect = pArg->GetIntValue();
394 }
395}
396
397void MHGenericInteger::PrintMe(FILE *fd, int nTabs) const
398{
399 if (m_fIsDirect)
400 {
401 fprintf(fd, "%d ", m_nDirect);
402 }
403 else
404 {
405 fprintf(fd, ":IndirectRef ");
406 m_indirect.PrintMe(fd, nTabs + 1);
407 }
408}
409
410// Return the value, looking up any indirect ref.
412{
413 if (m_fIsDirect)
414 {
415 return m_nDirect;
416 }
417
418 MHUnion result;
419 MHRoot *pBase = engine->FindObject(m_indirect);
420 pBase->GetVariableValue(result, engine);
421
422 // From my reading of the MHEG documents implicit conversion is only
423 // performed when assigning variables. Nevertheless the Channel 4
424 // Teletext assumes that implicit conversion takes place here as well.
425 if (result.m_Type == MHUnion::U_String)
426 {
427 // Implicit conversion of string to integer.
428 int v = 0;
429 int p = 0;
430 bool fNegative = false;
431
432 if (result.m_strVal.Size() > 0 && result.m_strVal.GetAt(0) == '-')
433 {
434 p++;
435 fNegative = true;
436 }
437
438 for (; p < result.m_strVal.Size(); p++)
439 {
440 unsigned char ch = result.m_strVal.GetAt(p);
441
442 if (ch < '0' || ch > '9')
443 {
444 break;
445 }
446
447 v = (v * 10) + ch - '0';
448 }
449
450 if (fNegative)
451 {
452 return -v;
453 }
454 return v;
455 }
456
458 return result.m_nIntVal;
459}
460
462{
464 {
465 // Indirect reference.
466 m_fIsDirect = false;
467 m_indirect.Initialise(pArg->GetArgN(0), engine);
468 }
469 else // Simple string value.
470 {
471 m_fIsDirect = true;
473 }
474}
475
476void MHGenericOctetString::PrintMe(FILE *fd, int /*nTabs*/) const
477{
478 if (m_fIsDirect)
479 {
480 m_direct.PrintMe(fd, 0);
481 }
482 else
483 {
484 fprintf(fd, ":IndirectRef ");
485 m_indirect.PrintMe(fd, 0);
486 }
487}
488
489// Return the value, looking up any indirect ref.
491{
492 if (m_fIsDirect)
493 {
494 str.Copy(m_direct);
495 }
496 else
497 {
498 MHUnion result;
499 MHRoot *pBase = engine->FindObject(m_indirect);
500 pBase->GetVariableValue(result, engine);
501
502 // From my reading of the MHEG documents implicit conversion is only
503 // performed when assigning variables. Nevertheless the Channel 4
504 // Teletext assumes that implicit conversion takes place here as well.
505 if (result.m_Type == MHUnion::U_Int)
506 {
507 // Implicit conversion of int to string.
508 str.Copy(std::to_string(result.m_nIntVal).data());
509 }
510 else
511 {
513 str.Copy(result.m_strVal);
514 }
515 }
516}
517
519{
521 {
522 // Indirect reference.
523 m_fIsDirect = false;
524 m_indirect.Initialise(pArg->GetArgN(0), engine);
525 }
526 else // Direct reference.
527 {
528 m_fIsDirect = true;
529 m_objRef.Initialise(pArg, engine);
530 }
531}
532
533void MHGenericObjectRef::PrintMe(FILE *fd, int nTabs) const
534{
535 if (m_fIsDirect)
536 {
537 m_objRef.PrintMe(fd, nTabs + 1);
538 }
539 else
540 {
541 fprintf(fd, ":IndirectRef ");
542 m_indirect.PrintMe(fd, nTabs + 1);
543 }
544}
545
546// Return the value, looking up any indirect ref.
548{
549 if (m_fIsDirect)
550 {
551 ref.Copy(m_objRef);
552 }
553 else
554 {
555 // LVR - Hmm I don't think this is right. Should be: ref.Copy(m_indirect);
556 // But it's used in several places so workaround in Stream::MHActionGenericObjectRefFix
557 MHUnion result;
558 MHRoot *pBase = engine->FindObject(m_indirect);
559 pBase->GetVariableValue(result, engine);
561 ref.Copy(result.m_objRefVal);
562 }
563}
564
566{
567 if (pArg->GetTagNo() == C_INDIRECTREFERENCE)
568 {
569 // Indirect reference.
570 m_fIsDirect = false;
571 m_indirect.Initialise(pArg->GetArgN(0), engine);
572 }
573 else if (pArg->GetTagNo() == C_CONTENT_REFERENCE) // Direct reference.
574 {
575 m_fIsDirect = true;
576 m_direct.Initialise(pArg->GetArgN(0), engine);
577 }
578 else
579 {
580 MHERROR("Expected direct or indirect content reference");
581 }
582}
583
584void MHGenericContentRef::PrintMe(FILE *fd, int /*nTabs*/) const
585{
586 if (m_fIsDirect)
587 {
588 m_direct.PrintMe(fd, 0);
589 }
590 else
591 {
592 fprintf(fd, ":IndirectRef ");
593 m_indirect.PrintMe(fd, 0);
594 }
595}
596
597// Return the value, looking up any indirect ref.
599{
600 if (m_fIsDirect)
601 {
602 ref.Copy(m_direct);
603 }
604 else
605 {
606 MHUnion result;
607 MHRoot *pBase = engine->FindObject(m_indirect);
608 pBase->GetVariableValue(result, engine);
610 ref.Copy(result.m_contentRefVal);
611 }
612}
613
614// Copies the argument, getting the value of an indirect args.
615void MHUnion::GetValueFrom(const MHParameter &value, MHEngine *engine)
616{
617 switch (value.m_Type)
618 {
620 m_Type = U_Int;
621 m_nIntVal = value.m_intVal.GetValue(engine);
622 break;
624 m_Type = U_Bool;
625 m_fBoolVal = value.m_boolVal.GetValue(engine);
626 break;
628 m_Type = U_String;
629 value.m_strVal.GetValue(m_strVal, engine);
630 break;
632 m_Type = U_ObjRef;
633 value.m_objRefVal.GetValue(m_objRefVal, engine);
634 break;
636 m_Type = U_ContentRef;
638 break;
640 m_Type = U_None;
641 break;
642 }
643}
644
646{
647 switch (t)
648 {
649 case U_Int:
650 return "int";
651 case U_Bool:
652 return "bool";
653 case U_String:
654 return "string";
655 case U_ObjRef:
656 return "objref";
657 case U_ContentRef:
658 return "contentref";
659 case U_None:
660 return "none";
661 }
662
663 return ""; // Not reached.
664}
665
667{
668 if (m_Type != t)
669 {
670 MHERROR(QString("Type mismatch - expected %1 found %2")
671 .arg(GetAsString(m_Type), GetAsString(t)));
672 }
673}
674
675QString MHUnion::Printable() const
676{
677 switch (m_Type)
678 {
679 case U_Int: return QString::number(m_nIntVal);
680 case U_Bool: return m_fBoolVal ? "true" : "false";
681 case U_String: return m_strVal.Printable();
682 case U_ObjRef: return m_objRefVal.Printable();
684 case U_None: break;
685 }
686 return "";
687}
688
689// A parameter is a generic whose argument is either the value itself or an indirect reference.
691{
692 switch (p->GetTagNo())
693 {
695 m_Type = P_Bool;
696 m_boolVal.Initialise(p->GetArgN(0), engine);
697 break;
699 m_Type = P_Int;
700 m_intVal.Initialise(p->GetArgN(0), engine);
701 break;
703 m_Type = P_String;
704 m_strVal.Initialise(p->GetArgN(0), engine);
705 break;
707 m_Type = P_ObjRef;
708 m_objRefVal.Initialise(p->GetArgN(0), engine);
709 break;
711 m_Type = P_ContentRef;
712 m_contentRefVal.Initialise(p->GetArgN(0), engine);
713 break;
714 default:
715 MHParseNode::Failure("Expected generic");
716 }
717}
718
719void MHParameter::PrintMe(FILE *fd, int nTabs) const
720{
721 PrintTabs(fd, nTabs);
722
723 switch (m_Type)
724 {
725 // Direct values.
726 case P_Int:
727 fprintf(fd, ":GInteger ");
728 m_intVal.PrintMe(fd, 0);
729 break;
730 case P_Bool:
731 fprintf(fd, ":GBoolean ");
732 m_boolVal.PrintMe(fd, 0);
733 break;
734 case P_String:
735 fprintf(fd, ":GOctetString ");
736 m_strVal.PrintMe(fd, 0);
737 break;
738 case P_ObjRef:
739 fprintf(fd, ":GObjectRef ");
740 m_objRefVal.PrintMe(fd, 0);
741 break;
742 case P_ContentRef:
743 fprintf(fd, ":GObjectRef ");
745 break;
746 case P_Null:
747 break;
748 }
749}
750
751// Return the indirect reference so that it can be updated. We don't need to check
752// the type at this stage. If we assign the wrong value that will be picked up in
753// the assignment.
755{
756 switch (m_Type)
757 {
758 case P_Int:
759 return m_intVal.GetReference();
760 case P_Bool:
761 return m_boolVal.GetReference();
762 case P_String:
763 return m_strVal.GetReference();
764 case P_ObjRef:
765 return m_objRefVal.GetReference();
766 case P_ContentRef:
768 case P_Null:
769 return nullptr;
770 }
771
772 return nullptr; // To keep VC++ happy
773}
774
775// A content reference is simply a string.
776MHContentRef MHContentRef::Null; // This is the empty string.
777
779{
780 p->GetStringValue(m_contentRef);
781}
782
784{
785 if (p->m_nNodeType == MHParseNode::PNString)
786 {
787 p->GetStringValue(m_dirFont);
788 }
789 else
790 {
791 m_indirFont.Initialise(p, engine);
792 }
793}
794
795void MHFontBody::PrintMe(FILE *fd, int nTabs) const
796{
797 if (m_dirFont.Size() > 0)
798 {
799 m_dirFont.PrintMe(fd, nTabs);
800 }
801 else
802 {
803 m_indirFont.PrintMe(fd, nTabs);
804 }
805}
806
808{
811}
812
814{
815 m_x.Initialise(p->GetSeqN(0), engine);
816 m_y.Initialise(p->GetSeqN(1), engine);
817}
818
819void MHPointArg::PrintMe(FILE *fd, int nTabs) const
820{
821 fprintf(fd, "( ");
822 m_x.PrintMe(fd, nTabs);
823 m_y.PrintMe(fd, nTabs);
824 fprintf(fd, ") ");
825}
826
@ C_NEW_GENERIC_OCTETSTRING
Definition: ASN1Codes.h:263
@ C_INDIRECTREFERENCE
Definition: ASN1Codes.h:272
@ C_NEW_GENERIC_BOOLEAN
Definition: ASN1Codes.h:261
@ C_NEW_GENERIC_CONTENT_REF
Definition: ASN1Codes.h:265
@ C_CONTENT_REFERENCE
Definition: ASN1Codes.h:105
@ C_NEW_GENERIC_OBJECT_REF
Definition: ASN1Codes.h:264
@ C_NEW_GENERIC_INTEGER
Definition: ASN1Codes.h:262
#define MHERROR(__text)
Definition: Logging.h:42
void PrintTabs(FILE *fd, int n)
Definition: ParseNode.cpp:34
void Initialise(MHParseNode *p, MHEngine *engine)
void PrintMe(FILE *fd, int nTabs) const
MHOctetString m_colStr
Definition: BaseClasses.h:147
void SetFromString(const char *str, int nLen)
void Copy(const MHColour &col)
int m_nColIndex
Definition: BaseClasses.h:148
void Initialise(MHParseNode *p, MHEngine *engine)
static MHContentRef Null
Definition: BaseClasses.h:186
MHOctetString m_contentRef
Definition: BaseClasses.h:189
void Copy(const MHContentRef &cr)
Definition: BaseClasses.h:183
void PrintMe(FILE *fd, int nTabs) const
Definition: BaseClasses.h:182
bool Equal(const MHContentRef &cr, MHEngine *engine) const
QString Printable() const
Definition: BaseClasses.h:187
MHRoot * FindObject(const MHObjectRef &oRef, bool failOnNotFound=true)
Definition: Engine.cpp:574
QString GetPathName(const MHOctetString &str)
Definition: Engine.cpp:523
MHOctetString & GetGroupId()
Definition: Engine.h:153
MHObjectRef m_indirFont
Definition: BaseClasses.h:319
void Copy(const MHFontBody &fb)
void PrintMe(FILE *fd, int nTabs) const
MHOctetString m_dirFont
Definition: BaseClasses.h:318
void Initialise(MHParseNode *p, MHEngine *engine)
MHObjectRef m_indirect
Definition: BaseClasses.h:199
MHObjectRef * GetReference()
void PrintMe(FILE *fd, int nTabs) const
void Initialise(MHParseNode *p, MHEngine *engine)
bool GetValue(MHEngine *engine) const
void GetValue(MHContentRef &ref, MHEngine *engine) const
void Initialise(MHParseNode *p, MHEngine *engine)
void PrintMe(FILE *fd, int nTabs) const
MHContentRef m_direct
Definition: BaseClasses.h:254
void Initialise(MHParseNode *p, MHEngine *engine)
int GetValue(MHEngine *engine) const
void PrintMe(FILE *fd, int nTabs) const
void Initialise(MHParseNode *p, MHEngine *engine)
void PrintMe(FILE *fd, int nTabs) const
MHObjectRef m_objRef
Definition: BaseClasses.h:243
void GetValue(MHObjectRef &ref, MHEngine *engine) const
MHOctetString m_direct
Definition: BaseClasses.h:232
void PrintMe(FILE *fd, int nTabs) const
void Initialise(MHParseNode *p, MHEngine *engine)
void GetValue(MHOctetString &str, MHEngine *engine) const
MHOctetString m_groupId
Definition: BaseClasses.h:170
bool Equal(const MHObjectRef &objr, MHEngine *engine) const
QString Printable() const
void PrintMe(FILE *fd, int nTabs) const
static MHObjectRef Null
Definition: BaseClasses.h:159
void Initialise(MHParseNode *p, MHEngine *engine)
void Copy(const MHObjectRef &objr)
virtual ~MHOctetString()
void Copy(const MHOctetString &str)
unsigned char * m_pChars
Definition: BaseClasses.h:134
int Size() const
Definition: BaseClasses.h:120
unsigned char GetAt(int i) const
Definition: BaseClasses.h:124
void Append(const MHOctetString &str)
void PrintMe(FILE *fd, int nTabs) const
QString Printable() const
Definition: BaseClasses.h:128
MHOctetString()=default
int Compare(const MHOctetString &str) const
MHGenericContentRef m_contentRefVal
Definition: BaseClasses.h:279
MHGenericOctetString m_strVal
Definition: BaseClasses.h:277
MHGenericBoolean m_boolVal
Definition: BaseClasses.h:276
MHGenericObjectRef m_objRefVal
Definition: BaseClasses.h:278
MHGenericInteger m_intVal
Definition: BaseClasses.h:275
MHObjectRef * GetReference()
enum MHParameter::ParamTypes P_Null
void Initialise(MHParseNode *p, MHEngine *engine)
void PrintMe(FILE *fd, int nTabs) const
MHParseNode * GetArgN(int n)
Definition: ParseNode.cpp:78
static void Failure(const char *p)
Definition: ParseNode.cpp:43
void GetStringValue(MHOctetString &str)
Definition: ParseNode.cpp:203
int GetTagNo()
Definition: ParseNode.cpp:49
bool GetBoolValue()
Definition: ParseNode.cpp:192
enum NodeType m_nNodeType
Definition: ParseNode.h:46
int GetIntValue()
Definition: ParseNode.cpp:170
MHGenericInteger m_x
Definition: BaseClasses.h:328
void PrintMe(FILE *fd, int nTabs) const
MHGenericInteger m_y
Definition: BaseClasses.h:328
void Initialise(MHParseNode *p, MHEngine *engine)
Definition: Root.h:45
virtual void GetVariableValue(MHUnion &, MHEngine *)
Definition: Root.h:107
QString Printable() const
bool m_fBoolVal
Definition: BaseClasses.h:303
int m_nIntVal
Definition: BaseClasses.h:302
MHObjectRef m_objRefVal
Definition: BaseClasses.h:305
MHContentRef m_contentRefVal
Definition: BaseClasses.h:306
void GetValueFrom(const MHParameter &value, MHEngine *engine)
void CheckType(enum UnionTypes t) const
@ U_ContentRef
Definition: BaseClasses.h:298
enum MHUnion::UnionTypes U_None
static const char * GetAsString(enum UnionTypes t)
MHOctetString m_strVal
Definition: BaseClasses.h:304
int FILE
Definition: mythburn.py:138
static eu8 clamp(eu8 value, eu8 low, eu8 high)
Definition: pxsup2dast.c:206