Qt 4.8
Classes | Public Functions | Public Variables | Protected Functions | Private Functions | Properties | Friends | List of all members
QDeclarativeCompiledData Class Reference

#include <qdeclarativecompiler_p.h>

Inheritance diagram for QDeclarativeCompiledData:
QDeclarativeRefCount QDeclarativeCleanup

Classes

struct  CustomTypeData
 
struct  TypeReference
 

Public Functions

void dumpInstructions ()
 
 QDeclarativeCompiledData (QDeclarativeEngine *engine)
 
virtual ~QDeclarativeCompiledData ()
 
- Public Functions inherited from QDeclarativeRefCount
void addref ()
 
 QDeclarativeRefCount ()
 
void release ()
 
virtual ~QDeclarativeRefCount ()
 
- Public Functions inherited from QDeclarativeCleanup
 QDeclarativeCleanup (QDeclarativeEngine *)
 
virtual ~QDeclarativeCleanup ()
 

Public Variables

QList< QDeclarativeInstructionbytecode
 
QList< QScriptValue * > cachedClosures
 
QList< QScriptProgram * > cachedPrograms
 
QList< QDeclarativeIntegerCache * > contextCaches
 
QList< CustomTypeDatacustomTypeData
 
QList< QByteArraydatas
 
QList< float > floatData
 
QDeclarativeTypeNameCacheimportCache
 
QList< int > intData
 
QList< QDeclarativeParser::Locationlocations
 
QString name
 
QList< QStringprimitives
 
QList< QDeclarativePropertyCache * > propertyCaches
 
const QMetaObjectroot
 
QAbstractDynamicMetaObject rootData
 
QDeclarativePropertyCacherootPropertyCache
 
QList< QDeclarativeParser::Object::ScriptBlockscripts
 
QList< TypeReferencetypes
 
QUrl url
 
QList< QUrlurls
 

Protected Functions

virtual void clear ()
 

Private Functions

void dump (QDeclarativeInstruction *, int idx=-1)
 
int indexForByteArray (const QByteArray &)
 
int indexForFloat (float *, int)
 
int indexForInt (int *, int)
 
int indexForLocation (const QDeclarativeParser::Location &)
 
int indexForLocation (const QDeclarativeParser::LocationSpan &)
 
int indexForString (const QString &)
 
int indexForUrl (const QUrl &)
 
QDeclarativeCompiledDataoperator= (const QDeclarativeCompiledData &other)
 
int pack (const char *, size_t)
 
 QDeclarativeCompiledData (const QDeclarativeCompiledData &other)
 

Properties

QByteArray packData
 

Friends

class QDeclarativeCompiler
 

Detailed Description

Definition at line 79 of file qdeclarativecompiler_p.h.

Constructors and Destructors

◆ QDeclarativeCompiledData() [1/2]

QDeclarativeCompiledData::QDeclarativeCompiledData ( QDeclarativeEngine engine)

Definition at line 164 of file qdeclarativecompileddata.cpp.

166 {
167 }
QDeclarativePropertyCache * rootPropertyCache
QDeclarativeCleanup(QDeclarativeEngine *)
QDeclarativeTypeNameCache * importCache

◆ ~QDeclarativeCompiledData()

QDeclarativeCompiledData::~QDeclarativeCompiledData ( )
virtual

Definition at line 169 of file qdeclarativecompileddata.cpp.

170 {
171  for (int ii = 0; ii < types.count(); ++ii) {
172  if (types.at(ii).component)
173  types.at(ii).component->release();
174  if (types.at(ii).typePropertyCache)
175  types.at(ii).typePropertyCache->release();
176  }
177 
178  for (int ii = 0; ii < propertyCaches.count(); ++ii)
179  propertyCaches.at(ii)->release();
180 
181  for (int ii = 0; ii < contextCaches.count(); ++ii)
182  contextCaches.at(ii)->release();
183 
184  if (importCache)
185  importCache->release();
186 
187  if (rootPropertyCache)
189 
192 }
int count(const T &t) const
Returns the number of occurrences of value in the list.
Definition: qlist.h:891
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
QList< QScriptProgram * > cachedPrograms
QList< QDeclarativePropertyCache * > propertyCaches
QList< QScriptValue * > cachedClosures
QList< QDeclarativeIntegerCache * > contextCaches
QDeclarativePropertyCache * rootPropertyCache
QDeclarativeTypeNameCache * importCache
Q_OUTOFLINE_TEMPLATE void qDeleteAll(ForwardIterator begin, ForwardIterator end)
Definition: qalgorithms.h:319
QList< TypeReference > types

