1#include <qpro/common.h>
5#include <qpro/record_factory.h>
7#define NEWFUNC(x) static QpRec* NEW_##x (TQP_INT16 pLen, QpIStream& pIn) { return new x (pLen, pIn); }
12NEWFUNC(QpRecEmptyCell)
13NEWFUNC(QpRecFloatingPointCell)
14NEWFUNC(QpRecFormulaCell)
15NEWFUNC(QpRecIntegerCell)
16NEWFUNC(QpRecLabelCell)
19NEWFUNC(QpRecRecalcMode)
20NEWFUNC(QpRecRecalcOrder)
26 QpRec* (*Func)(TQP_INT16, QpIStream&);
33static Record gRecord[] =
35 {QpBof, 2, NEW_QpRecBof},
36 {QpEof, 0, NEW_QpRecEof},
37 {QpRecalcMode, 1, NEW_QpRecRecalcMode},
38 {QpRecalcOrder, 1, NEW_QpRecRecalcOrder},
39 {QpEmptyCell, 6, NEW_QpRecEmptyCell},
40 {QpIntegerCell, 8, NEW_QpRecIntegerCell},
41 {QpFloatingPointCell, 14, NEW_QpRecFloatingPointCell},
42 {QpLabelCell, 0, NEW_QpRecLabelCell},
43 {QpFormulaCell, 0, NEW_QpRecFormulaCell},
44 {QpBop, 0, NEW_QpRecBop},
45 {QpPageName, 0, NEW_QpRecPageName},
46 {QpPassword, 0, NEW_QpRecPassword},
50QpRecFactory::QpRecFactory(QpIStream& pIn)
55QpRecFactory::~QpRecFactory()
60QpRecFactory::nextRecord()
68 for( Record* lRecord=gRecord; lResult == 0 ; ++lRecord )
70 if( lRecord->Func == 0 )
72 lResult =
new QpRecUnknown( lType, lLen, cIn );
75 if( lRecord->Type == lType )
78 lResult = lRecord->Func(lLen, cIn);