diff options
Diffstat (limited to 'kode/kwsdl/typemapper.cpp')
-rw-r--r-- | kode/kwsdl/typemapper.cpp | 128 |
1 files changed, 64 insertions, 64 deletions
diff --git a/kode/kwsdl/typemapper.cpp b/kode/kwsdl/typemapper.cpp index b8d1a80b..88842ece 100644 --- a/kode/kwsdl/typemapper.cpp +++ b/kode/kwsdl/typemapper.cpp @@ -19,7 +19,7 @@ Boston, MA 02110-1301, USA. */ -#include <qmap.h> +#include <tqmap.h> #include <schema/attribute.h> #include <schema/complextype.h> @@ -33,21 +33,21 @@ using namespace KWSDL; TypeMapper::TypeMapper() { - mMap.insert( "any", TypeInfo( "any", "QString", "qstring.h" ) ); - mMap.insert( "anyURI", TypeInfo( "anyUri", "QString", "qstring.h" ) ); - mMap.insert( "base64Binary", TypeInfo( "base64Binary", "QByteArray", "qcstring.h" ) ); - mMap.insert( "binary", TypeInfo( "binary", "QByteArray", "qcstring.h" ) ); + mMap.insert( "any", TypeInfo( "any", "TQString", "tqstring.h" ) ); + mMap.insert( "anyURI", TypeInfo( "anyUri", "TQString", "tqstring.h" ) ); + mMap.insert( "base64Binary", TypeInfo( "base64Binary", "TQByteArray", "tqcstring.h" ) ); + mMap.insert( "binary", TypeInfo( "binary", "TQByteArray", "tqcstring.h" ) ); mMap.insert( "boolean", TypeInfo( "boolean", "bool", "" ) ); mMap.insert( "byte", TypeInfo( "byte", "char", "" ) ); - mMap.insert( "date", TypeInfo( "date", "QDate", "qdatetime.h" ) ); - mMap.insert( "dateTime", TypeInfo( "dateTime", "QDateTime", "qdatetime.h" ) ); + mMap.insert( "date", TypeInfo( "date", "TQDate", "tqdatetime.h" ) ); + mMap.insert( "dateTime", TypeInfo( "dateTime", "TQDateTime", "tqdatetime.h" ) ); mMap.insert( "decimal", TypeInfo( "decimal", "float", "" ) ); mMap.insert( "double", TypeInfo( "double", "double", "" ) ); - mMap.insert( "duration", TypeInfo( "duration", "QString", "qstring.h" ) ); // TODO: add duration class + mMap.insert( "duration", TypeInfo( "duration", "TQString", "tqstring.h" ) ); // TODO: add duration class mMap.insert( "int", TypeInfo( "int", "int", "" ) ); - mMap.insert( "language", TypeInfo( "language", "QString", "qstring.h" ) ); + mMap.insert( "language", TypeInfo( "language", "TQString", "tqstring.h" ) ); mMap.insert( "short", TypeInfo( "short", "short", "" ) ); - mMap.insert( "string", TypeInfo( "string", "QString", "qstring.h" ) ); + mMap.insert( "string", TypeInfo( "string", "TQString", "tqstring.h" ) ); mMap.insert( "unsignedByte", TypeInfo( "unsignedByte", "unsigned char", "" ) ); mMap.insert( "unsignedInt", TypeInfo( "unsignedInt", "unsigned int", "" ) ); } @@ -57,21 +57,21 @@ void TypeMapper::setTypes( const Schema::Types &types ) mTypes = types; } -QString TypeMapper::type( const Schema::XSDType *type ) const +TQString TypeMapper::type( const Schema::XSDType *type ) const { - QString typeName = type->name(); + TQString typeName = type->name(); typeName[ 0 ] = typeName[ 0 ].upper(); return typeName; } -QString TypeMapper::type( const Schema::Element *element ) const +TQString TypeMapper::type( const Schema::Element *element ) const { - QString typeName = element->typeName(); + TQString typeName = element->typeName(); - QString type; + TQString type; // check basic types - QMap<QString, TypeInfo>::ConstIterator it = mMap.find( typeName ); + TQMap<TQString, TypeInfo>::ConstIterator it = mMap.find( typeName ); if ( it != mMap.end() ) type = it.data().type; @@ -83,13 +83,13 @@ QString TypeMapper::type( const Schema::Element *element ) const return type; } -QString TypeMapper::type( const Schema::Attribute *attribute ) const +TQString TypeMapper::type( const Schema::Attribute *attribute ) const { - QString typeName = attribute->typeName(); + TQString typeName = attribute->typeName(); - QString type; + TQString type; // check basic types - QMap<QString, TypeInfo>::ConstIterator it = mMap.find( typeName ); + TQMap<TQString, TypeInfo>::ConstIterator it = mMap.find( typeName ); if ( it != mMap.end() ) type = it.data().type; @@ -101,10 +101,10 @@ QString TypeMapper::type( const Schema::Attribute *attribute ) const return type; } -QString TypeMapper::type( const QString &typeName ) const +TQString TypeMapper::type( const TQString &typeName ) const { // check basic types - QMap<QString, TypeInfo>::ConstIterator it = mMap.find( typeName ); + TQMap<TQString, TypeInfo>::ConstIterator it = mMap.find( typeName ); if ( it != mMap.end() ) return it.data().type; @@ -132,22 +132,22 @@ QString TypeMapper::type( const QString &typeName ) const } } - return QString(); + return TQString(); } -QStringList TypeMapper::header( const Schema::XSDType *type ) const +TQStringList TypeMapper::header( const Schema::XSDType *type ) const { return type->name().lower() + ".h"; } -QStringList TypeMapper::header( const Schema::Element *element ) const +TQStringList TypeMapper::header( const Schema::Element *element ) const { - QString typeName = element->typeName(); + TQString typeName = element->typeName(); - QStringList headers; + TQStringList headers; // check basic types - QMap<QString, TypeInfo>::ConstIterator it = mMap.find( typeName ); + TQMap<TQString, TypeInfo>::ConstIterator it = mMap.find( typeName ); if ( it != mMap.end() ) { if ( !it.data().header.isEmpty() ) headers.append( it.data().header ); @@ -155,23 +155,23 @@ QStringList TypeMapper::header( const Schema::Element *element ) const headers.append( typeName.lower() + ".h" ); if ( element->maxOccurs() > 1 ) - headers.append( "qptrlist.h" ); + headers.append( "tqptrlist.h" ); return headers; } -QMap<QString, QString> TypeMapper::headerDec( const Schema::Element *element ) const +TQMap<TQString, TQString> TypeMapper::headerDec( const Schema::Element *element ) const { - QString typeName = element->typeName(); + TQString typeName = element->typeName(); - QMap<QString, QString> headers; + TQMap<TQString, TQString> headers; // check basic types - QMap<QString, TypeInfo>::ConstIterator it = mMap.find( typeName ); + TQMap<TQString, TypeInfo>::ConstIterator it = mMap.find( typeName ); if ( it != mMap.end() ) { if ( !it.data().header.isEmpty() ) { - if ( it.data().type == "QByteArray" ) - headers.insert( it.data().header, QString() ); + if ( it.data().type == "TQByteArray" ) + headers.insert( it.data().header, TQString() ); else headers.insert( it.data().header, it.data().type ); } @@ -181,19 +181,19 @@ QMap<QString, QString> TypeMapper::headerDec( const Schema::Element *element ) c } if ( element->maxOccurs() > 1 ) - headers.insert( "qptrlist.h", QString() ); + headers.insert( "tqptrlist.h", TQString() ); return headers; } -QStringList TypeMapper::header( const Schema::Attribute *attribute ) const +TQStringList TypeMapper::header( const Schema::Attribute *attribute ) const { - QString typeName = attribute->typeName(); + TQString typeName = attribute->typeName(); - QStringList headers; + TQStringList headers; // check basic types - QMap<QString, TypeInfo>::ConstIterator it = mMap.find( typeName ); + TQMap<TQString, TypeInfo>::ConstIterator it = mMap.find( typeName ); if ( it != mMap.end() ) { if ( !it.data().header.isEmpty() ) headers.append( it.data().header ); @@ -203,18 +203,18 @@ QStringList TypeMapper::header( const Schema::Attribute *attribute ) const return headers; } -QMap<QString, QString> TypeMapper::headerDec( const Schema::Attribute *attribute ) const +TQMap<TQString, TQString> TypeMapper::headerDec( const Schema::Attribute *attribute ) const { - QString typeName = attribute->typeName(); + TQString typeName = attribute->typeName(); - QMap<QString, QString> headers; + TQMap<TQString, TQString> headers; // check basic types - QMap<QString, TypeInfo>::ConstIterator it = mMap.find( typeName ); + TQMap<TQString, TypeInfo>::ConstIterator it = mMap.find( typeName ); if ( it != mMap.end() ) { if ( !it.data().header.isEmpty() ) { - if ( it.data().type == "QByteArray" ) - headers.insert( it.data().header, QString() ); + if ( it.data().type == "TQByteArray" ) + headers.insert( it.data().header, TQString() ); else headers.insert( it.data().header, it.data().type ); } @@ -226,13 +226,13 @@ QMap<QString, QString> TypeMapper::headerDec( const Schema::Attribute *attribute return headers; } -QStringList TypeMapper::header( const QString &typeName ) const +TQStringList TypeMapper::header( const TQString &typeName ) const { - QMap<QString, TypeInfo>::ConstIterator it = mMap.find( typeName ); + TQMap<TQString, TypeInfo>::ConstIterator it = mMap.find( typeName ); if ( it != mMap.end() ) return it.data().header; - const QString convertedType = type( typeName ); + const TQString convertedType = type( typeName ); if ( isBaseType( convertedType ) ) { for ( it = mMap.begin(); it != mMap.end(); ++it ) if ( it.data().type == convertedType ) @@ -240,20 +240,20 @@ QStringList TypeMapper::header( const QString &typeName ) const } else return typeName.lower() + ".h"; - return QStringList(); + return TQStringList(); } -QMap<QString, QString> TypeMapper::headerDec( const QString &typeName ) const +TQMap<TQString, TQString> TypeMapper::headerDec( const TQString &typeName ) const { - QString type( typeName ); - QMap<QString, QString> headers; + TQString type( typeName ); + TQMap<TQString, TQString> headers; // check basic types - QMap<QString, TypeInfo>::ConstIterator it = mMap.find( typeName ); + TQMap<TQString, TypeInfo>::ConstIterator it = mMap.find( typeName ); if ( it != mMap.end() ) { if ( !it.data().header.isEmpty() ) { - if ( it.data().type == "QByteArray" ) - headers.insert( it.data().header, QString() ); + if ( it.data().type == "TQByteArray" ) + headers.insert( it.data().header, TQString() ); else headers.insert( it.data().header, it.data().type ); } @@ -265,33 +265,33 @@ QMap<QString, QString> TypeMapper::headerDec( const QString &typeName ) const return headers; } -QString TypeMapper::argument( const QString &name, const Schema::Element *element ) const +TQString TypeMapper::argument( const TQString &name, const Schema::Element *element ) const { - QString typeName = type( element ); + TQString typeName = type( element ); if ( element->maxOccurs() > 1 ) - return "QPtrList<" + typeName + ">* " + name; + return "TQPtrList<" + typeName + ">* " + name; else return typeName + "* " + name; } -QString TypeMapper::argument( const QString &name, const Schema::Attribute *attribute ) const +TQString TypeMapper::argument( const TQString &name, const Schema::Attribute *attribute ) const { return type( attribute ) + "* " + name; } -QString TypeMapper::argument( const QString &name, const QString &typeName, bool isList ) const +TQString TypeMapper::argument( const TQString &name, const TQString &typeName, bool isList ) const { if ( isList ) { - return "QPtrList<" + type( typeName ) + ">* " + name; + return "TQPtrList<" + type( typeName ) + ">* " + name; } else { return type( typeName ) + "* " + name; } } -bool TypeMapper::isBaseType( const QString &type ) const +bool TypeMapper::isBaseType( const TQString &type ) const { - QMap<QString, TypeInfo>::ConstIterator it; + TQMap<TQString, TypeInfo>::ConstIterator it; for ( it = mMap.begin(); it != mMap.end(); ++it ) if ( it.data().type == type ) return true; |