◆ QDeclarativeCompiledData() [2/2]

QDeclarativeCompiledData::QDeclarativeCompiledData ( const QDeclarativeCompiledData other)
private

Functions

◆ clear()

void QDeclarativeCompiledData::clear ( )
protectedvirtual

Implements QDeclarativeCleanup.

Definition at line 194 of file qdeclarativecompileddata.cpp.

195 {
198  for (int ii = 0; ii < cachedClosures.count(); ++ii)
199  cachedClosures[ii] = 0;
200  for (int ii = 0; ii < cachedPrograms.count(); ++ii)
201  cachedPrograms[ii] = 0;
202 }
int count(const T &t) const
Returns the number of occurrences of value in the list.
Definition: qlist.h:891
QList< QScriptProgram * > cachedPrograms
QList< QScriptValue * > cachedClosures
Q_OUTOFLINE_TEMPLATE void qDeleteAll(ForwardIterator begin, ForwardIterator end)
Definition: qalgorithms.h:319

◆ dump()

void QDeclarativeCompiledData::dump ( QDeclarativeInstruction instr,
int  idx = -1 
)
private

Definition at line 50 of file qdeclarativeinstruction.cpp.

Referenced by dumpInstructions().

51 {
52 #ifdef QT_NO_DEBUG_STREAM
53  Q_UNUSED(instr)
54  Q_UNUSED(idx)
55 #else
56  QByteArray lineNumber = QByteArray::number(instr->line);
57  if (instr->line == (unsigned short)-1)
58  lineNumber = "NA";
59  const char *line = lineNumber.constData();
60 
61  switch(instr->type) {
63  qWarning().nospace() << idx << "\t\t" << line << "\t" << "INIT\t\t\t" << instr->init.bindingsSize << "\t" << instr->init.parserStatusSize << "\t" << instr->init.contextCache << "\t" << instr->init.compiledBinding;
64  break;
66  qWarning().nospace() << idx << "\t\t" << line << "\t" << "CREATE\t\t\t" << instr->create.type << "\t" << instr->create.bindingBits << "\t\t" << types.at(instr->create.type).className;
67  break;
69  qWarning().nospace() << idx << "\t\t" << line << "\t" << "CREATE_SIMPLE\t\t" << instr->createSimple.typeSize;
70  break;
72  qWarning().nospace() << idx << "\t\t" << line << "\t" << "SETID\t\t\t" << instr->setId.value << "\t\t\t" << primitives.at(instr->setId.value);
73  break;
75  qWarning().nospace() << idx << "\t\t" << line << "\t" << "SET_DEFAULT";
76  break;
78  qWarning().nospace() << idx << "\t\t" << line << "\t" << "CREATE_COMPONENT\t" << instr->createComponent.count;
79  break;
81  qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_META\t\t" << instr->storeMeta.data;
82  break;
83 
85  qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_FLOAT\t\t" << instr->storeFloat.propertyIndex << "\t" << instr->storeFloat.value;
86  break;
88  qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_DOUBLE\t\t" << instr->storeDouble.propertyIndex << "\t" << instr->storeDouble.value;
89  break;
91  qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_INTEGER\t\t" << instr->storeInteger.propertyIndex << "\t" << instr->storeInteger.value;
92  break;
94  qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_BOOL\t\t" << instr->storeBool.propertyIndex << "\t" << instr->storeBool.value;
95  break;
97  qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_STRING\t\t" << instr->storeString.propertyIndex << "\t" << instr->storeString.value << "\t\t" << primitives.at(instr->storeString.value);
98  break;
100  qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_URL\t\t" << instr->storeUrl.propertyIndex << "\t" << instr->storeUrl.value << "\t\t" << urls.at(instr->storeUrl.value);
101  break;
103  qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_COLOR\t\t" << instr->storeColor.propertyIndex << "\t\t\t" << QString::number(instr->storeColor.value, 16);
104  break;
106  qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_DATE\t\t" << instr->storeDate.propertyIndex << "\t" << instr->storeDate.value;
107  break;
109  qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_TIME\t\t" << instr->storeTime.propertyIndex << "\t" << instr->storeTime.valueIndex;
110  break;
112  qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_DATETIME\t\t" << instr->storeDateTime.propertyIndex << "\t" << instr->storeDateTime.valueIndex;
113  break;
115  qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_POINT\t\t" << instr->storeRealPair.propertyIndex << "\t" << instr->storeRealPair.valueIndex;
116  break;
118  qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_POINTF\t\t" << instr->storeRealPair.propertyIndex << "\t" << instr->storeRealPair.valueIndex;
119  break;
121  qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_SIZE\t\t" << instr->storeRealPair.propertyIndex << "\t" << instr->storeRealPair.valueIndex;
122  break;
124  qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_SIZEF\t\t" << instr->storeRealPair.propertyIndex << "\t" << instr->storeRealPair.valueIndex;
125  break;
127  qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_RECT\t\t" << instr->storeRect.propertyIndex << "\t" << instr->storeRect.valueIndex;
128  break;
130  qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_RECTF\t\t" << instr->storeRect.propertyIndex << "\t" << instr->storeRect.valueIndex;
131  break;
133  qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_VECTOR3D\t\t" << instr->storeVector3D.propertyIndex << "\t" << instr->storeVector3D.valueIndex;
134  break;
136  qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_VARIANT\t\t" << instr->storeString.propertyIndex << "\t" << instr->storeString.value << "\t\t" << primitives.at(instr->storeString.value);
137  break;
139  qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_VARIANT_INTEGER\t\t" << instr->storeInteger.propertyIndex << "\t" << instr->storeInteger.value;
140  break;
142  qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_VARIANT_DOUBLE\t\t" << instr->storeDouble.propertyIndex << "\t" << instr->storeDouble.value;
143  break;
145  qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_VARIANT_BOOL\t\t" << instr->storeBool.propertyIndex << "\t" << instr->storeBool.value;
146  break;
148  qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_OBJECT\t\t" << instr->storeObject.propertyIndex;
149  break;
151  qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_VARIANT_OBJECT\t" << instr->storeObject.propertyIndex;
152  break;
154  qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_INTERFACE\t\t" << instr->storeObject.propertyIndex;
155  break;
156 
158  qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_SIGNAL\t\t" << instr->storeSignal.signalIndex << "\t" << instr->storeSignal.value << "\t\t" << primitives.at(instr->storeSignal.value);
159  break;
161  qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_IMPORTED_SCRIPT\t" << instr->storeScript.value;
162  break;
164  qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_SCRIPT_STRING\t" << instr->storeScriptString.propertyIndex << "\t" << instr->storeScriptString.value << "\t" << instr->storeScriptString.scope;
165  break;
166 
168  qWarning().nospace() << idx << "\t\t" << line << "\t" << "ASSIGN_SIGNAL_OBJECT\t" << instr->assignSignalObject.signal << "\t\t\t" << datas.at(instr->assignSignalObject.signal);
169  break;
171  qWarning().nospace() << idx << "\t\t" << line << "\t" << "ASSIGN_CUSTOMTYPE\t" << instr->assignCustomType.propertyIndex << "\t" << instr->assignCustomType.valueIndex;
172  break;
173 
175  qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_BINDING\t" << instr->assignBinding.property << "\t" << instr->assignBinding.value << "\t" << instr->assignBinding.context;
176  break;
178  qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_BINDING_ALIAS\t" << instr->assignBinding.property << "\t" << instr->assignBinding.value << "\t" << instr->assignBinding.context;
179  break;
181  qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_COMPILED_BINDING\t" << instr->assignBinding.property << "\t" << instr->assignBinding.value << "\t" << instr->assignBinding.context;
182  break;
184  qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_VALUE_SOURCE\t" << instr->assignValueSource.property << "\t" << instr->assignValueSource.castValue;
185  break;
187  qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_VALUE_INTERCEPTOR\t" << instr->assignValueInterceptor.property << "\t" << instr->assignValueInterceptor.castValue;
188  break;
189 
191  qWarning().nospace() << idx << "\t\t" << line << "\t" << "BEGIN\t\t\t" << instr->begin.castValue;
192  break;
194  qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_OBJECT_QLIST";
195  break;
197  qWarning().nospace() << idx << "\t\t" << line << "\t" << "ASSIGN_OBJECT_LIST";
198  break;
200  qWarning().nospace() << idx << "\t\t" << line << "\t" << "FETCH_ATTACHED\t\t" << instr->fetchAttached.id;
201  break;
203  qWarning().nospace() << idx << "\t\t" << line << "\t" << "FETCH_QLIST\t\t" << instr->fetch.property;
204  break;
206  qWarning().nospace() << idx << "\t\t" << line << "\t" << "FETCH\t\t\t" << instr->fetch.property;
207  break;
209  qWarning().nospace() << idx << "\t\t" << line << "\t" << "FETCH_VALUE\t\t" << instr->fetchValue.property << "\t" << instr->fetchValue.type << "\t" << instr->fetchValue.bindingSkipList;
210  break;
212  qWarning().nospace() << idx << "\t\t" << line << "\t" << "POP";
213  break;
215  qWarning().nospace() << idx << "\t\t" << line << "\t" << "POP_QLIST";
216  break;
218  qWarning().nospace() << idx << "\t\t" << line << "\t" << "POP_VALUE\t\t" << instr->fetchValue.property << "\t" << instr->fetchValue.type;
219  break;
221  qWarning().nospace() << idx << "\t\t" << line << "\t" << "DEFER" << "\t\t\t" << instr->defer.deferCount;
222  break;
223  default:
224  qWarning().nospace() << idx << "\t\t" << line << "\t" << "XXX UNKNOWN INSTRUCTION" << "\t" << instr->type;
225  break;
226  }
227 #endif // QT_NO_DEBUG_STREAM
228 }
static QString number(int, int base=10)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: qstring.cpp:6448
The QByteArray class provides an array of bytes.
Definition: qbytearray.h:135
FetchAttachedInstruction fetchAttached
AssignSignalObjectInstruction assignSignalObject
FetchValueInstruction fetchValue
StoreRealPairInstruction storeRealPair
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
StoreScriptInstruction storeScript
StoreColorInstruction storeColor
Q_CORE_EXPORT void qWarning(const char *,...)
StoreDateTimeInstruction storeDateTime
StoreFloatInstruction storeFloat
StoreObjectInstruction storeObject
CreateComponentInstruction createComponent
AssignBindingInstruction assignBinding
StoreDoubleInstruction storeDouble
StoreSignalInstruction storeSignal
CreateSimpleInstruction createSimple
StoreVector3DInstruction storeVector3D
AssignValueInterceptorInstruction assignValueInterceptor
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
Definition: qglobal.h:1729
StoreIntegerInstruction storeInteger
static QByteArray number(int, int base=10)
Returns a byte array containing the string equivalent of the number n to base base (10 by default)...
QList< TypeReference > types
AssignValueSourceInstruction assignValueSource
StoreStringInstruction storeString
AssignCustomTypeInstruction assignCustomType
StoreScriptStringInstruction storeScriptString

