--- /dev/null
+#include "nullable.h"
\ No newline at end of file
--- /dev/null
+#include "exception.h"
\ No newline at end of file
--- /dev/null
+#include "helper.h"
\ No newline at end of file
--- /dev/null
+#include "interface.h"
\ No newline at end of file
--- /dev/null
+#include "object.h"
\ No newline at end of file
--- /dev/null
+#include "transaction.h"
\ No newline at end of file
#include "nullable.h"
#include "exception.h"
-#include "WHelper.h"
+#include "WHelper"
class QDomElement;
class QDomDocument;
#include <QString>
#include "nullable.h"
-#include "WHelper.h"
+#include "WHelper"
/**base class of all transactions*/
class WTransaction:public WHelper
//
//
-#include "WHelper.h"
+#include "WHelper"
#include <QDomElement>
#include <QDomNode>
//
//
-#include "WInterface.h"
+#include "WInterface"
#include <QHttp>
#include <QMutex>
//
//
-#include "WObject.h"
+#include "WObject"
//
//
-#include "WTransaction.h"
-#include "WInterface.h"
+#include "WTransaction"
+#include "WInterface"
#include <QCoreApplication>
#include <QDebug>
HEADERS += \
- nullable.h \
- WHelper.h \
- WObject.h \
- WTransaction.h \
- WInterface.h
+ include/nullable.h \
+ include/helper.h \
+ include/object.h \
+ include/transaction.h \
+ include/interface.h
SOURCES += \
- WObject.cpp \
- WHelper.cpp \
- WTransaction.cpp \
- WInterface.cpp
+ src/object.cpp \
+ src/helper.cpp \
+ src/transaction.cpp \
+ src/interface.cpp
+INCLUDEPATH += include src
+DEPENDPATH += include src
\ No newline at end of file
/**compares the old (if it exists) and new version of the file and overwrites the old one if there are differences*/
virtual void close();
/**opens the file, WriteOnly is assumed as mode*/
- virtual bool open(QIODevice::OpenMode m);
+ virtual bool open(QIODevice::OpenMode m=QIODevice::WriteOnly);
/**returns the name of the file (without ",new")*/
QString fileName()const{return name;}
QString cna=cn;
if(cls.isAbstract(m_lang))cna+="Abstract";
addFile(cna);
- MFile hdr(m_basedir+"/"+m_subdir+"/"+cna+".h");
- MFile src(m_basedir+"/"+m_subdir+"/"+cna+".cpp");
+ MFile hdr(m_basedir+"/"+m_subdir+"/src"+cna+".h");
+ MFile src(m_basedir+"/"+m_subdir+"/src"+cna+".cpp");
if(!hdr.open(QIODevice::WriteOnly|QIODevice::Truncate) ||
!src.open(QIODevice::WriteOnly|QIODevice::Truncate)){
qDebug("Error: cannot create class files for class %s.",cn.toAscii().data());
QString hcd;
QString scd;
//includes
- hcd="#include \""+cls.clientBaseClass()+".h\"\n#include <QCoreApplication>\n\n";
+ hcd="#include \""+cls.clientBaseClass()+"\"\n#include <QCoreApplication>\n\n";
QStringList k=cls.propertyNames();
for(int i=0;i<k.size();i++)
if(cls.propertyIsObject(k[i]))
- hcd+="#include \""+m_prefix+"O"+cls.propertyPlainType(k[i])+".h\"\n";
+ hcd+="#include \""+m_prefix+"O"+cls.propertyPlainType(k[i])+"\"\n";
//class declaration
hcd+="class "+cna+":public "+cls.clientBaseClass()+"\n{\n";
static const QByteArray SRCSTART=
"//AUTOMATICALLY GENERATED FILE\n"
"//DO NOT EDIT THIS FILE DIRECTLY, USE THE XML SOURCE!\n"
- "#include \"%.h\"\n"
+ "#include \"%\"\n"
"#include <QDomElement>\n"
"#include <QDomDocument>\n";
//end section of all source files
{
QString cn=m_prefix+"T"+trn.name();
addFile(cn);
- MFile hdr(m_basedir+"/"+m_subdir+"/"+cn+".h");
- MFile src(m_basedir+"/"+m_subdir+"/"+cn+".cpp");
+ MFile hdr(m_basedir+"/"+m_subdir+"/src"+cn+".h");
+ MFile src(m_basedir+"/"+m_subdir+"/src"+cn+".cpp");
if(!hdr.open(QIODevice::WriteOnly|QIODevice::Truncate) ||
!src.open(QIODevice::WriteOnly|QIODevice::Truncate)){
qDebug("Error: cannot create class files for transaction %s.",cn.toAscii().data());
src.write(QByteArray(SRCSTART).replace("%",cn.toAscii()));
QString hcd;
QString scd;
- hcd="#include \""+m_transbase+".h\"\n";
- scd+="#include \"WInterface.h\"\n#include <QCoreApplication>\n";
+ hcd="#include \""+m_transbase+"\"\n";
+ scd+="#include \"WInterface\"\n#include <QCoreApplication>\n";
for(int i=0;i<in.size();i++){
QString tp=qtobjtype(trn,in[i],WocQtOut::In);
- if(tp!="")hcd+="#include <"+tp+".h>\n";
+ if(tp!="")hcd+="#include <"+tp+">\n";
}
for(int i=0;i<out.size();i++){
QString tp=qtobjtype(trn,out[i],WocQtOut::Out);
- if(tp!="")hcd+="#include <"+tp+".h>\n";
+ if(tp!="")hcd+="#include <"+tp+">\n";
}
hcd+="\nclass "+cn+":public "+m_transbase+"\n{\n";
hdr.write(hcd.toAscii());
//create interface class
WocProcessor*woc=WocProcessor::instance();
QString pn=woc->projectName();
- m_ifacecpp.setFileName(m_basedir+"/"+m_subdir+"/"+m_prefix+"Interface.cpp");
+ m_ifacecpp.setFileName(m_basedir+"/"+m_subdir+"/src"+m_prefix+"Interface.cpp");
if(!m_ifacecpp.open(QIODevice::WriteOnly|QIODevice::Truncate)){
qDebug("Error: cannot create Qt interface file %s.",m_ifacecpp.fileName().toAscii().data());
emit errorFound();
return;
}
m_ifacecpp.write(QByteArray(SRCSTART).replace('%',m_prefix+"Interface"));
- m_iface.setFileName(m_basedir+"/"+m_subdir+"/"+m_prefix+"Interface.h");
+ m_iface.setFileName(m_basedir+"/"+m_subdir+"/src"+m_prefix+"Interface.h");
if(!m_iface.open(QIODevice::WriteOnly|QIODevice::Truncate)){
qDebug("Error: cannot create Qt interface file %s.",m_iface.fileName().toAscii().data());
emit errorFound();
return;
}
m_iface.write(QByteArray(HDRSTART).replace("%",m_prefix.toAscii()+"INTERFACE_H"));
- m_iface.write(QByteArray("#include \""+m_prefix.toAscii()+"Include.h\"\n#include \"WInterface.h\"\n"));
+ m_iface.write(QByteArray("#include \""+m_prefix.toAscii()+"IncludeAll\"\n#include \"WInterface\"\n"));
m_iface.write(QByteArray("#include <QStringList>\n"));
m_iface.write(QString("class "+m_prefix+"Interface:public WInterface\n{\n Q_OBJECT\n").toAscii());
m_iface.write(QString(" public:\n "+m_prefix+"Interface(QString name=\""+pn+"\"):WInterface(name){}\n").toAscii());
m_iface.write(QString(" static QString svnRepositoryUrl(){return \""+woc->svnRepositoryUrl()+"\";}\n\n").toAscii());
//create all includer
- m_hdr.setFileName(m_basedir+"/"+m_subdir+"/"+m_prefix+"Include.h");
+ m_hdr.setFileName(m_basedir+"/"+m_subdir+"/"+m_prefix+"IncludeAll");
if(!m_hdr.open(QIODevice::WriteOnly|QIODevice::Truncate)){
qDebug("Error: cannot create Qt header file %s.",m_hdr.fileName().toAscii().data());
emit errorFound();
void WocQtOut::addFile(QString bn)
{
- QString code="HEADERS+="+m_subdir+"/"+bn+".h\nSOURCES+="+m_subdir+"/"+bn+".cpp\n";
+ QString code="HEADERS+="+m_subdir+"/src"+bn+".h\n";
+ code+="SOURCES+="+m_subdir+"/src"+bn+".cpp\n";
m_pri.write(code.toAscii());
- m_hdr.write(QByteArray("#include \"%.h\"\n").replace('%',bn.toAscii()));
+ m_hdr.write(QByteArray("#include \"%\"\n").replace('%',bn.toAscii()));
+ MFile wrap(m_basedir+"/"+m_subdir+"/"+bn);
+ wrap.open();
+ wrap.write(QString("#include \"src"+bn+".h\"\n").toAscii());
}
QString WocQtOut::qttype(const WocClass&cls,QString p,bool dolist)