diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:48:06 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:48:06 +0000 |
commit | 47c8a359c5276062c4bc17f0e82410f29081b502 (patch) | |
tree | 2d54a5f60a5b74067632f9ef6df58c2bc38155e6 /kopete/protocols/oscar/liboscar/buffer.cpp | |
parent | 6f82532777a35e0e60bbd2b290b2e93e646f349b (diff) | |
download | tdenetwork-47c8a359c5276062c4bc17f0e82410f29081b502.tar.gz tdenetwork-47c8a359c5276062c4bc17f0e82410f29081b502.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdenetwork@1157648 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kopete/protocols/oscar/liboscar/buffer.cpp')
-rw-r--r-- | kopete/protocols/oscar/liboscar/buffer.cpp | 74 |
1 files changed, 37 insertions, 37 deletions
diff --git a/kopete/protocols/oscar/liboscar/buffer.cpp b/kopete/protocols/oscar/liboscar/buffer.cpp index b04587e7..23dca1bb 100644 --- a/kopete/protocols/oscar/liboscar/buffer.cpp +++ b/kopete/protocols/oscar/liboscar/buffer.cpp @@ -40,7 +40,7 @@ Buffer::Buffer(const char *b, Q_ULONG len) mReadPos=0; } -Buffer::Buffer( const QByteArray& data ) +Buffer::Buffer( const TQByteArray& data ) { mBuffer.duplicate( data ); mReadPos = 0; @@ -110,7 +110,7 @@ int Buffer::addLEDWord(const DWORD dw) return mBuffer.size(); } -int Buffer::addString(QByteArray s) +int Buffer::addString(TQByteArray s) { unsigned int pos = mBuffer.size(); int len = s.size(); @@ -122,7 +122,7 @@ int Buffer::addString(QByteArray s) return mBuffer.size(); } -int Buffer::addString(QByteArray s, DWORD len) +int Buffer::addString(TQByteArray s, DWORD len) { Q_UNUSED( len ); return addString( s ); @@ -130,14 +130,14 @@ int Buffer::addString(QByteArray s, DWORD len) int Buffer::addString( const char* s, DWORD len ) { - QByteArray qba; + TQByteArray qba; qba.duplicate( s, len ); return addString( qba ); } int Buffer::addString(const unsigned char* s, DWORD len) { - QByteArray qba; + TQByteArray qba; qba.duplicate( (const char*) s, len ); return addString( qba ); } @@ -253,9 +253,9 @@ void Buffer::setBuf(char *b, const WORD len) mReadPos = 0; } -QByteArray Buffer::getBlock(WORD len) +TQByteArray Buffer::getBlock(WORD len) { - QByteArray ch( len ); + TQByteArray ch( len ); for ( int i = 0; i < len; i++ ) { ch[i] = getByte(); @@ -264,9 +264,9 @@ QByteArray Buffer::getBlock(WORD len) return ch; } -QByteArray Buffer::getBBlock(WORD len) +TQByteArray Buffer::getBBlock(WORD len) { - QByteArray data; + TQByteArray data; data.duplicate(mBuffer.data() + mReadPos, len); mReadPos += len; return data; @@ -286,9 +286,9 @@ WORD *Buffer::getWordBlock(WORD len) } -QCString Buffer::getLEBlock(WORD len) +TQCString Buffer::getLEBlock(WORD len) { - QCString ch; + TQCString ch; for (unsigned int i=0;i<len;i++) ch += getLEByte(); @@ -340,9 +340,9 @@ TLV Buffer::getTLV() return t; } -QValueList<TLV> Buffer::getTLVList() +TQValueList<TLV> Buffer::getTLVList() { - QValueList<TLV> ql; + TQValueList<TLV> ql; while (mReadPos < mBuffer.size()) { @@ -363,7 +363,7 @@ QValueList<TLV> Buffer::getTLVList() } int Buffer::addChatTLV(const WORD type, const WORD exchange, - const QString &roomname, const WORD instance) + const TQString &roomname, const WORD instance) { addWord(type); addWord(0x0005 + roomname.length()); @@ -376,21 +376,21 @@ int Buffer::addChatTLV(const WORD type, const WORD exchange, void Buffer::expandBuffer(unsigned int inc) { - mBuffer.resize(mBuffer.size()+inc, QGArray::SpeedOptim); + mBuffer.resize(mBuffer.size()+inc, TQGArray::SpeedOptim); } -QCString Buffer::getLNTS() +TQCString Buffer::getLNTS() { WORD len = getLEWord(); - QCString qcs; + TQCString qcs; qcs.duplicate( getBlock(len) ); return qcs; } -QCString Buffer::getLELNTS() +TQCString Buffer::getLELNTS() { WORD len = getLEWord(); - QCString qcs; + TQCString qcs; qcs.duplicate( getBlock(len) ); return qcs; } @@ -425,10 +425,10 @@ int Buffer::addBSTR(const char * s) return ret; } -QByteArray Buffer::getBSTR() +TQByteArray Buffer::getBSTR() { WORD len = getWord(); - QByteArray qba; + TQByteArray qba; qba.duplicate( getBlock(len) ); return qba; } @@ -441,10 +441,10 @@ int Buffer::addBUIN(const char * s) return ret; } -QByteArray Buffer::getBUIN() +TQByteArray Buffer::getBUIN() { BYTE len = getByte(); - QByteArray qba; + TQByteArray qba; qba.duplicate( getBlock(len) ); return qba; } @@ -459,16 +459,16 @@ int Buffer::length() const return (mBuffer.size() - mReadPos); } -QString Buffer::toString() const +TQString Buffer::toString() const { // line format: //00 03 00 0b 00 00 90 b8 f5 9f 09 31 31 33 37 38 |;tJ�..........| int i = 0; - QString output = "\n"; - QString hex, ascii; + TQString output = "\n"; + TQString hex, ascii; - QByteArray::ConstIterator it; + TQByteArray::ConstIterator it; for ( it = mBuffer.begin(); it != mBuffer.end(); ++it ) { i++; @@ -477,7 +477,7 @@ QString Buffer::toString() const if ( c < 0x10 ) hex.append("0"); - hex.append(QString("%1 ").arg(c, 0, 16)); + hex.append(TQString("%1 ").arg(c, 0, 16)); ascii.append(isprint(c) ? c : '.'); @@ -485,8 +485,8 @@ QString Buffer::toString() const { output += hex + " |" + ascii + "|\n"; i=0; - hex=QString::null; - ascii=QString::null; + hex=TQString::null; + ascii=TQString::null; } } @@ -497,22 +497,22 @@ QString Buffer::toString() const return output; } -QString Buffer::peekBSTR() +TQString Buffer::peekBSTR() { int lastPos = mReadPos; - QByteArray qba = getBSTR(); + TQByteArray qba = getBSTR(); mReadPos = lastPos; - return QString( qba ); + return TQString( qba ); } -QString Buffer::peekBUIN() +TQString Buffer::peekBUIN() { int lastPos = mReadPos; - QByteArray qba = getBUIN(); + TQByteArray qba = getBUIN(); mReadPos = lastPos; - return QString( qba ); + return TQString( qba ); } -Buffer::operator QByteArray() const +Buffer::operator TQByteArray() const { return mBuffer; } |