◆ dumpInstructions()

void QDeclarativeCompiledData::dumpInstructions ( )

Definition at line 242 of file qdeclarativecompileddata.cpp.

Referenced by QDeclarativeCompiler::compile().

243 {
244  if (!name.isEmpty())
245  qWarning() << name;
246  qWarning().nospace() << "Index\tLine\tOperation\t\tData1\tData2\tData3\tComments";
247  qWarning().nospace() << "-------------------------------------------------------------------------------";
248  for (int ii = 0; ii < bytecode.count(); ++ii) {
249  dump(&bytecode[ii], ii);
250  }
251  qWarning().nospace() << "-------------------------------------------------------------------------------";
252 }
int count(const T &t) const
Returns the number of occurrences of value in the list.
Definition: qlist.h:891
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
Definition: qstring.h:704
Q_CORE_EXPORT void qWarning(const char *,...)
void dump(QDeclarativeInstruction *, int idx=-1)
QList< QDeclarativeInstruction > bytecode

◆ indexForByteArray()

int QDeclarativeCompiledData::indexForByteArray ( const QByteArray data)
private

Definition at line 80 of file qdeclarativecompileddata.cpp.

Referenced by QDeclarativeCompiler::compileTree(), QDeclarativeCompiler::genBindingAssignment(), QDeclarativeCompiler::genComponent(), QDeclarativeCompiler::genObject(), QDeclarativeCompiler::genObjectBody(), QDeclarativeCompiler::genPropertyData(), QDeclarativeCompiler::genValueTypeData(), and QDeclarativeCompiler::rewriteBinding().

