summaryrefslogtreecommitdiffstats
path: root/khexedit/lib/codecs
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-23 01:42:07 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-23 01:42:07 +0000
commita2277b6bc715464e83882b90c2a058139b8a6b54 (patch)
treeab09b14014f59b4d8e2ddd12226aa0b22e4dfc5d /khexedit/lib/codecs
parentd3f79e04b34bd1f70a458b81b28fc8799498c8dc (diff)
downloadtdeutils-a2277b6bc715464e83882b90c2a058139b8a6b54.tar.gz
tdeutils-a2277b6bc715464e83882b90c2a058139b8a6b54.zip
TQt4 port kdeutils
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeutils@1238125 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'khexedit/lib/codecs')
-rw-r--r--khexedit/lib/codecs/kbinarybytecodec.cpp4
-rw-r--r--khexedit/lib/codecs/kbytecodec.cpp4
-rw-r--r--khexedit/lib/codecs/kcharcodec.cpp2
-rw-r--r--khexedit/lib/codecs/kdecimalbytecodec.cpp12
-rw-r--r--khexedit/lib/codecs/kebcdic1047charcodec.cpp6
-rw-r--r--khexedit/lib/codecs/khexadecimalbytecodec.cpp8
-rw-r--r--khexedit/lib/codecs/koctalbytecodec.cpp12
-rw-r--r--khexedit/lib/codecs/ktextcharcodec.cpp14
-rw-r--r--khexedit/lib/codecs/ktextcharcodec.h4
9 files changed, 33 insertions, 33 deletions
diff --git a/khexedit/lib/codecs/kbinarybytecodec.cpp b/khexedit/lib/codecs/kbinarybytecodec.cpp
index a49a460..fc9fe8d 100644
--- a/khexedit/lib/codecs/kbinarybytecodec.cpp
+++ b/khexedit/lib/codecs/kbinarybytecodec.cpp
@@ -24,7 +24,7 @@ using namespace KHE;
void KBinaryByteCodec::encode( TQString &Digits, unsigned int Pos, const unsigned char Char ) const
{
for( unsigned char M=1<<7; M>0; M>>=1 )
- Digits.at(Pos++) = (Char & M) ? '1' : '0';
+ Digits.tqat(Pos++) = (Char & M) ? '1' : '0';
}
void KBinaryByteCodec::encodeShort( TQString &Digits, unsigned int Pos, unsigned char Char ) const
@@ -36,7 +36,7 @@ void KBinaryByteCodec::encodeShort( TQString &Digits, unsigned int Pos, unsigned
break;
// now set the
for( ; M>0; M>>=1 )
- Digits.at(Pos++) = (Char & M) ? '1' : '0';
+ Digits.tqat(Pos++) = (Char & M) ? '1' : '0';
}
diff --git a/khexedit/lib/codecs/kbytecodec.cpp b/khexedit/lib/codecs/kbytecodec.cpp
index f4847ba..900055e 100644
--- a/khexedit/lib/codecs/kbytecodec.cpp
+++ b/khexedit/lib/codecs/kbytecodec.cpp
@@ -40,7 +40,7 @@ KByteCodec *KByteCodec::createCodec( KCoding C )
unsigned int KByteCodec::decode( unsigned char *Char, const TQString &Digits, uint Pos ) const
{
- //kdDebug() << TQString("KByteCodec::decode(%1,%2)").arg(Digits).arg(Pos) << endl;
+ //kdDebug() << TQString("KByteCodec::decode(%1,%2)").tqarg(Digits).tqarg(Pos) << endl;
const uint P = Pos;
// remove leading 0s
@@ -50,7 +50,7 @@ unsigned int KByteCodec::decode( unsigned char *Char, const TQString &Digits, ui
unsigned int d = encodingWidth();
do
{
- if( !appendDigit(&C,Digits.at(Pos)) )
+ if( !appendDigit(&C,Digits.tqat(Pos)) )
break;
++Pos;
diff --git a/khexedit/lib/codecs/kcharcodec.cpp b/khexedit/lib/codecs/kcharcodec.cpp
index 1aab79b..dea28c1 100644
--- a/khexedit/lib/codecs/kcharcodec.cpp
+++ b/khexedit/lib/codecs/kcharcodec.cpp
@@ -42,7 +42,7 @@ KCharCodec *KCharCodec::createCodec( const TQString &Name )
{
KCharCodec *Codec = 0;
- if( KTextCharCodec::codecNames().findIndex(Name) != -1 )
+ if( KTextCharCodec::codecNames().tqfindIndex(Name) != -1 )
Codec = KTextCharCodec::createCodec( Name );
else if( KEBCDIC1047CharCodec::codecName() == Name )
Codec = KEBCDIC1047CharCodec::create();
diff --git a/khexedit/lib/codecs/kdecimalbytecodec.cpp b/khexedit/lib/codecs/kdecimalbytecodec.cpp
index c556875..065eb81 100644
--- a/khexedit/lib/codecs/kdecimalbytecodec.cpp
+++ b/khexedit/lib/codecs/kdecimalbytecodec.cpp
@@ -24,12 +24,12 @@ using namespace KHE;
void KDecimalByteCodec::encode( TQString &Digits, unsigned int Pos, unsigned char Char ) const
{
unsigned char C = Char / 100;
- Digits.at(Pos++) = '0'+C;
+ Digits.tqat(Pos++) = '0'+C;
Char -= C * 100;
C = Char / 10;
- Digits.at(Pos++) = '0'+C;
+ Digits.tqat(Pos++) = '0'+C;
Char -= C * 10;
- Digits.at(Pos) = '0'+Char;
+ Digits.tqat(Pos) = '0'+Char;
}
@@ -38,15 +38,15 @@ void KDecimalByteCodec::encodeShort( TQString &Digits, unsigned int Pos, unsigne
unsigned char C;
if( (C = Char / 100) )
{
- Digits.at(Pos++) = '0'+C;
+ Digits.tqat(Pos++) = '0'+C;
Char -= C * 100;
}
if( (C = Char / 10) )
{
- Digits.at(Pos++) = '0'+C;
+ Digits.tqat(Pos++) = '0'+C;
Char -= C * 10;
}
- Digits.at(Pos) = '0'+Char;
+ Digits.tqat(Pos) = '0'+Char;
}
diff --git a/khexedit/lib/codecs/kebcdic1047charcodec.cpp b/khexedit/lib/codecs/kebcdic1047charcodec.cpp
index d1002c3..2e91035 100644
--- a/khexedit/lib/codecs/kebcdic1047charcodec.cpp
+++ b/khexedit/lib/codecs/kebcdic1047charcodec.cpp
@@ -21,7 +21,7 @@
using namespace KHE;
-static Q_UINT16 UnicodeChars[256] =
+static TQ_UINT16 UnicodeChars[256] =
{
0x0000, 0x0001, 0x0002, 0x0003, 0x009C, 0x0009, 0x0086, 0x007F,
0x0097, 0x008D, 0x008E, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F,
@@ -98,7 +98,7 @@ static const char KEBCDIC1047CharCodecName[] = "EBCDIC 1047";
bool KEBCDIC1047CharCodec::encode( char *D, const TQChar &C ) const
{
- int I = C.unicode();
+ int I = C.tqunicode();
// not in range?
if( 0x00FF < I )
return false;
@@ -119,6 +119,6 @@ const TQString& KEBCDIC1047CharCodec::name() const
const TQString& KEBCDIC1047CharCodec::codecName()
{
- static const TQString Name( TQString::fromLatin1(KEBCDIC1047CharCodecName) );
+ static const TQString Name( TQString::tqfromLatin1(KEBCDIC1047CharCodecName) );
return Name;
}
diff --git a/khexedit/lib/codecs/khexadecimalbytecodec.cpp b/khexedit/lib/codecs/khexadecimalbytecodec.cpp
index 596fd24..46abdad 100644
--- a/khexedit/lib/codecs/khexadecimalbytecodec.cpp
+++ b/khexedit/lib/codecs/khexadecimalbytecodec.cpp
@@ -41,16 +41,16 @@ bool KHexadecimalByteCodec::smallDigits() const { return Digit != BigDigit; }
void KHexadecimalByteCodec::encode( TQString &Digits, unsigned int Pos, unsigned char Char ) const
{
- Digits.at(Pos++) = Digit[Char>>4];
- Digits.at(Pos) = Digit[Char&0x0F];
+ Digits.tqat(Pos++) = Digit[Char>>4];
+ Digits.tqat(Pos) = Digit[Char&0x0F];
}
void KHexadecimalByteCodec::encodeShort( TQString &Digits, unsigned int Pos, unsigned char Char ) const
{
unsigned char C;
if( (C = (Char>>4)) )
- Digits.at(Pos++) = Digit[C];
- Digits.at(Pos) = Digit[Char&0x0F];
+ Digits.tqat(Pos++) = Digit[C];
+ Digits.tqat(Pos) = Digit[Char&0x0F];
}
diff --git a/khexedit/lib/codecs/koctalbytecodec.cpp b/khexedit/lib/codecs/koctalbytecodec.cpp
index 44c7952..7aa156d 100644
--- a/khexedit/lib/codecs/koctalbytecodec.cpp
+++ b/khexedit/lib/codecs/koctalbytecodec.cpp
@@ -23,9 +23,9 @@ using namespace KHE;
void KOctalByteCodec::encode( TQString &Digits, unsigned int Pos, unsigned char Char ) const
{
- Digits.at(Pos++) = '0'+(Char>>6);
- Digits.at(Pos++) = '0'+((Char>>3)&0x07);
- Digits.at(Pos) = '0'+((Char) &0x07);
+ Digits.tqat(Pos++) = '0'+(Char>>6);
+ Digits.tqat(Pos++) = '0'+((Char>>3)&0x07);
+ Digits.tqat(Pos) = '0'+((Char) &0x07);
}
@@ -33,10 +33,10 @@ void KOctalByteCodec::encodeShort( TQString &Digits, unsigned int Pos, unsigned
{
unsigned char C;
if( (C = (Char>>6)&0x07) )
- Digits.at(Pos++) = '0'+C;
+ Digits.tqat(Pos++) = '0'+C;
if( (C = (Char>>3)&0x07) )
- Digits.at(Pos++) = '0'+C;
- Digits.at(Pos) = '0'+((Char)&0x07);
+ Digits.tqat(Pos++) = '0'+C;
+ Digits.tqat(Pos) = '0'+((Char)&0x07);
}
diff --git a/khexedit/lib/codecs/ktextcharcodec.cpp b/khexedit/lib/codecs/ktextcharcodec.cpp
index a9014dd..f5bcc65 100644
--- a/khexedit/lib/codecs/ktextcharcodec.cpp
+++ b/khexedit/lib/codecs/ktextcharcodec.cpp
@@ -27,7 +27,7 @@
using namespace KHE;
-static const char QTextCodecWhiteSpace = 63;
+static const char TQTextCodecWhiteSpace = 63;
static struct KEncodingNames {
KEncoding Encoding;
@@ -106,7 +106,7 @@ static bool is8Bit( TQTextCodec *Codec )
Length = 1;
CS = Codec->fromUnicode( S, Length );
//kdDebug() << Codec->name() << " "<<c[0]<<"->"<<CS[0]<<":"<<Length << endl;
- if( Length != 1 || (CS[0] != (char)c[0] && CS[0] != QTextCodecWhiteSpace) )
+ if( Length != 1 || (CS[0] != (char)c[0] && CS[0] != TQTextCodecWhiteSpace) )
{
Result = false;
break;
@@ -127,7 +127,7 @@ const TQStringList &KTextCharCodec::codecNames()
bool Found = true;
TQTextCodec* Codec = KGlobal::charsets()->codecForName( *it, Found );
if( Found && is8Bit(Codec) )
- CodecNames.append( TQString::fromLatin1(Codec->name()) );
+ CodecNames.append( TQString::tqfromLatin1(Codec->name()) );
}
}
@@ -150,7 +150,7 @@ TQString KTextCharCodec::nameOfEncoding( KEncoding C )
if( N != 0 )
{
- TQString CodeName = TQString::fromLatin1( N );
+ TQString CodeName = TQString::tqfromLatin1( N );
}
return Codec;
}
@@ -186,10 +186,10 @@ const TQStringList &KTextCharCodec::codecNames()
for( unsigned int i=0; i<NoOfEncodings; ++i )
{
bool Found = true;
- TQString Name = TQString::fromLatin1( EncodingNames[i].Name );
+ TQString Name = TQString::tqfromLatin1( EncodingNames[i].Name );
TQTextCodec* Codec = KGlobal::charsets()->codecForName( Name, Found );
if( Found )
- CodecNames.append( TQString::fromLatin1(Codec->name()) );
+ CodecNames.append( TQString::tqfromLatin1(Codec->name()) );
}
}
@@ -231,6 +231,6 @@ KHEChar KTextCharCodec::decode( char Byte ) const
const TQString& KTextCharCodec::name() const
{
if( Name.isNull() )
- Name = TQString::fromLatin1( Codec->name() );
+ Name = TQString::tqfromLatin1( Codec->name() );
return Name;
}
diff --git a/khexedit/lib/codecs/ktextcharcodec.h b/khexedit/lib/codecs/ktextcharcodec.h
index 8d834ea..05a40ab 100644
--- a/khexedit/lib/codecs/ktextcharcodec.h
+++ b/khexedit/lib/codecs/ktextcharcodec.h
@@ -51,9 +51,9 @@ class KTextCharCodec : public KCharCodec
protected:
TQTextCodec *Codec;
- /** decodes the chars to unicode */
+ /** decodes the chars to tqunicode */
TQTextDecoder *Decoder;
- /** encodes the chars from unicode */
+ /** encodes the chars from tqunicode */
TQTextEncoder *Encoder;
/** */
mutable TQString Name;