comparison generator/containergenerator.cpp @ 35:5917a613d118

wrapping of QtXml
author eldar
date Sat, 16 May 2009 20:47:44 +0000
parents e78566595089
children 136c9ee83ee5
comparison
equal deleted inserted replaced
34:17cc45b32686 35:5917a613d118
230 << "#endif" << endl; 230 << "#endif" << endl;
231 } 231 }
232 232
233 void ContainerGenerator::writeHeaderContent(QTextStream &s, AbstractMetaClass *cls) 233 void ContainerGenerator::writeHeaderContent(QTextStream &s, AbstractMetaClass *cls)
234 { 234 {
235 s << "#include <cstring>" << endl 235 QString file_upper = "ArrayOps_" + QString(cls->package()).replace(".", "_") + "_h";
236 file_upper = file_upper.toUpper();
237 s << "#ifndef " << file_upper << endl
238 << "#define " << file_upper << endl << endl
239 << "#include <cstring>" << endl
236 << "#include \"qtd_core.h\"" << endl << endl; 240 << "#include \"qtd_core.h\"" << endl << endl;
237 241
238 foreach (const TypeEntry *te, containerTypes) { 242 foreach (const TypeEntry *te, containerTypes) {
239 if (te->javaPackage() == cls->package()) { 243 if (te->javaPackage() == cls->package()) {
240 const ComplexTypeEntry *typeEntry = static_cast<const ComplexTypeEntry *>(te); 244 const ComplexTypeEntry *typeEntry = static_cast<const ComplexTypeEntry *>(te);
242 246
243 Indentation indent(INDENT); 247 Indentation indent(INDENT);
244 writeHeaderArrayFunctions(s, typeEntry); 248 writeHeaderArrayFunctions(s, typeEntry);
245 } 249 }
246 } 250 }
251
252 s << "#endif // " << file_upper << endl;
247 } 253 }
248 254
249 void ContainerGenerator::setFuncNames(const QString& cls_name) 255 void ContainerGenerator::setFuncNames(const QString& cls_name)
250 { 256 {
251 all_name = QString("qtd_allocate_%1_array").arg(cls_name); 257 all_name = QString("qtd_allocate_%1_array").arg(cls_name);