81 {
82  int idx = datas.indexOf(data);
83  if (idx == -1) {
84  idx = datas.count();
85  datas << data;
86  }
87  return idx;
88 }
int count(const T &t) const
Returns the number of occurrences of value in the list.
Definition: qlist.h:891
static const char * data(const QByteArray &arr)
int indexOf(const T &t, int from=0) const
Returns the index position of the first occurrence of value in the list, searching forward from index...
Definition: qlist.h:847

◆ indexForFloat()

int QDeclarativeCompiledData::indexForFloat ( float *  data,
int  count 
)
private

Definition at line 100 of file qdeclarativecompileddata.cpp.

Referenced by QDeclarativeCompiler::genLiteralAssignment().

101 {
102  Q_ASSERT(count > 0);
103 
104  for (int ii = 0; ii <= floatData.count() - count; ++ii) {
105  bool found = true;
106  for (int jj = 0; jj < count; ++jj) {
107  if (floatData.at(ii + jj) != data[jj]) {
108  found = false;
109  break;
110  }
111  }
112 
113  if (found)
114  return ii;
115  }
116 
117  int idx = floatData.count();
118  for (int ii = 0; ii < count; ++ii)
119  floatData << data[ii];
120 
121  return idx;
122 }
int count(const T &t) const
Returns the number of occurrences of value in the list.
Definition: qlist.h:891
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
static const char * data(const QByteArray &arr)

