diff generator/containergenerator.cpp @ 35:5917a613d118

wrapping of QtXml
author eldar
date Sat, 16 May 2009 20:47:44 +0000
parents e78566595089
children 136c9ee83ee5
line wrap: on
line diff
--- a/generator/containergenerator.cpp	Sat May 16 18:06:25 2009 +0000
+++ b/generator/containergenerator.cpp	Sat May 16 20:47:44 2009 +0000
@@ -232,7 +232,11 @@
 
 void ContainerGenerator::writeHeaderContent(QTextStream &s, AbstractMetaClass *cls)
 {
-    s << "#include <cstring>" << endl
+    QString file_upper = "ArrayOps_" + QString(cls->package()).replace(".", "_") + "_h";
+    file_upper = file_upper.toUpper();
+    s << "#ifndef " << file_upper << endl
+      << "#define " << file_upper << endl << endl
+      << "#include <cstring>" << endl
       << "#include \"qtd_core.h\"" << endl << endl;
 
     foreach (const TypeEntry *te, containerTypes) {
@@ -244,6 +248,8 @@
             writeHeaderArrayFunctions(s, typeEntry);
         }
     }
+
+    s << "#endif // " << file_upper << endl;
 }
 
 void ContainerGenerator::setFuncNames(const QString& cls_name)