summaryrefslogtreecommitdiffstats
path: root/dcopjava/dcopidl2java
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2011-12-05 16:20:48 -0600
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2011-12-05 16:20:48 -0600
commite63beeb5bdb82987b1e00bc35178667786fbad48 (patch)
treeab77b6ac830b7944d5d1eb9ce8f81feb8fdab948 /dcopjava/dcopidl2java
parent67557a2b56c0678c22ab1b00c4fd0224c5e9ed99 (diff)
downloadtdebindings-e63beeb5bdb82987b1e00bc35178667786fbad48.tar.gz
tdebindings-e63beeb5bdb82987b1e00bc35178667786fbad48.zip
Fix incorrect conversion
Diffstat (limited to 'dcopjava/dcopidl2java')
-rw-r--r--dcopjava/dcopidl2java/main.cpp14
-rw-r--r--dcopjava/dcopidl2java/main.h4
-rw-r--r--dcopjava/dcopidl2java/skel.cpp78
-rw-r--r--dcopjava/dcopidl2java/stubimpl.cpp68
4 files changed, 82 insertions, 82 deletions
diff --git a/dcopjava/dcopidl2java/main.cpp b/dcopjava/dcopidl2java/main.cpp
index 97ba153d..913b7e7a 100644
--- a/dcopjava/dcopidl2java/main.cpp
+++ b/dcopjava/dcopidl2java/main.cpp
@@ -48,7 +48,7 @@ int main( int argc, char** argv )
int argpos = 1;
bool generate_skel = TRUE;
bool generate_stub = TRUE;
- TTQString package;
+ TQString package;
while (argc > 2) {
@@ -67,7 +67,7 @@ int main( int argc, char** argv )
else if ( strcmp( argv[argpos], "--package" ) == 0 )
{
if (argpos + 1 < argc)
- package = TTQString(argv[argpos+1]);
+ package = TQString(argv[argpos+1]);
for (int i = argpos; i < argc - 2; i++) argv[i] = argv[i+2];
argc -= 2;
@@ -78,18 +78,18 @@ int main( int argc, char** argv )
}
}
- TTQFile in( argv[argpos] );
+ TQFile in( argv[argpos] );
if ( !in.open( IO_ReadOnly ) )
qFatal("Could not read %s", argv[argpos] );
- TTQDomDocument doc;
+ TQDomDocument doc;
doc.setContent( &in );
- TTQDomElement de = doc.documentElement();
+ TQDomElement de = doc.documentElement();
ASSERT( de.tagName() == "DCOP-IDL" );
- TTQString base( argv[argpos] );
- TTQString idl = base;
+ TQString base( argv[argpos] );
+ TQString idl = base;
int pos = base.findRev( '.' );
if ( pos != -1 )
diff --git a/dcopjava/dcopidl2java/main.h b/dcopjava/dcopidl2java/main.h
index ed0c0ec7..d3f19c0c 100644
--- a/dcopjava/dcopidl2java/main.h
+++ b/dcopjava/dcopidl2java/main.h
@@ -26,10 +26,10 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
/**
* Writes the skeleton
*/
-void generateSkel( const TTQString& idl, const TTQString& filename, TTQDomElement de );
+void generateSkel( const TQString& idl, const TQString& filename, TQDomElement de );
/**
* Writes the stub implementation
*/
-void generateStubImpl( const TTQString& idl, const TTQString& package, const TTQString& filename, TTQDomElement de );
+void generateStubImpl( const TQString& idl, const TQString& package, const TQString& filename, TQDomElement de );
diff --git a/dcopjava/dcopidl2java/skel.cpp b/dcopjava/dcopidl2java/skel.cpp
index 8856ea32..8894fd82 100644
--- a/dcopjava/dcopidl2java/skel.cpp
+++ b/dcopjava/dcopidl2java/skel.cpp
@@ -52,23 +52,23 @@ static int const primes[] =
struct Function
{
Function(){};
- Function( const TTQString& t, const TTQString& n, const TTQString&fn ) : type( t ), name( n ), fullName( fn ){}
- TTQString type;
- TTQString name;
- TTQString fullName;
+ Function( const TQString& t, const TQString& n, const TQString&fn ) : type( t ), name( n ), fullName( fn ){}
+ TQString type;
+ TQString name;
+ TQString fullName;
};
/**
* Writes the skeleton
*/
-void generateSkel( const TTQString& idl, const TTQString& filename, TTQDomElement de )
+void generateSkel( const TQString& idl, const TQString& filename, TQDomElement de )
{
- TTQFile skel( filename );
+ TQFile skel( filename );
if ( !skel.open( IO_WriteOnly ) )
qFatal("Could not write to %s", filename.latin1() );
- TTQTextStream str( &skel );
+ TQTextStream str( &skel );
str << "/****************************************************************************" << endl;
str << "**" << endl;
@@ -79,41 +79,41 @@ void generateSkel( const TTQString& idl, const TTQString& filename, TTQDomElemen
str << "*****************************************************************************/" << endl;
str << endl;
- TTQDomElement e = de.firstChild().toElement();
+ TQDomElement 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" ) {
- TTQDomElement n = e.firstChild().toElement();
+ TQDomElement n = e.firstChild().toElement();
ASSERT( n.tagName() == "NAME" );
- TTQString className = n.firstChild().toText().data();
+ TQString className = n.firstChild().toText().data();
// find dcop parent ( rightmost super class )
- TTQString DCOPParent;
- TTQDomElement s = n.nextSibling().toElement();
+ TQString DCOPParent;
+ TQDomElement s = n.nextSibling().toElement();
for( ; !s.isNull(); s = s.nextSibling().toElement() ) {
if ( s.tagName() == "SUPER" )
DCOPParent = s.firstChild().toText().data();
}
// get function table
- TTQValueList<Function> functions;
+ TQValueList<Function> functions;
s = n.nextSibling().toElement();
for( ; !s.isNull(); s = s.nextSibling().toElement() ) {
if ( s.tagName() == "FUNC" ) {
- TTQDomElement r = s.firstChild().toElement();
+ TQDomElement r = s.firstChild().toElement();
ASSERT( r.tagName() == "TYPE" );
- TTQString funcType = r.firstChild().toText().data();
+ TQString funcType = r.firstChild().toText().data();
r = r.nextSibling().toElement();
ASSERT ( r.tagName() == "NAME" );
- TTQString funcName = r.firstChild().toText().data();
- TTQStringList argtypes;
- TTQStringList argnames;
+ TQString funcName = r.firstChild().toText().data();
+ TQStringList argtypes;
+ TQStringList argnames;
r = r.nextSibling().toElement();
for( ; !r.isNull(); r = r.nextSibling().toElement() ) {
ASSERT( r.tagName() == "ARG" );
- TTQDomElement a = r.firstChild().toElement();
+ TQDomElement 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 TTQString& idl, const TTQString& filename, TTQDomElemen
ASSERT( a.tagName() == "NAME" );
argnames.append( a.firstChild().toText().data() );
} else {
- argnames.append( TTQString::null );
+ argnames.append( TQString::null );
}
}
funcName += '(';
- TTQString fullFuncName = funcName;
+ TQString fullFuncName = funcName;
bool first = TRUE;
- TTQStringList::Iterator ittype = argtypes.begin();
- TTQStringList::Iterator itname = argnames.begin();
+ TQStringList::Iterator ittype = argtypes.begin();
+ TQStringList::Iterator itname = argnames.begin();
while ( ittype != argtypes.end() && itname != argnames.end() ) {
if ( !first ) {
funcName += ',';
@@ -168,7 +168,7 @@ void generateSkel( const TTQString& idl, const TTQString& filename, TTQDomElemen
str << "static const int " << className << "_fhash = " << fhash << ";" << endl;
}
str << "static const char* const " << className << "_ftable[" << functions.count() + 1 << "][3] = {" << endl;
- for( TTQValueList<Function>::Iterator it = functions.begin(); it != functions.end(); ++it ){
+ for( TQValueList<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 TTQString& idl, const TTQString& filename, TTQDomElemen
// Write dispatcher
str << "bool " << className;
- str << "::process(const TTQCString &fun, const TTQByteArray &data, TTQCString& replyType, TTQByteArray &replyData)" << endl;
+ str << "::process(const TQCString &fun, const TQByteArray &data, TQCString& replyType, TQByteArray &replyData)" << endl;
str << "{" << endl;
if ( useHashing ) {
- str << " static TTQAsciiDict<int>* fdict = 0;" << endl;
+ str << " static TQAsciiDict<int>* fdict = 0;" << endl;
str << " if ( !fdict ) {" << endl;
- str << "\tfdict = new TTQAsciiDict<int>( " << className << "_fhash, TRUE, FALSE );" << endl;
+ str << "\tfdict = new TQAsciiDict<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 TTQString& idl, const TTQString& filename, TTQDomElemen
bool firstFunc = TRUE;
for( ; !s.isNull(); s = s.nextSibling().toElement() ) {
if ( s.tagName() == "FUNC" ) {
- TTQDomElement r = s.firstChild().toElement();
+ TQDomElement r = s.firstChild().toElement();
ASSERT( r.tagName() == "TYPE" );
- TTQString funcType = r.firstChild().toText().data();
+ TQString funcType = r.firstChild().toText().data();
if ( funcType == "ASYNC" )
funcType = "void";
r = r.nextSibling().toElement();
ASSERT ( r.tagName() == "NAME" );
- TTQString funcName = r.firstChild().toText().data();
- TTQStringList args;
- TTQStringList argtypes;
+ TQString funcName = r.firstChild().toText().data();
+ TQStringList args;
+ TQStringList argtypes;
r = r.nextSibling().toElement();
for( ; !r.isNull(); r = r.nextSibling().toElement() ) {
ASSERT( r.tagName() == "ARG" );
- TTQDomElement a = r.firstChild().toElement();
+ TQDomElement a = r.firstChild().toElement();
ASSERT( a.tagName() == "TYPE" );
argtypes.append( a.firstChild().toText().data() );
- args.append( TTQString("arg" ) + TTQString::number( args.count() ) );
+ args.append( TQString("arg" ) + TQString::number( args.count() ) );
}
- TTQString plainFuncName = funcName;
+ TQString plainFuncName = funcName;
funcName += '(';
bool first = TRUE;
- for( TTQStringList::Iterator argtypes_count = argtypes.begin(); argtypes_count != argtypes.end(); ++argtypes_count ){
+ for( TQStringList::Iterator argtypes_count = argtypes.begin(); argtypes_count != argtypes.end(); ++argtypes_count ){
if ( !first )
funcName += ',';
first = FALSE;
@@ -237,8 +237,8 @@ void generateSkel( const TTQString& idl, const TTQString& filename, TTQDomElemen
firstFunc = FALSE;
}
if ( !args.isEmpty() ) {
- TTQStringList::Iterator ittypes = argtypes.begin();
- TTQStringList::Iterator args_count;
+ TQStringList::Iterator ittypes = argtypes.begin();
+ TQStringList::Iterator args_count;
for( args_count = args.begin(); args_count != args.end(); ++args_count ){
str << '\t'<< *ittypes << " " << *args_count << ";" << endl;
++ittypes;
@@ -258,7 +258,7 @@ void generateSkel( const TTQString& idl, const TTQString& filename, TTQDomElemen
}
first = TRUE;
- for ( TTQStringList::Iterator args_count = args.begin(); args_count != args.end(); ++args_count ){
+ for ( TQStringList::Iterator args_count = args.begin(); args_count != args.end(); ++args_count ){
if ( !first )
str << ", ";
first = FALSE;
diff --git a/dcopjava/dcopidl2java/stubimpl.cpp b/dcopjava/dcopidl2java/stubimpl.cpp
index dbb84a93..55e474c9 100644
--- a/dcopjava/dcopidl2java/stubimpl.cpp
+++ b/dcopjava/dcopidl2java/stubimpl.cpp
@@ -33,15 +33,15 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "main.h"
-TTQString javaType(TTQString type)
+TQString javaType(TQString type)
{
if (type == "bool")
return "boolean";
- if (type == "TTQString")
+ if (type == "TQString")
return "String";
- if (type == "TTQCString")
+ if (type == "TQCString")
return "String";
- if (type == "TTQStringList")
+ if (type == "TQStringList")
return "String[]";
if (type == "short int")
return "short";
@@ -52,50 +52,50 @@ TTQString javaType(TTQString type)
}
-TTQString javaRightAttribute(TTQString attr)
+TQString javaRightAttribute(TQString attr)
{
if (attr == "&")
- return TTQString::null;
+ return TQString::null;
return "!!!NOT IMPLEMENTED: " + attr;
}
-TTQString javaLeftAttribute(TTQString attr)
+TQString javaLeftAttribute(TQString attr)
{
if (attr == "const")
- return TTQString::null;
+ return TQString::null;
return "!!!NOT IMPLEMENTED: " + attr;
}
-TTQString javaQualifier(TTQString qual)
+TQString javaQualifier(TQString qual)
{
if (qual == "const")
- return TTQString::null;
+ return TQString::null;
return "!!!NOT IMPLEMENTED: " + qual;
}
-TTQString underscore(TTQString in)
+TQString underscore(TQString in)
{
- return in.replace(TTQRegExp(" "), "_");
+ return in.replace(TQRegExp(" "), "_");
}
-TTQString defValue(TTQString type)
+TQString defValue(TQString type)
{
if (type == "bool")
return "false";
- if (type == "TTQString")
+ if (type == "TQString")
return "null";
- if (type == "TTQStringList")
+ if (type == "TQStringList")
return "null";
if (type == "DCOPRef")
return "null";
- if (type == "TTQCString")
+ if (type == "TQCString")
return "null";
return "0";
@@ -105,13 +105,13 @@ TTQString defValue(TTQString type)
/**
* Writes the stub implementation
*/
-void generateStubImpl( const TTQString& idl, const TTQString& package, const TTQString& filename, TTQDomElement de )
+void generateStubImpl( const TQString& idl, const TQString& package, const TQString& filename, TQDomElement de )
{
- TTQFile impl( filename );
+ TQFile impl( filename );
if ( !impl.open( IO_WriteOnly ) )
qFatal("Could not write to %s", filename.latin1() );
- TTQTextStream str( &impl );
+ TQTextStream str( &impl );
str << "/****************************************************************************" << endl;
str << "**" << endl;
@@ -129,16 +129,16 @@ void generateStubImpl( const TTQString& idl, const TTQString& package, const TTQ
str << "import org.kde.DCOP.*;" << endl;
str << endl << endl;
- TTQDomElement e = de.firstChild().toElement();
+ TQDomElement e = de.firstChild().toElement();
for( ; !e.isNull(); e = e.nextSibling().toElement() ) {
if ( e.tagName() == "CLASS" ) {
- TTQDomElement n = e.firstChild().toElement();
+ TQDomElement n = e.firstChild().toElement();
ASSERT( n.tagName() == "NAME" );
- TTQString className = n.firstChild().toText().data() + "_stub";
+ TQString className = n.firstChild().toText().data() + "_stub";
// find dcop parent ( rightmost super class )
- TTQString DCOPParent;
- TTQDomElement s = n.nextSibling().toElement();
+ TQString DCOPParent;
+ TQDomElement s = n.nextSibling().toElement();
for( ; !s.isNull(); s = s.nextSibling().toElement() ) {
if ( s.tagName() == "SUPER" )
DCOPParent = s.firstChild().toText().data();
@@ -163,9 +163,9 @@ void generateStubImpl( const TTQString& idl, const TTQString& package, const TTQ
s = e.firstChild().toElement();
for( ; !s.isNull(); s = s.nextSibling().toElement() ) {
if ( s.tagName() == "FUNC" ) {
- TTQDomElement r = s.firstChild().toElement();
+ TQDomElement r = s.firstChild().toElement();
ASSERT( r.tagName() == "TYPE" );
- TTQString result = r.firstChild().toText().data();
+ TQString result = r.firstChild().toText().data();
str << " public ";
bool async = result == "ASYNC";
if ( async)
@@ -180,11 +180,11 @@ void generateStubImpl( const TTQString& idl, const TTQString& package, const TTQ
r = r.nextSibling().toElement();
ASSERT ( r.tagName() == "NAME" );
- TTQString funcName = r.firstChild().toText().data();
+ TQString funcName = r.firstChild().toText().data();
str << funcName << "(";
- TTQStringList args;
- TTQStringList argtypes;
+ TQStringList args;
+ TQStringList argtypes;
bool first = TRUE;
r = r.nextSibling().toElement();
for( ; !r.isNull(); r = r.nextSibling().toElement() ) {
@@ -192,7 +192,7 @@ void generateStubImpl( const TTQString& idl, const TTQString& package, const TTQ
str << ", ";
first = FALSE;
ASSERT( r.tagName() == "ARG" );
- TTQDomElement a = r.firstChild().toElement();
+ TQDomElement a = r.firstChild().toElement();
ASSERT( a.tagName() == "TYPE" );
if ( a.hasAttribute( "qleft" ) )
str << javaLeftAttribute(a.attribute("qleft")) << " ";
@@ -202,7 +202,7 @@ void generateStubImpl( const TTQString& idl, const TTQString& package, const TTQ
str << javaRightAttribute(a.attribute("qright")) << " ";
else
str << " ";
- args.append(TTQString("arg") + TTQString::number(args.count())) ;
+ args.append(TQString("arg") + TQString::number(args.count())) ;
str << args.last();
}
str << ")";
@@ -215,7 +215,7 @@ void generateStubImpl( const TTQString& idl, const TTQString& package, const TTQ
funcName += "(";
first = TRUE;
- for( TTQStringList::Iterator it = argtypes.begin(); it != argtypes.end(); ++it ){
+ for( TQStringList::Iterator it = argtypes.begin(); it != argtypes.end(); ++it ){
if ( !first )
funcName += ",";
first = FALSE;
@@ -230,7 +230,7 @@ void generateStubImpl( const TTQString& idl, const TTQString& package, const TTQ
str << " try" << endl;
str << " {" << endl;
- TTQStringList::Iterator itt, ita;
+ TQStringList::Iterator itt, ita;
for (itt = argtypes.begin(), ita = args.begin(); itt != argtypes.end(); ++itt, ++ita)
str << " write_" << *itt << "(os, " << *ita << ");" << endl;
}
@@ -256,7 +256,7 @@ void generateStubImpl( const TTQString& idl, const TTQString& package, const TTQ
str << " try" << endl;
str << " {" << endl;
- TTQStringList::Iterator itt, ita;
+ TQStringList::Iterator itt, ita;
for (itt = argtypes.begin(), ita = args.begin(); itt != argtypes.end(); ++itt, ++ita)
str << " write_" << underscore(*itt) << "(os, " << *ita << ");" << endl;