◆ indexForInt()

int QDeclarativeCompiledData::indexForInt ( int *  data,
int  count 
)
private

Definition at line 124 of file qdeclarativecompileddata.cpp.

Referenced by QDeclarativeCompiler::genLiteralAssignment().

125 {
126  Q_ASSERT(count > 0);
127 
128  for (int ii = 0; ii <= intData.count() - count; ++ii) {
129  bool found = true;
130  for (int jj = 0; jj < count; ++jj) {
131  if (intData.at(ii + jj) != data[jj]) {
132  found = false;
133  break;
134  }
135  }
136 
137  if (found)
138  return ii;
139  }
140 
141  int idx = intData.count();
142  for (int ii = 0; ii < count; ++ii)
143  intData << data[ii];
144 
145  return idx;
146 }
int count(const T &t) const
Returns the number of occurrences of value in the list.
Definition: qlist.h:891
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
static const char * data(const QByteArray &arr)

◆ indexForLocation() [1/2]

int QDeclarativeCompiledData::indexForLocation ( const QDeclarativeParser::Location l)
private

Definition at line 148 of file qdeclarativecompileddata.cpp.

149 {
150  // ### FIXME
151  int rv = locations.count();
152  locations << l;
153  return rv;
154 }
QList< QDeclarativeParser::Location > locations
int count(const T &t) const
Returns the number of occurrences of value in the list.
Definition: qlist.h:891
QFactoryLoader * l

◆ indexForLocation() [2/2]

int QDeclarativeCompiledData::indexForLocation ( const QDeclarativeParser::LocationSpan l)
private

Definition at line 156 of file qdeclarativecompileddata.cpp.

157 {
158  // ### FIXME
159  int rv = locations.count();
160  locations << l.start << l.end;
161  return rv;
162 }
QList< QDeclarativeParser::Location > locations
int count(const T &t) const
Returns the number of occurrences of value in the list.
Definition: qlist.h:891

◆ indexForString()

int QDeclarativeCompiledData::indexForString ( const QString data)
private

Definition at line 70 of file qdeclarativecompileddata.cpp.

Referenced by QDeclarativeCompiler::genComponent(), QDeclarativeCompiler::genLiteralAssignment(), QDeclarativeCompiler::genObject(), and QDeclarativeCompiler::genObjectBody().

71 {
72  int idx = primitives.indexOf(data);
73  if (idx == -1) {
74  idx = primitives.count();
75  primitives << data;
76  }
77  return idx;
78 }
int count(const T &t) const
Returns the number of occurrences of value in the list.
Definition: qlist.h:891
static const char * data(const QByteArray &arr)
int indexOf(const T &t, int from=0) const
Returns the index position of the first occurrence of value in the list, searching forward from index...
Definition: qlist.h:847

◆ indexForUrl()

