summaryrefslogtreecommitdiffstats
path: root/languages/cpp/stringhelpers.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:56:07 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:56:07 +0000
commitd6f8bbb45b267065a6907e71ff9c98bb6d161241 (patch)
treed109539636691d7b03036ca1c0ed29dbae6577cf /languages/cpp/stringhelpers.cpp
parent3331a47a9cad24795c7440ee8107143ce444ef34 (diff)
downloadtdevelop-d6f8bbb45b267065a6907e71ff9c98bb6d161241.tar.gz
tdevelop-d6f8bbb45b267065a6907e71ff9c98bb6d161241.zip
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdevelop@1157658 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'languages/cpp/stringhelpers.cpp')
-rw-r--r--languages/cpp/stringhelpers.cpp52
1 files changed, 26 insertions, 26 deletions
diff --git a/languages/cpp/stringhelpers.cpp b/languages/cpp/stringhelpers.cpp
index d380fd64..13a39de2 100644
--- a/languages/cpp/stringhelpers.cpp
+++ b/languages/cpp/stringhelpers.cpp
@@ -19,17 +19,17 @@ k copyright : (C) 2006 by David Nolden
namespace StringHelpers
{
-void clearStr( QString& str, int start, int end ) {
+void clearStr( TQString& str, int start, int end ) {
for( int a = start; a < end; a++) str[a] = ' ';
}
-bool isValidIdentifierSign( const QChar& c ) {
+bool isValidIdentifierSign( const TQChar& c ) {
if( c.isLetter() || c.isDigit() || c == '_' ) return true;
else return false;
}
-QString clearComments( QString str ) {
+TQString clearComments( TQString str ) {
if( str.isEmpty() ) return "";
SafetyCounter s( 1000 );
@@ -64,7 +64,7 @@ QString clearComments( QString str ) {
return str;
}
-QString cutTemplateParams( QString str ) {
+TQString cutTemplateParams( TQString str ) {
int p;
if( (p = str.find('<') ) != -1) {
return str.left( p );
@@ -73,8 +73,8 @@ QString cutTemplateParams( QString str ) {
return str.stripWhiteSpace().replace('*',"");
}
-QPair<QString, QString> splitTemplateParams( QString str ) {
- QPair<QString, QString> ret;
+QPair<TQString, TQString> splitTemplateParams( TQString str ) {
+ QPair<TQString, TQString> ret;
int p;
if( (p = str.find('<') ) != -1) {
ret.first = str.left( p ).stripWhiteSpace();
@@ -86,7 +86,7 @@ QPair<QString, QString> splitTemplateParams( QString str ) {
return ret;
}
-bool parenFits( QChar c1, QChar c2 ) {
+bool parenFits( TQChar c1, TQChar c2 ) {
if( c1 == '<' && c2 == '>' ) return true;
else if( c1 == '(' && c2 == ')' ) return true;
else if( c1 == '[' && c2 == ']' ) return true;
@@ -95,7 +95,7 @@ bool parenFits( QChar c1, QChar c2 ) {
return false;
}
-bool isParen( QChar c1 ) {
+bool isParen( TQChar c1 ) {
if( c1 == '<' || c1 == '>' ) return true;
else if( c1 == '(' || c1 == ')' ) return true;
else if( c1 == '[' || c1 == ']' ) return true;
@@ -104,25 +104,25 @@ bool isParen( QChar c1 ) {
return false;
}
-bool isTypeParen( QChar c1 ) {
+bool isTypeParen( TQChar c1 ) {
if( c1 == '<' || c1 == '>' ) return true;
else
return false;
}
-bool isTypeOpenParen( QChar c1 ) {
+bool isTypeOpenParen( TQChar c1 ) {
if( c1 == '<' ) return true;
else
return false;
}
-bool isTypeCloseParen( QChar c1 ) {
+bool isTypeCloseParen( TQChar c1 ) {
if( c1 == '>' ) return true;
else
return false;
}
-bool isLeftParen( QChar c1 ) {
+bool isLeftParen( TQChar c1 ) {
if( c1 == '<' ) return true;
else if( c1 == '(' ) return true;
else if( c1 == '[' ) return true;
@@ -131,10 +131,10 @@ bool isLeftParen( QChar c1 ) {
return false;
}
-int findClose( const QString& str , int pos ) {
+int findClose( const TQString& str , int pos ) {
int depth = 0;
- QValueList<QChar> st;
- QChar last = ' ';
+ TQValueList<TQChar> st;
+ TQChar last = ' ';
for( int a = pos; a < (int)str.length(); a++) {
switch(str[a]) {
@@ -176,23 +176,23 @@ int findClose( const QString& str , int pos ) {
return -1;
}
-QString tagType( const Tag& tag )
+TQString tagType( const Tag& tag )
{
if ( tag.hasAttribute( "t" ) )
{
- QString type = tag.attribute( "t" ).toString();
+ TQString type = tag.attribute( "t" ).toString();
return type;
}
else if ( tag.kind() == Tag::Kind_Class || tag.kind() == Tag::Kind_Namespace )
{
- QStringList l = tag.scope();
+ TQStringList l = tag.scope();
l << tag.name();
return l.join("::");
}
- return QString();
+ return TQString();
}
-int findCommaOrEnd( const QString& str , int pos, QChar validEnd) {
+int findCommaOrEnd( const TQString& str , int pos, TQChar validEnd) {
for( int a = pos; a < (int)str.length(); a++) {
switch(str[a]) {
@@ -218,7 +218,7 @@ int findCommaOrEnd( const QString& str , int pos, QChar validEnd) {
return str.length();
}
-int countExtract( QChar c, const QString& str ) {
+int countExtract( TQChar c, const TQString& str ) {
int ret = 0;
for( int a = 0; a < (int)str.length(); a++) {
if( str[a] == c ) ++ret;
@@ -236,7 +236,7 @@ int countExtract( QChar c, const QString& str ) {
return ret;
}
-QString templateParamFromString( int num, QString str ) {
+TQString templateParamFromString( int num, TQString str ) {
if( str.endsWith("::") ) str.truncate( str.length() - 2 );
int begin = str.find('<');
int end = str.findRev('>');
@@ -257,8 +257,8 @@ QString templateParamFromString( int num, QString str ) {
return str.mid( begin, end - begin ).stripWhiteSpace();
}
-QStringList splitType( QString str ) {
- QStringList ret;
+TQStringList splitType( TQString str ) {
+ TQStringList ret;
int currentStart = 0;
bool was = false;
for( int a = 0; a < (int)str.length(); ++a ) {
@@ -287,8 +287,8 @@ QStringList splitType( QString str ) {
return ret;
}
-QString stringMult( int count, QString str ){
- QString ret;
+TQString stringMult( int count, TQString str ){
+ TQString ret;
for( int a = 0; a < count; a++ ) ret += str;
return ret;
}