diff options
Diffstat (limited to 'dcopjava/dcopidl2java/skel.cpp')
-rw-r--r-- | dcopjava/dcopidl2java/skel.cpp | 96 |
1 files changed, 48 insertions, 48 deletions
diff --git a/dcopjava/dcopidl2java/skel.cpp b/dcopjava/dcopidl2java/skel.cpp index 68f1b46b..8856ea32 100644 --- a/dcopjava/dcopidl2java/skel.cpp +++ b/dcopjava/dcopidl2java/skel.cpp @@ -52,23 +52,23 @@ static int const primes[] = struct Function { Function(){}; - Function( const TQString& t, const TQString& n, const TQString&fn ) : type( t ), name( n ), fullName( fn ){} - TQString type; - TQString name; - TQString fullName; + Function( const TTQString& t, const TTQString& n, const TTQString&fn ) : type( t ), name( n ), fullName( fn ){} + TTQString type; + TTQString name; + TTQString fullName; }; /** * Writes the skeleton */ -void generateSkel( const TQString& idl, const TQString& filename, TQDomElement de ) +void generateSkel( const TTQString& idl, const TTQString& filename, TTQDomElement de ) { - TQFile skel( filename ); + TTQFile skel( filename ); if ( !skel.open( IO_WriteOnly ) ) qFatal("Could not write to %s", filename.latin1() ); - TQTextStream str( &skel ); + TTQTextStream str( &skel ); str << "/****************************************************************************" << endl; str << "**" << endl; @@ -79,41 +79,41 @@ void generateSkel( const TQString& idl, const TQString& filename, TQDomElement d str << "*****************************************************************************/" << endl; str << endl; - TQDomElement e = de.firstChild().toElement(); + TTQDomElement e = de.firstChild().toElement(); if ( e.tagName() == "SOURCE" ) { str << "#include \"" << e.firstChild().toText().data() << "\"" << endl << endl; } for( ; !e.isNull(); e = e.nextSibling().toElement() ) { if ( e.tagName() == "CLASS" ) { - TQDomElement n = e.firstChild().toElement(); + TTQDomElement n = e.firstChild().toElement(); ASSERT( n.tagName() == "NAME" ); - TQString className = n.firstChild().toText().data(); + TTQString className = n.firstChild().toText().data(); // find dcop parent ( rightmost super class ) - TQString DCOPParent; - TQDomElement s = n.nextSibling().toElement(); + TTQString DCOPParent; + TTQDomElement s = n.nextSibling().toElement(); for( ; !s.isNull(); s = s.nextSibling().toElement() ) { if ( s.tagName() == "SUPER" ) DCOPParent = s.firstChild().toText().data(); } // get function table - TQValueList<Function> functions; + TTQValueList<Function> functions; s = n.nextSibling().toElement(); for( ; !s.isNull(); s = s.nextSibling().toElement() ) { if ( s.tagName() == "FUNC" ) { - TQDomElement r = s.firstChild().toElement(); + TTQDomElement r = s.firstChild().toElement(); ASSERT( r.tagName() == "TYPE" ); - TQString funcType = r.firstChild().toText().data(); + TTQString funcType = r.firstChild().toText().data(); r = r.nextSibling().toElement(); ASSERT ( r.tagName() == "NAME" ); - TQString funcName = r.firstChild().toText().data(); - TQStringList argtypes; - TQStringList argnames; + TTQString funcName = r.firstChild().toText().data(); + TTQStringList argtypes; + TTQStringList argnames; r = r.nextSibling().toElement(); for( ; !r.isNull(); r = r.nextSibling().toElement() ) { ASSERT( r.tagName() == "ARG" ); - TQDomElement a = r.firstChild().toElement(); + TTQDomElement a = r.firstChild().toElement(); ASSERT( a.tagName() == "TYPE" ); argtypes.append( a.firstChild().toText().data() ); a = a.nextSibling().toElement(); @@ -121,14 +121,14 @@ void generateSkel( const TQString& idl, const TQString& filename, TQDomElement d ASSERT( a.tagName() == "NAME" ); argnames.append( a.firstChild().toText().data() ); } else { - argnames.append( TQString::null ); + argnames.append( TTQString::null ); } } funcName += '('; - TQString fullFuncName = funcName; + TTQString fullFuncName = funcName; bool first = TRUE; - TQStringList::Iterator ittype = argtypes.begin(); - TQStringList::Iterator itname = argnames.begin(); + TTQStringList::Iterator ittype = argtypes.begin(); + TTQStringList::Iterator itname = argnames.begin(); while ( ittype != argtypes.end() && itname != argnames.end() ) { if ( !first ) { funcName += ','; @@ -168,7 +168,7 @@ void generateSkel( const TQString& idl, const TQString& filename, TQDomElement d str << "static const int " << className << "_fhash = " << fhash << ";" << endl; } str << "static const char* const " << className << "_ftable[" << functions.count() + 1 << "][3] = {" << endl; - for( TQValueList<Function>::Iterator it = functions.begin(); it != functions.end(); ++it ){ + for( TTQValueList<Function>::Iterator it = functions.begin(); it != functions.end(); ++it ){ str << " { \"" << (*it).type << "\", \"" << (*it).name << "\", \"" << (*it).fullName << "\" }," << endl; } str << " { 0, 0, 0 }" << endl; @@ -179,13 +179,13 @@ void generateSkel( const TQString& idl, const TQString& filename, TQDomElement d // Write dispatcher str << "bool " << className; - str << "::process(const TQCString &fun, const TQByteArray &data, TQCString& replyType, TQByteArray &replyData)" << endl; + str << "::process(const TTQCString &fun, const TTQByteArray &data, TTQCString& replyType, TTQByteArray &replyData)" << endl; str << "{" << endl; if ( useHashing ) { - str << " static TQAsciiDict<int>* fdict = 0;" << endl; + str << " static TTQAsciiDict<int>* fdict = 0;" << endl; str << " if ( !fdict ) {" << endl; - str << "\tfdict = new TQAsciiDict<int>( " << className << "_fhash, TRUE, FALSE );" << endl; + str << "\tfdict = new TTQAsciiDict<int>( " << className << "_fhash, TRUE, FALSE );" << endl; str << "\tfor ( int i = 0; " << className << "_ftable[i][1]; i++ )" << endl; str << "\t fdict->insert( " << className << "_ftable[i][1], new int( i ) );" << endl; str << " }" << endl; @@ -198,28 +198,28 @@ void generateSkel( const TQString& idl, const TQString& filename, TQDomElement d bool firstFunc = TRUE; for( ; !s.isNull(); s = s.nextSibling().toElement() ) { if ( s.tagName() == "FUNC" ) { - TQDomElement r = s.firstChild().toElement(); + TTQDomElement r = s.firstChild().toElement(); ASSERT( r.tagName() == "TYPE" ); - TQString funcType = r.firstChild().toText().data(); + TTQString funcType = r.firstChild().toText().data(); if ( funcType == "ASYNC" ) funcType = "void"; r = r.nextSibling().toElement(); ASSERT ( r.tagName() == "NAME" ); - TQString funcName = r.firstChild().toText().data(); - TQStringList args; - TQStringList argtypes; + TTQString funcName = r.firstChild().toText().data(); + TTQStringList args; + TTQStringList argtypes; r = r.nextSibling().toElement(); for( ; !r.isNull(); r = r.nextSibling().toElement() ) { ASSERT( r.tagName() == "ARG" ); - TQDomElement a = r.firstChild().toElement(); + TTQDomElement a = r.firstChild().toElement(); ASSERT( a.tagName() == "TYPE" ); argtypes.append( a.firstChild().toText().data() ); - args.append( TQString("arg" ) + TQString::number( args.count() ) ); + args.append( TTQString("arg" ) + TTQString::number( args.count() ) ); } - TQString plainFuncName = funcName; + TTQString plainFuncName = funcName; funcName += '('; bool first = TRUE; - for( TQStringList::Iterator argtypes_count = argtypes.begin(); argtypes_count != argtypes.end(); ++argtypes_count ){ + for( TTQStringList::Iterator argtypes_count = argtypes.begin(); argtypes_count != argtypes.end(); ++argtypes_count ){ if ( !first ) funcName += ','; first = FALSE; @@ -237,13 +237,13 @@ void generateSkel( const TQString& idl, const TQString& filename, TQDomElement d firstFunc = FALSE; } if ( !args.isEmpty() ) { - TQStringList::Iterator ittypes = argtypes.begin(); - TQStringList::Iterator args_count; + TTQStringList::Iterator ittypes = argtypes.begin(); + TTQStringList::Iterator args_count; for( args_count = args.begin(); args_count != args.end(); ++args_count ){ str << '\t'<< *ittypes << " " << *args_count << ";" << endl; ++ittypes; } - str << "\tQDataStream arg( data, IO_ReadOnly );" << endl; + str << "\tTQDataStream arg( data, IO_ReadOnly );" << endl; for( args_count = args.begin(); args_count != args.end(); ++args_count ){ str << "\targ >> " << *args_count << ";" << endl; } @@ -253,12 +253,12 @@ void generateSkel( const TQString& idl, const TQString& filename, TQDomElement d if ( funcType == "void" ) { str << '\t' << plainFuncName << '('; } else { - str << "\tQDataStream _replyStream( replyData, IO_WriteOnly );" << endl; + str << "\tTQDataStream _replyStream( replyData, IO_WriteOnly );" << endl; str << "\t_replyStream << " << plainFuncName << '('; } first = TRUE; - for ( TQStringList::Iterator args_count = args.begin(); args_count != args.end(); ++args_count ){ + for ( TTQStringList::Iterator args_count = args.begin(); args_count != args.end(); ++args_count ){ if ( !first ) str << ", "; first = FALSE; @@ -286,29 +286,29 @@ void generateSkel( const TQString& idl, const TQString& filename, TQDomElement d str << " return TRUE;" << endl; str << "}" << endl << endl; - str << "QCStringList " << className; + str << "TQCStringList " << className; str << "::interfaces()" << endl; str << "{" << endl; if (!DCOPParent.isEmpty()) { - str << " QCStringList ifaces = " << DCOPParent << "::interfaces();" << endl; + str << " TQCStringList ifaces = " << DCOPParent << "::interfaces();" << endl; } else { - str << " QCStringList ifaces;" << endl; + str << " TQCStringList ifaces;" << endl; } str << " ifaces += \"" << className << "\";" << endl; str << " return ifaces;" << endl; str << "}" << endl << endl; - str << "QCStringList " << className; + str << "TQCStringList " << className; str << "::functions()" << endl; str << "{" << endl; if (!DCOPParent.isEmpty()) { - str << " QCStringList funcs = " << DCOPParent << "::functions();" << endl; + str << " TQCStringList funcs = " << DCOPParent << "::functions();" << endl; } else { - str << " QCStringList funcs;" << endl; + str << " TQCStringList funcs;" << endl; } str << " for ( int i = 0; " << className << "_ftable[i][2]; i++ ) {" << endl; - str << "\tQCString func = " << className << "_ftable[i][0];" << endl; + str << "\tTQCString func = " << className << "_ftable[i][0];" << endl; str << "\tfunc += ' ';" << endl; str << "\tfunc += " << className << "_ftable[i][2];" << endl; str << "\tfuncs << func;" << endl; |