int QDeclarativeCompiledData::indexForUrl ( const QUrl data)
private

Definition at line 90 of file qdeclarativecompileddata.cpp.

Referenced by QDeclarativeCompiler::genLiteralAssignment().

91 {
92  int idx = urls.indexOf(data);
93  if (idx == -1) {
94  idx = urls.count();
95  urls << data;
96  }
97  return idx;
98 }
int count(const T &t) const
Returns the number of occurrences of value in the list.
Definition: qlist.h:891
static const char * data(const QByteArray &arr)
int indexOf(const T &t, int from=0) const
Returns the index position of the first occurrence of value in the list, searching forward from index...
Definition: qlist.h:847

◆ operator=()

QDeclarativeCompiledData& QDeclarativeCompiledData::operator= ( const QDeclarativeCompiledData other)
private

◆ pack()

int QDeclarativeCompiledData::pack ( const char *  data,
size_t  size 
)
private

Definition at line 55 of file qdeclarativecompileddata.cpp.

56 {
57  const char *p = packData.constData();
58  unsigned int ps = packData.size();
59 
60  for (unsigned int ii = 0; (ii + size) <= ps; ii += sizeof(int)) {
61  if (0 == ::memcmp(p + ii, data, size))
62  return ii;
63  }
64 
65  int rv = packData.size();
66  packData.append(data, size);
67  return rv;
68 }
QByteArray & append(char c)
Appends the character ch to this byte array.
static const char * data(const QByteArray &arr)
const char * constData() const
Returns a pointer to the data stored in the byte array.
Definition: qbytearray.h:433
int size() const
Returns the number of bytes in this byte array.
Definition: qbytearray.h:402

Friends and Related Functions

◆ QDeclarativeCompiler

friend class QDeclarativeCompiler
friend

Definition at line 138 of file qdeclarativecompiler_p.h.

Properties

◆ bytecode

QList<QDeclarativeInstruction> QDeclarativeCompiledData::bytecode

◆ cachedClosures

QList<QScriptValue *> QDeclarativeCompiledData::cachedClosures

◆ cachedPrograms

QList<QScriptProgram *> QDeclarativeCompiledData::cachedPrograms

◆ contextCaches

QList<QDeclarativeIntegerCache *> QDeclarativeCompiledData::contextCaches

◆ customTypeData

QList<CustomTypeData> QDeclarativeCompiledData::customTypeData

◆ datas

QList<QByteArray> QDeclarativeCompiledData::datas

◆ floatData

QList<float> QDeclarativeCompiledData::floatData

◆ importCache

QDeclarativeTypeNameCache* QDeclarativeCompiledData::importCache

◆ intData

QList<int> QDeclarativeCompiledData::intData

◆ locations

QList<QDeclarativeParser::Location> QDeclarativeCompiledData::locations

Definition at line 119 of file qdeclarativecompiler_p.h.

Referenced by indexForLocation().

◆ name

QString QDeclarativeCompiledData::name

Definition at line 85 of file qdeclarativecompiler_p.h.

Referenced by QDeclarativeTypeData::compile(), and dumpInstructions().

◆ packData

QByteArray QDeclarativeCompiledData::packData
private

Definition at line 137 of file qdeclarativecompiler_p.h.

Referenced by pack().

◆ primitives

QList<QString> QDeclarativeCompiledData::primitives

◆ propertyCaches

QList<QDeclarativePropertyCache *> QDeclarativeCompiledData::propertyCaches

◆ root

const QMetaObject* QDeclarativeCompiledData::root

◆ rootData

QAbstractDynamicMetaObject QDeclarativeCompiledData::rootData

Definition at line 112 of file qdeclarativecompiler_p.h.

Referenced by QDeclarativeCompiler::compileTree().

◆ rootPropertyCache

QDeclarativePropertyCache* QDeclarativeCompiledData::rootPropertyCache

◆ scripts

QList<QDeclarativeParser::Object::ScriptBlock> QDeclarativeCompiledData::scripts

◆ types

QList<TypeReference> QDeclarativeCompiledData::types

◆ url

QUrl QDeclarativeCompiledData::url

◆ urls

QList<QUrl> QDeclarativeCompiledData::urls

Definition at line 126 of file qdeclarativecompiler_p.h.

Referenced by dump(), indexForUrl(), and QDeclarativeVME::run().


The documentation for this class was generated from the following files: