diff options
Diffstat (limited to 'kode/kwsdl/tests/google/serializer.cpp')
-rw-r--r-- | kode/kwsdl/tests/google/serializer.cpp | 234 |
1 files changed, 117 insertions, 117 deletions
diff --git a/kode/kwsdl/tests/google/serializer.cpp b/kode/kwsdl/tests/google/serializer.cpp index 595666fab..273ce5929 100644 --- a/kode/kwsdl/tests/google/serializer.cpp +++ b/kode/kwsdl/tests/google/serializer.cpp @@ -31,297 +31,297 @@ #include <directorycategory.h> #include <resultelement.h> -QString Serializer::marshalValue( const QString* value ) +TQString Serializer::marshalValue( const TQString* value ) { return *value; } -void Serializer::demarshalValue( const QString &str, QString *value ) +void Serializer::demarshalValue( const TQString &str, TQString *value ) { *value = str; } -void Serializer::marshal( QDomDocument &doc, QDomElement &parent, const QString &name, const QString* value ) +void Serializer::marshal( TQDomDocument &doc, TQDomElement &parent, const TQString &name, const TQString* value ) { - QDomElement element = doc.createElement( name ); + TQDomElement element = doc.createElement( name ); element.setAttribute( "xsi:type", "xsd:string" ); element.appendChild( doc.createTextNode( Serializer::marshalValue( value ) ) ); parent.appendChild( element ); } -void Serializer::demarshal( const QDomElement &element, QString* value ) +void Serializer::demarshal( const TQDomElement &element, TQString* value ) { Serializer::demarshalValue( element.text(), value ); } -QString Serializer::marshalValue( const bool* value ) +TQString Serializer::marshalValue( const bool* value ) { return (*value ? "true" : "false"); } -void Serializer::demarshalValue( const QString &str, bool *value ) +void Serializer::demarshalValue( const TQString &str, bool *value ) { *value = (str.lower() == "true" ? true : false); } -void Serializer::marshal( QDomDocument &doc, QDomElement &parent, const QString &name, const bool* value ) +void Serializer::marshal( TQDomDocument &doc, TQDomElement &parent, const TQString &name, const bool* value ) { - QDomElement element = doc.createElement( name ); + TQDomElement element = doc.createElement( name ); element.setAttribute( "xsi:type", "xsd:boolean" ); element.appendChild( doc.createTextNode( Serializer::marshalValue( value ) ) ); parent.appendChild( element ); } -void Serializer::demarshal( const QDomElement &element, bool* value ) +void Serializer::demarshal( const TQDomElement &element, bool* value ) { Serializer::demarshalValue( element.text(), value ); } -QString Serializer::marshalValue( const float* value ) +TQString Serializer::marshalValue( const float* value ) { - return QString::number( *value ); + return TQString::number( *value ); } -void Serializer::demarshalValue( const QString &str, float *value ) +void Serializer::demarshalValue( const TQString &str, float *value ) { *value = str.toFloat(); } -void Serializer::marshal( QDomDocument &doc, QDomElement &parent, const QString &name, const float* value ) +void Serializer::marshal( TQDomDocument &doc, TQDomElement &parent, const TQString &name, const float* value ) { - QDomElement element = doc.createElement( name ); + TQDomElement element = doc.createElement( name ); element.setAttribute( "xsi:type", "xsd:TODO" ); element.appendChild( doc.createTextNode( Serializer::marshalValue( value ) ) ); parent.appendChild( element ); } -void Serializer::demarshal( const QDomElement &element, float* value ) +void Serializer::demarshal( const TQDomElement &element, float* value ) { Serializer::demarshalValue( element.text(), value ); } -QString Serializer::marshalValue( const int* value ) +TQString Serializer::marshalValue( const int* value ) { - return QString::number( *value ); + return TQString::number( *value ); } -void Serializer::demarshalValue( const QString &str, int *value ) +void Serializer::demarshalValue( const TQString &str, int *value ) { *value = str.toInt(); } -void Serializer::marshal( QDomDocument &doc, QDomElement &parent, const QString &name, const int* value ) +void Serializer::marshal( TQDomDocument &doc, TQDomElement &parent, const TQString &name, const int* value ) { - QDomElement element = doc.createElement( name ); + TQDomElement element = doc.createElement( name ); element.setAttribute( "xsi:type", "xsd:int" ); element.appendChild( doc.createTextNode( Serializer::marshalValue( value ) ) ); parent.appendChild( element ); } -void Serializer::demarshal( const QDomElement &element, int* value ) +void Serializer::demarshal( const TQDomElement &element, int* value ) { Serializer::demarshalValue( element.text(), value ); } -QString Serializer::marshalValue( const unsigned int* value ) +TQString Serializer::marshalValue( const unsigned int* value ) { - return QString::number( *value ); + return TQString::number( *value ); } -void Serializer::demarshalValue( const QString &str, unsigned int *value ) +void Serializer::demarshalValue( const TQString &str, unsigned int *value ) { *value = str.toUInt(); } -void Serializer::marshal( QDomDocument &doc, QDomElement &parent, const QString &name, const unsigned int* value ) +void Serializer::marshal( TQDomDocument &doc, TQDomElement &parent, const TQString &name, const unsigned int* value ) { - QDomElement element = doc.createElement( name ); + TQDomElement element = doc.createElement( name ); element.setAttribute( "xsi:type", "xsd:unsignedByte" ); element.appendChild( doc.createTextNode( Serializer::marshalValue( value ) ) ); parent.appendChild( element ); } -void Serializer::demarshal( const QDomElement &element, unsigned int* value ) +void Serializer::demarshal( const TQDomElement &element, unsigned int* value ) { Serializer::demarshalValue( element.text(), value ); } -QString Serializer::marshalValue( const double* value ) +TQString Serializer::marshalValue( const double* value ) { - return QString::number( *value ); + return TQString::number( *value ); } -void Serializer::demarshalValue( const QString &str, double *value ) +void Serializer::demarshalValue( const TQString &str, double *value ) { *value = str.toDouble(); } -void Serializer::marshal( QDomDocument &doc, QDomElement &parent, const QString &name, const double* value ) +void Serializer::marshal( TQDomDocument &doc, TQDomElement &parent, const TQString &name, const double* value ) { - QDomElement element = doc.createElement( name ); + TQDomElement element = doc.createElement( name ); element.setAttribute( "xsi:type", "xsd:double" ); element.appendChild( doc.createTextNode( Serializer::marshalValue( value ) ) ); parent.appendChild( element ); } -void Serializer::demarshal( const QDomElement &element, double* value ) +void Serializer::demarshal( const TQDomElement &element, double* value ) { Serializer::demarshalValue( element.text(), value ); } -QString Serializer::marshalValue( const char* value ) +TQString Serializer::marshalValue( const char* value ) { - return QString( QChar( *value ) ); + return TQString( TQChar( *value ) ); } -void Serializer::demarshalValue( const QString &str, char *value ) +void Serializer::demarshalValue( const TQString &str, char *value ) { *value = str[ 0 ].latin1(); } -void Serializer::marshal( QDomDocument &doc, QDomElement &parent, const QString &name, const char* value ) +void Serializer::marshal( TQDomDocument &doc, TQDomElement &parent, const TQString &name, const char* value ) { - QDomElement element = doc.createElement( name ); + TQDomElement element = doc.createElement( name ); element.setAttribute( "xsi:type", "xsd:byte" ); element.appendChild( doc.createTextNode( Serializer::marshalValue( value ) ) ); parent.appendChild( element ); } -void Serializer::demarshal( const QDomElement &element, char* value ) +void Serializer::demarshal( const TQDomElement &element, char* value ) { Serializer::demarshalValue( element.text(), value ); } -QString Serializer::marshalValue( const unsigned char* value ) +TQString Serializer::marshalValue( const unsigned char* value ) { - return QString( QChar( *value ) ); + return TQString( TQChar( *value ) ); } -void Serializer::demarshalValue( const QString &str, unsigned char *value ) +void Serializer::demarshalValue( const TQString &str, unsigned char *value ) { *value = str[ 0 ].latin1(); } -void Serializer::marshal( QDomDocument &doc, QDomElement &parent, const QString &name, const unsigned char* value ) +void Serializer::marshal( TQDomDocument &doc, TQDomElement &parent, const TQString &name, const unsigned char* value ) { - QDomElement element = doc.createElement( name ); + TQDomElement element = doc.createElement( name ); element.setAttribute( "xsi:type", "xsd:unsignedByte" ); element.appendChild( doc.createTextNode( Serializer::marshalValue( value ) ) ); parent.appendChild( element ); } -void Serializer::demarshal( const QDomElement &element, unsigned char* value ) +void Serializer::demarshal( const TQDomElement &element, unsigned char* value ) { Serializer::demarshalValue( element.text(), value ); } -QString Serializer::marshalValue( const short* value ) +TQString Serializer::marshalValue( const short* value ) { - return QString::number( *value ); + return TQString::number( *value ); } -void Serializer::demarshalValue( const QString &str, short *value ) +void Serializer::demarshalValue( const TQString &str, short *value ) { *value = str.toShort(); } -void Serializer::marshal( QDomDocument &doc, QDomElement &parent, const QString &name, const short* value ) +void Serializer::marshal( TQDomDocument &doc, TQDomElement &parent, const TQString &name, const short* value ) { - QDomElement element = doc.createElement( name ); + TQDomElement element = doc.createElement( name ); element.setAttribute( "xsi:type", "xsd:short" ); element.appendChild( doc.createTextNode( Serializer::marshalValue( value ) ) ); parent.appendChild( element ); } -void Serializer::demarshal( const QDomElement &element, short* value ) +void Serializer::demarshal( const TQDomElement &element, short* value ) { Serializer::demarshalValue( element.text(), value ); } -QString Serializer::marshalValue( const QByteArray* value ) +TQString Serializer::marshalValue( const TQByteArray* value ) { - return QString::fromUtf8( KCodecs::base64Encode( *value ) ); + return TQString::fromUtf8( KCodecs::base64Encode( *value ) ); } -void Serializer::demarshalValue( const QString &str, QByteArray *value ) +void Serializer::demarshalValue( const TQString &str, TQByteArray *value ) { *value = KCodecs::base64Decode( str.utf8() ); } -void Serializer::marshal( QDomDocument &doc, QDomElement &parent, const QString &name, const QByteArray* value ) +void Serializer::marshal( TQDomDocument &doc, TQDomElement &parent, const TQString &name, const TQByteArray* value ) { - QDomElement element = doc.createElement( name ); + TQDomElement element = doc.createElement( name ); element.setAttribute( "xsi:type", "xsd:base64Binary" ); element.appendChild( doc.createTextNode( Serializer::marshalValue( value ) ) ); parent.appendChild( element ); } -void Serializer::demarshal( const QDomElement &element, QByteArray* value ) +void Serializer::demarshal( const TQDomElement &element, TQByteArray* value ) { Serializer::demarshalValue( element.text(), value ); } -QString Serializer::marshalValue( const QDateTime* value ) +TQString Serializer::marshalValue( const TQDateTime* value ) { return value->toString( Qt::ISODate ); } -void Serializer::demarshalValue( const QString &str, QDateTime *value ) +void Serializer::demarshalValue( const TQString &str, TQDateTime *value ) { - *value = QDateTime::fromString( str, Qt::ISODate ); + *value = TQDateTime::fromString( str, Qt::ISODate ); } -void Serializer::marshal( QDomDocument &doc, QDomElement &parent, const QString &name, const QDateTime* value ) +void Serializer::marshal( TQDomDocument &doc, TQDomElement &parent, const TQString &name, const TQDateTime* value ) { - QDomElement element = doc.createElement( name ); + TQDomElement element = doc.createElement( name ); element.setAttribute( "xsi:type", "xsd:dateTime" ); element.appendChild( doc.createTextNode( Serializer::marshalValue( value ) ) ); parent.appendChild( element ); } -void Serializer::demarshal( const QDomElement &element, QDateTime* value ) +void Serializer::demarshal( const TQDomElement &element, TQDateTime* value ) { Serializer::demarshalValue( element.text(), value ); } -QString Serializer::marshalValue( const QDate* value ) +TQString Serializer::marshalValue( const TQDate* value ) { return value->toString( Qt::ISODate ); } -void Serializer::demarshalValue( const QString &str, QDate *value ) +void Serializer::demarshalValue( const TQString &str, TQDate *value ) { - *value = QDate::fromString( str, Qt::ISODate ); + *value = TQDate::fromString( str, Qt::ISODate ); } -void Serializer::marshal( QDomDocument &doc, QDomElement &parent, const QString &name, const QDate* value ) +void Serializer::marshal( TQDomDocument &doc, TQDomElement &parent, const TQString &name, const TQDate* value ) { - QDomElement element = doc.createElement( name ); + TQDomElement element = doc.createElement( name ); element.setAttribute( "xsi:type", "xsd:date" ); element.appendChild( doc.createTextNode( Serializer::marshalValue( value ) ) ); parent.appendChild( element ); } -void Serializer::demarshal( const QDomElement &element, QDate* value ) +void Serializer::demarshal( const TQDomElement &element, TQDate* value ) { Serializer::demarshalValue( element.text(), value ); } -void Serializer::marshal( QDomDocument &doc, QDomElement &parent, const QString &name, const ResultElementArray* value ) +void Serializer::marshal( TQDomDocument &doc, TQDomElement &parent, const TQString &name, const ResultElementArray* value ) { - QDomElement root = doc.createElement( name ); + TQDomElement root = doc.createElement( name ); root.setAttribute( "xsi:type", "ns1:ResultElementArray" ); parent.appendChild( root ); if ( value->items() ) { - const QPtrList<ResultElement>* list = value->items(); + const TQPtrList<ResultElement>* list = value->items(); - QDomElement element = doc.createElement( name ); + TQDomElement element = doc.createElement( name ); element.setAttribute( "xmlns:ns1", "http://schemas.xmlsoap.org/soap/encoding/" ); element.setAttribute( "xsi:type", "ns1:Array" ); - element.setAttribute( "ns1:arrayType", "ns1:ResultElement[" + QString::number( list->count() ) + "]" ); + element.setAttribute( "ns1:arrayType", "ns1:ResultElement[" + TQString::number( list->count() ) + "]" ); parent.appendChild( element ); - QPtrListIterator<ResultElement> it( *list ); + TQPtrListIterator<ResultElement> it( *list ); while ( it.current() != 0 ) { Serializer::marshal( doc, element, "item", it.current() ); ++it; @@ -329,13 +329,13 @@ void Serializer::marshal( QDomDocument &doc, QDomElement &parent, const QString } } -void Serializer::demarshal( const QDomElement &parent, ResultElementArray* value ) +void Serializer::demarshal( const TQDomElement &parent, ResultElementArray* value ) { - QPtrList<ResultElement>* itemsList = new QPtrList<ResultElement>(); + TQPtrList<ResultElement>* itemsList = new TQPtrList<ResultElement>(); itemsList->setAutoDelete( true ); - QDomNode node = parent.firstChild(); + TQDomNode node = parent.firstChild(); while ( !node.isNull() ) { - QDomElement element = node.toElement(); + TQDomElement element = node.toElement(); if ( !element.isNull() ) { if ( element.tagName() == "item" ) { ResultElement *item = new ResultElement; @@ -349,21 +349,21 @@ void Serializer::demarshal( const QDomElement &parent, ResultElementArray* value value->setItems( itemsList ); } -void Serializer::marshal( QDomDocument &doc, QDomElement &parent, const QString &name, const DirectoryCategoryArray* value ) +void Serializer::marshal( TQDomDocument &doc, TQDomElement &parent, const TQString &name, const DirectoryCategoryArray* value ) { - QDomElement root = doc.createElement( name ); + TQDomElement root = doc.createElement( name ); root.setAttribute( "xsi:type", "ns1:DirectoryCategoryArray" ); parent.appendChild( root ); if ( value->items() ) { - const QPtrList<DirectoryCategory>* list = value->items(); + const TQPtrList<DirectoryCategory>* list = value->items(); - QDomElement element = doc.createElement( name ); + TQDomElement element = doc.createElement( name ); element.setAttribute( "xmlns:ns1", "http://schemas.xmlsoap.org/soap/encoding/" ); element.setAttribute( "xsi:type", "ns1:Array" ); - element.setAttribute( "ns1:arrayType", "ns1:DirectoryCategory[" + QString::number( list->count() ) + "]" ); + element.setAttribute( "ns1:arrayType", "ns1:DirectoryCategory[" + TQString::number( list->count() ) + "]" ); parent.appendChild( element ); - QPtrListIterator<DirectoryCategory> it( *list ); + TQPtrListIterator<DirectoryCategory> it( *list ); while ( it.current() != 0 ) { Serializer::marshal( doc, element, "item", it.current() ); ++it; @@ -371,13 +371,13 @@ void Serializer::marshal( QDomDocument &doc, QDomElement &parent, const QString } } -void Serializer::demarshal( const QDomElement &parent, DirectoryCategoryArray* value ) +void Serializer::demarshal( const TQDomElement &parent, DirectoryCategoryArray* value ) { - QPtrList<DirectoryCategory>* itemsList = new QPtrList<DirectoryCategory>(); + TQPtrList<DirectoryCategory>* itemsList = new TQPtrList<DirectoryCategory>(); itemsList->setAutoDelete( true ); - QDomNode node = parent.firstChild(); + TQDomNode node = parent.firstChild(); while ( !node.isNull() ) { - QDomElement element = node.toElement(); + TQDomElement element = node.toElement(); if ( !element.isNull() ) { if ( element.tagName() == "item" ) { DirectoryCategory *item = new DirectoryCategory; @@ -391,9 +391,9 @@ void Serializer::demarshal( const QDomElement &parent, DirectoryCategoryArray* v value->setItems( itemsList ); } -void Serializer::marshal( QDomDocument &doc, QDomElement &parent, const QString &name, const GoogleSearchResult* value ) +void Serializer::marshal( TQDomDocument &doc, TQDomElement &parent, const TQString &name, const GoogleSearchResult* value ) { - QDomElement root = doc.createElement( name ); + TQDomElement root = doc.createElement( name ); root.setAttribute( "xsi:type", "ns1:GoogleSearchResult" ); parent.appendChild( root ); if ( value->documentFiltering() ) { @@ -431,11 +431,11 @@ void Serializer::marshal( QDomDocument &doc, QDomElement &parent, const QString } } -void Serializer::demarshal( const QDomElement &parent, GoogleSearchResult* value ) +void Serializer::demarshal( const TQDomElement &parent, GoogleSearchResult* value ) { - QDomNode node = parent.firstChild(); + TQDomNode node = parent.firstChild(); while ( !node.isNull() ) { - QDomElement element = node.toElement(); + TQDomElement element = node.toElement(); if ( !element.isNull() ) { if ( element.tagName() == "documentFiltering" ) { bool* item = new bool; @@ -443,7 +443,7 @@ void Serializer::demarshal( const QDomElement &parent, GoogleSearchResult* value value->setDocumentFiltering( item ); } if ( element.tagName() == "searchComments" ) { - QString* item = new QString; + TQString* item = new QString; Serializer::demarshal( element, item ); value->setSearchComments( item ); } @@ -463,7 +463,7 @@ void Serializer::demarshal( const QDomElement &parent, GoogleSearchResult* value value->setResultElements( item ); } if ( element.tagName() == "searchQuery" ) { - QString* item = new QString; + TQString* item = new QString; Serializer::demarshal( element, item ); value->setSearchQuery( item ); } @@ -478,7 +478,7 @@ void Serializer::demarshal( const QDomElement &parent, GoogleSearchResult* value value->setEndIndex( item ); } if ( element.tagName() == "searchTips" ) { - QString* item = new QString; + TQString* item = new QString; Serializer::demarshal( element, item ); value->setSearchTips( item ); } @@ -498,9 +498,9 @@ void Serializer::demarshal( const QDomElement &parent, GoogleSearchResult* value } -void Serializer::marshal( QDomDocument &doc, QDomElement &parent, const QString &name, const DirectoryCategory* value ) +void Serializer::marshal( TQDomDocument &doc, TQDomElement &parent, const TQString &name, const DirectoryCategory* value ) { - QDomElement root = doc.createElement( name ); + TQDomElement root = doc.createElement( name ); root.setAttribute( "xsi:type", "ns1:DirectoryCategory" ); parent.appendChild( root ); if ( value->fullViewableName() ) { @@ -511,19 +511,19 @@ void Serializer::marshal( QDomDocument &doc, QDomElement &parent, const QString } } -void Serializer::demarshal( const QDomElement &parent, DirectoryCategory* value ) +void Serializer::demarshal( const TQDomElement &parent, DirectoryCategory* value ) { - QDomNode node = parent.firstChild(); + TQDomNode node = parent.firstChild(); while ( !node.isNull() ) { - QDomElement element = node.toElement(); + TQDomElement element = node.toElement(); if ( !element.isNull() ) { if ( element.tagName() == "fullViewableName" ) { - QString* item = new QString; + TQString* item = new QString; Serializer::demarshal( element, item ); value->setFullViewableName( item ); } if ( element.tagName() == "specialEncoding" ) { - QString* item = new QString; + TQString* item = new QString; Serializer::demarshal( element, item ); value->setSpecialEncoding( item ); } @@ -533,9 +533,9 @@ void Serializer::demarshal( const QDomElement &parent, DirectoryCategory* value } -void Serializer::marshal( QDomDocument &doc, QDomElement &parent, const QString &name, const ResultElement* value ) +void Serializer::marshal( TQDomDocument &doc, TQDomElement &parent, const TQString &name, const ResultElement* value ) { - QDomElement root = doc.createElement( name ); + TQDomElement root = doc.createElement( name ); root.setAttribute( "xsi:type", "ns1:ResultElement" ); parent.appendChild( root ); if ( value->summary() ) { @@ -567,34 +567,34 @@ void Serializer::marshal( QDomDocument &doc, QDomElement &parent, const QString } } -void Serializer::demarshal( const QDomElement &parent, ResultElement* value ) +void Serializer::demarshal( const TQDomElement &parent, ResultElement* value ) { - QDomNode node = parent.firstChild(); + TQDomNode node = parent.firstChild(); while ( !node.isNull() ) { - QDomElement element = node.toElement(); + TQDomElement element = node.toElement(); if ( !element.isNull() ) { if ( element.tagName() == "summary" ) { - QString* item = new QString; + TQString* item = new QString; Serializer::demarshal( element, item ); value->setSummary( item ); } if ( element.tagName() == "URL" ) { - QString* item = new QString; + TQString* item = new QString; Serializer::demarshal( element, item ); value->setURL( item ); } if ( element.tagName() == "snippet" ) { - QString* item = new QString; + TQString* item = new QString; Serializer::demarshal( element, item ); value->setSnippet( item ); } if ( element.tagName() == "title" ) { - QString* item = new QString; + TQString* item = new QString; Serializer::demarshal( element, item ); value->setTitle( item ); } if ( element.tagName() == "cachedSize" ) { - QString* item = new QString; + TQString* item = new QString; Serializer::demarshal( element, item ); value->setCachedSize( item ); } @@ -604,7 +604,7 @@ void Serializer::demarshal( const QDomElement &parent, ResultElement* value ) value->setRelatedInformationPresent( item ); } if ( element.tagName() == "hostName" ) { - QString* item = new QString; + TQString* item = new QString; Serializer::demarshal( element, item ); value->setHostName( item ); } @@ -614,7 +614,7 @@ void Serializer::demarshal( const QDomElement &parent, ResultElement* value ) value->setDirectoryCategory( item ); } if ( element.tagName() == "directoryTitle" ) { - QString* item = new QString; + TQString* item = new QString; Serializer::demarshal( element, item ); value->setDirectoryTitle( item ); } |