diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:53:50 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:53:50 +0000 |
commit | 7be55ffa061c026e35e2d6a0effe1161ddb0d41f (patch) | |
tree | 8474f9b444b2756228600050f07a7ff25de532b2 /libksieve/parser | |
parent | f587f20a6d09f1729dd0a8c1cd8ee0110aec7451 (diff) | |
download | tdepim-7be55ffa061c026e35e2d6a0effe1161ddb0d41f.tar.gz tdepim-7be55ffa061c026e35e2d6a0effe1161ddb0d41f.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1157655 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'libksieve/parser')
-rw-r--r-- | libksieve/parser/lexer.cpp | 52 | ||||
-rw-r--r-- | libksieve/parser/parser.cpp | 8 | ||||
-rw-r--r-- | libksieve/parser/utf8validator.cpp | 4 |
3 files changed, 32 insertions, 32 deletions
diff --git a/libksieve/parser/lexer.cpp b/libksieve/parser/lexer.cpp index d8b76da71..c0b7cb8b3 100644 --- a/libksieve/parser/lexer.cpp +++ b/libksieve/parser/lexer.cpp @@ -38,9 +38,9 @@ #include <impl/utf8validator.h> #include <ksieve/error.h> -#include <qstring.h> -#include <qstringlist.h> -#include <qtextcodec.h> +#include <tqstring.h> +#include <tqstringlist.h> +#include <tqtextcodec.h> #include <memory> // std::auto_ptr @@ -105,7 +105,7 @@ namespace KSieve { i->restore(); } - Lexer::Token Lexer::nextToken( QString & result ) { + Lexer::Token Lexer::nextToken( TQString & result ) { assert( i ); return i->nextToken( result ); } @@ -159,7 +159,7 @@ static inline bool is8Bit( signed char ch ) { return ch < 0; } -static QString removeCRLF( const QString & s ) { +static TQString removeCRLF( const TQString & s ) { const bool CRLF = s.endsWith( "\r\n" ); const bool LF = !CRLF && s.endsWith( "\n" ); @@ -168,7 +168,7 @@ static QString removeCRLF( const QString & s ) { return s.left( s.length() - e ); } -static QString removeDotStuff( const QString & s ) { +static TQString removeDotStuff( const TQString & s ) { return s.startsWith( ".." ) ? s.mid( 1 ) : s ; } @@ -190,9 +190,9 @@ namespace KSieve { assert( atEnd() ); } - Lexer::Token Lexer::Impl::nextToken( QString & result ) { + Lexer::Token Lexer::Impl::nextToken( TQString & result ) { assert( !atEnd() ); - result = QString::null; + result = TQString::null; //clearErrors(); const int oldLine = line(); @@ -332,7 +332,7 @@ namespace KSieve { } - bool Lexer::Impl::parseHashComment( QString & result, bool reallySave ) { + bool Lexer::Impl::parseHashComment( TQString & result, bool reallySave ) { // hash-comment := "#" *CHAR-NOT-CRLF CRLF // check that the caller plays by the rules: @@ -358,7 +358,7 @@ namespace KSieve { return false; } if ( reallySave ) - result += QString::fromUtf8( commentStart, commentLength ); + result += TQString::fromUtf8( commentStart, commentLength ); } return true; } @@ -366,7 +366,7 @@ namespace KSieve { return false; } - bool Lexer::Impl::parseBracketComment( QString & result, bool reallySave ) { + bool Lexer::Impl::parseBracketComment( TQString & result, bool reallySave ) { // bracket-comment := "/*" *(CHAR-NOT-STAR / ("*" CHAR-NOT-SLASH )) "*/" // check that caller plays by the rules: @@ -400,7 +400,7 @@ namespace KSieve { return false; } if ( reallySave ) { - QString tmp = QString::fromUtf8( commentStart, commentLength ); + TQString tmp = TQString::fromUtf8( commentStart, commentLength ); result += tmp.remove( '\r' ); // get rid of CR in CRLF pairs } } @@ -409,7 +409,7 @@ namespace KSieve { return true; } - bool Lexer::Impl::parseComment( QString & result, bool reallySave ) { + bool Lexer::Impl::parseComment( TQString & result, bool reallySave ) { // comment := hash-comment / bracket-comment switch( *mState.cursor ) { @@ -446,7 +446,7 @@ namespace KSieve { case '#': case '/': // comments { - QString dummy; + TQString dummy; if ( !parseComment( dummy ) ) return false; } @@ -458,7 +458,7 @@ namespace KSieve { return true; } - bool Lexer::Impl::parseIdentifier( QString & result ) { + bool Lexer::Impl::parseIdentifier( TQString & result ) { // identifier := (ALPHA / "_") *(ALPHA DIGIT "_") assert( isIText( *mState.cursor ) ); @@ -478,7 +478,7 @@ namespace KSieve { // Can use the fast fromLatin1 here, since identifiers are always // in the us-ascii subset: - result += QString::fromLatin1( identifierStart, identifierLength ); + result += TQString::fromLatin1( identifierStart, identifierLength ); if ( atEnd() || isDelim( *mState.cursor ) ) return true; @@ -487,7 +487,7 @@ namespace KSieve { return false; } - bool Lexer::Impl::parseTag( QString & result ) { + bool Lexer::Impl::parseTag( TQString & result ) { // tag := ":" identifier // check that the caller plays by the rules: @@ -498,7 +498,7 @@ namespace KSieve { return parseIdentifier( result ); } - bool Lexer::Impl::parseNumber( QString & result ) { + bool Lexer::Impl::parseNumber( TQString & result ) { // number := 1*DIGIT [QUANTIFIER] // QUANTIFIER := "K" / "M" / "G" @@ -531,7 +531,7 @@ namespace KSieve { return false; } - bool Lexer::Impl::parseMultiLine( QString & result ) { + bool Lexer::Impl::parseMultiLine( TQString & result ) { // multi-line := "text:" *(SP / HTAB) (hash-comment / CRLF) // *(multi-line-literal / multi-line-dotstuff) // "." CRLF @@ -554,7 +554,7 @@ namespace KSieve { case '#': { ++mState.cursor; - QString dummy; + TQString dummy; if ( !parseHashComment( dummy ) ) return false; goto MultiLineStart; // break from switch _and_ while @@ -576,7 +576,7 @@ namespace KSieve { } // Now, collect the single lines until one with only a single dot is found: - QStringList lines; + TQStringList lines; while ( !atEnd() ) { const char * const oldBeginOfLine = beginOfLine(); if ( !skipToCRLF() ) @@ -587,12 +587,12 @@ namespace KSieve { makeError( Error::InvalidUTF8 ); return false; } - const QString line = removeCRLF( QString::fromUtf8( oldBeginOfLine, lineLength ) ); + const TQString line = removeCRLF( TQString::fromUtf8( oldBeginOfLine, lineLength ) ); lines.push_back( removeDotStuff( line ) ); if ( line == "." ) break; } else { - lines.push_back( QString::null ); + lines.push_back( TQString::null ); } } @@ -607,7 +607,7 @@ namespace KSieve { return true; } - bool Lexer::Impl::parseQuotedString( QString & result ) { + bool Lexer::Impl::parseQuotedString( TQString & result ) { // quoted-string := DQUOTE *CHAR DQUOTE // check that caller plays by the rules: @@ -616,9 +616,9 @@ namespace KSieve { const int qsBeginCol = column() - 1; const int qsBeginLine = line(); - const QTextCodec * const codec = QTextCodec::codecForMib( 106 ); // UTF-8 + const TQTextCodec * const codec = TQTextCodec::codecForMib( 106 ); // UTF-8 assert( codec ); - const std::auto_ptr<QTextDecoder> dec( codec->makeDecoder() ); + const std::auto_ptr<TQTextDecoder> dec( codec->makeDecoder() ); assert( dec.get() ); while ( !atEnd() ) diff --git a/libksieve/parser/parser.cpp b/libksieve/parser/parser.cpp index 8c2db050e..0a136e71c 100644 --- a/libksieve/parser/parser.cpp +++ b/libksieve/parser/parser.cpp @@ -37,7 +37,7 @@ #include <ksieve/error.h> -#include <qstring.h> +#include <tqstring.h> #include <assert.h> #include <limits.h> // ULONG_MAX @@ -332,7 +332,7 @@ namespace KSieve { return true; } else if ( isStringToken() ) { if ( scriptBuilder() ) - scriptBuilder()->stringArgument( tokenValue(), token() == Lexer::MultiLineString, QString::null ); + scriptBuilder()->stringArgument( tokenValue(), token() == Lexer::MultiLineString, TQString::null ); consumeToken(); return true; } else if ( token() == Lexer::Special && tokenValue() == "[" ) { @@ -590,7 +590,7 @@ namespace KSieve { } lastWasComma = false; if ( scriptBuilder() ) - scriptBuilder()->stringListEntry( tokenValue(), token() == Lexer::MultiLineString, QString::null ); + scriptBuilder()->stringListEntry( tokenValue(), token() == Lexer::MultiLineString, TQString::null ); consumeToken(); break; @@ -618,7 +618,7 @@ namespace KSieve { // number: unsigned long result = 0; unsigned int i = 0; - const QCString s = tokenValue().latin1(); + const TQCString s = tokenValue().latin1(); for ( const unsigned int len = s.length() ; i < len && isdigit( s[i] ) ; ++i ) { const unsigned long digitValue = s[i] - '0' ; if ( willOverflowULong( result, digitValue ) ) { diff --git a/libksieve/parser/utf8validator.cpp b/libksieve/parser/utf8validator.cpp index 248a1f5e9..ac94281e6 100644 --- a/libksieve/parser/utf8validator.cpp +++ b/libksieve/parser/utf8validator.cpp @@ -32,8 +32,8 @@ #include <impl/utf8validator.h> -#include <qglobal.h> -#include <qcstring.h> +#include <tqglobal.h> +#include <tqcstring.h> static inline bool is8Bit( signed char ch ) { return ch < 0; |