summaryrefslogtreecommitdiffstats
path: root/src/asmformatter.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-29 16:05:55 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-29 16:05:55 +0000
commit87a016680e3677da3993f333561e79eb0cead7d5 (patch)
treecbda2b4df8b8ee0d8d1617e6c75bec1e3ee0ccba /src/asmformatter.cpp
parent6ce3d1ad09c1096b5ed3db334e02859e45d5c32b (diff)
downloadktechlab-87a016680e3677da3993f333561e79eb0cead7d5.tar.gz
ktechlab-87a016680e3677da3993f333561e79eb0cead7d5.zip
TQt4 port ktechlab
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/ktechlab@1238801 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/asmformatter.cpp')
-rw-r--r--src/asmformatter.cpp54
1 files changed, 27 insertions, 27 deletions
diff --git a/src/asmformatter.cpp b/src/asmformatter.cpp
index fb77789..2dc1c79 100644
--- a/src/asmformatter.cpp
+++ b/src/asmformatter.cpp
@@ -14,9 +14,9 @@
#include "picinfo14bit.h"
#include "picinfo16bit.h"
-static QString extractComment( const QString & line )
+static TQString extractComment( const TQString & line )
{
- int pos = line.find( ';' );
+ int pos = line.tqfind( ';' );
if ( pos == -1 )
return "";
@@ -36,7 +36,7 @@ AsmFormatter::~AsmFormatter()
}
-QString AsmFormatter::tidyAsm( QStringList lines )
+TQString AsmFormatter::tidyAsm( TQStringList lines )
{
// Update our indentation values from config
m_indentAsmName = KTLConfig::indentAsmName();
@@ -45,8 +45,8 @@ QString AsmFormatter::tidyAsm( QStringList lines )
m_indentEquValue = KTLConfig::indentEquValue();
m_indentComment = m_indentEquComment = KTLConfig::indentComment();
- QStringList::iterator end = lines.end();
- for ( QStringList::iterator slit = lines.begin(); slit != end; ++slit )
+ TQStringList::iterator end = lines.end();
+ for ( TQStringList::iterator slit = lines.begin(); slit != end; ++slit )
{
switch ( lineType(*slit) )
{
@@ -63,31 +63,31 @@ QString AsmFormatter::tidyAsm( QStringList lines )
}
}
- QString code;
+ TQString code;
- for ( QStringList::iterator slit = lines.begin(); slit != end; ++slit )
+ for ( TQStringList::iterator slit = lines.begin(); slit != end; ++slit )
code.append( *slit + '\n' );
return code;
}
-void AsmFormatter::pad( QString & text, int length )
+void AsmFormatter::pad( TQString & text, int length )
{
int padLength = length - text.length();
if ( padLength <= 0 )
return;
- QString pad;
+ TQString pad;
pad.fill( ' ', padLength );
text += pad;
}
-QString AsmFormatter::tidyInstruction( const QString & oldLine )
+TQString AsmFormatter::tidyInstruction( const TQString & oldLine )
{
InstructionParts parts( oldLine );
- QString line;
+ TQString line;
if ( !parts.label().isEmpty() )
line = parts.label() + ' ';
@@ -114,16 +114,16 @@ QString AsmFormatter::tidyInstruction( const QString & oldLine )
}
-QString AsmFormatter::tidyEqu( const QString & oldLine )
+TQString AsmFormatter::tidyEqu( const TQString & oldLine )
{
- QString comment = extractComment( oldLine );
- QString code = oldLine;
+ TQString comment = extractComment( oldLine );
+ TQString code = oldLine;
code.remove( comment );
code = code.simplifyWhiteSpace();
- QStringList parts = QStringList::split( ' ', code );
+ TQStringList parts = TQStringList::split( ' ', code );
- QString pad0, pad1, pad2;
+ TQString pad0, pad1, pad2;
pad0.fill( ' ', m_indentEqu - (*parts.at(0)).length() );
pad1.fill( ' ', m_indentEquValue - m_indentEqu - (*parts.at(1)).length() );
pad2.fill( ' ', m_indentEquComment - m_indentEquValue - m_indentEqu - (*parts.at(2)).length() );
@@ -141,15 +141,15 @@ QString AsmFormatter::tidyEqu( const QString & oldLine )
}
-AsmFormatter::LineType AsmFormatter::lineType( QString line )
+AsmFormatter::LineType AsmFormatter::lineType( TQString line )
{
line = line.simplifyWhiteSpace();
line.remove( extractComment( line ) );
- QStringList parts = QStringList::split( ' ', line );
- QStringList::iterator end = parts.end();
- for ( QStringList::iterator it = parts.begin(); it != end; ++it )
+ TQStringList parts = TQStringList::split( ' ', line );
+ TQStringList::iterator end = parts.end();
+ for ( TQStringList::iterator it = parts.begin(); it != end; ++it )
{
if ( (*it).lower() == "equ" )
return Equ;
@@ -166,17 +166,17 @@ AsmFormatter::LineType AsmFormatter::lineType( QString line )
//BEGIN class InstructionParts
-InstructionParts::InstructionParts( QString line )
+InstructionParts::InstructionParts( TQString line )
{
m_comment = extractComment( line );
line.remove( m_comment );
line = line.simplifyWhiteSpace();
- QStringList parts = QStringList::split( ' ', line );
+ TQStringList parts = TQStringList::split( ' ', line );
bool foundOperand = false;
- QStringList::iterator end = parts.end();
- for ( QStringList::iterator it = parts.begin(); it != end; ++it )
+ TQStringList::iterator end = parts.end();
+ for ( TQStringList::iterator it = parts.begin(); it != end; ++it )
{
if ( foundOperand )
{
@@ -191,9 +191,9 @@ InstructionParts::InstructionParts( QString line )
continue;
}
- if ( PicAsm12bit::self()->operandList().contains( (*it).upper() )
- || PicAsm14bit::self()->operandList().contains( (*it).upper() )
- || PicAsm16bit::self()->operandList().contains( (*it).upper() ) )
+ if ( PicAsm12bit::self()->operandList().tqcontains( (*it).upper() )
+ || PicAsm14bit::self()->operandList().tqcontains( (*it).upper() )
+ || PicAsm16bit::self()->operandList().tqcontains( (*it).upper() ) )
{
m_operand = *it;
foundOperand = true;