summaryrefslogtreecommitdiffstats
path: root/libtdepim/qutf7codec.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libtdepim/qutf7codec.cpp')
-rw-r--r--libtdepim/qutf7codec.cpp50
1 files changed, 25 insertions, 25 deletions
diff --git a/libtdepim/qutf7codec.cpp b/libtdepim/qutf7codec.cpp
index 78d709df..8624f2a1 100644
--- a/libtdepim/qutf7codec.cpp
+++ b/libtdepim/qutf7codec.cpp
@@ -48,11 +48,11 @@ const char* TQUtf7Codec::mimeName() const {
}
bool TQUtf7Codec::canEncode( TQChar ) const {
- return TRUE;
+ return true;
}
bool TQUtf7Codec::canEncode( const TQString & ) const {
- return TRUE;
+ return true;
}
static uchar base64Set[] = {
@@ -91,9 +91,9 @@ int TQUtf7Codec::heuristicContentMatch(const char* chars, int len) const
{
int stepNo = 0;
int i;
- bool shifted = FALSE;
- bool rightAfterEscape = FALSE;
- bool onlyNullBitsSinceLastBoundary = TRUE;
+ bool shifted = false;
+ bool rightAfterEscape = false;
+ bool onlyNullBitsSinceLastBoundary = true;
for ( i = 0; i < len ; i++ ) {
if ((unsigned char)chars[i] >= 128) // 8bit chars not allowed.
break;
@@ -101,7 +101,7 @@ int TQUtf7Codec::heuristicContentMatch(const char* chars, int len) const
if ( isOfSet(chars[i],base64Set) ) {
switch (stepNo) {
case 0:
- onlyNullBitsSinceLastBoundary = TRUE;
+ onlyNullBitsSinceLastBoundary = true;
break;
case 3:
onlyNullBitsSinceLastBoundary
@@ -117,19 +117,19 @@ int TQUtf7Codec::heuristicContentMatch(const char* chars, int len) const
= onlyNullBitsSinceLastBoundary && (chars[i] == 'A');
}
stepNo = (stepNo + 1) % 8;
- rightAfterEscape = FALSE;
+ rightAfterEscape = false;
} else {
if (rightAfterEscape && chars[i] != '-')
break; // a '+' must be followed by '-' or a base64 char
if (!onlyNullBitsSinceLastBoundary)
break; // non-zero bits in the tail of the base64 encoding
- shifted = FALSE;
+ shifted = false;
stepNo = 0;
}
} else {
if (chars[i] == '+') {
- shifted = TRUE;
- rightAfterEscape = TRUE;
+ shifted = true;
+ rightAfterEscape = true;
}
}
}
@@ -156,7 +156,7 @@ class TQUtf7Decoder : public TQTextDecoder {
// of a shifted-sequence.
bool rightAfterEscape;
public:
- TQUtf7Decoder() : uc(0), stepNo(0), shifted(FALSE), rightAfterEscape(FALSE)
+ TQUtf7Decoder() : uc(0), stepNo(0), shifted(false), rightAfterEscape(false)
{
}
@@ -165,8 +165,8 @@ private:
{
uc = 0;
stepNo = 0;
- shifted = FALSE;
- rightAfterEscape = FALSE;
+ shifted = false;
+ rightAfterEscape = false;
}
public:
@@ -279,7 +279,7 @@ public:
// increase the step counter
stepNo++;
stepNo %= 8;
- rightAfterEscape = FALSE;
+ rightAfterEscape = false;
// and look at the next char.
continue;
} // fi (still) shifted
@@ -295,11 +295,11 @@ public:
if ( ch == '+' ) {
// '+' is the escape char for entering a
// shifted sequence:
- shifted = TRUE;
+ shifted = true;
stepNo = 0;
// also, we're right at the beginning where
// special rules apply:
- rightAfterEscape = TRUE;
+ rightAfterEscape = true;
} else {
// US-ASCII values are directly used
result += TQChar(ch);
@@ -327,7 +327,7 @@ class TQUtf7Encoder : public TQTextEncoder {
public:
TQUtf7Encoder(bool encOpt, bool encLwsp)
: outbits(0), stepNo(0),
- shifted(FALSE), mayContinueShiftedSequence(FALSE)
+ shifted(false), mayContinueShiftedSequence(false)
{
for ( int i = 0; i < 16 ; i++) {
dontNeedEncodingSet[i] = directSet[i];
@@ -429,13 +429,13 @@ private:
} else if (mayContinueShiftedSequence) {
// if mayContinue is set, this means the
// shifted-sequence needs a lead-out.
- mayContinueShiftedSequence = FALSE;
+ mayContinueShiftedSequence = false;
if (isOfSet(ch,base64Set) || ch == '-' ) {
*t++ = '-';
}
}
*t++ = (uchar)ch;
- shifted = FALSE;
+ shifted = false;
stepNo = 0;
}
@@ -494,8 +494,8 @@ public:
// 24bits ("-+-") + some from ending the shifted-sequence
// with 21,33 bits
addToShiftedSequence(t,ch);
- mayContinueShiftedSequence = FALSE;
- shifted = TRUE;
+ mayContinueShiftedSequence = false;
+ shifted = true;
} else {
// shortcut encoding of '+':
*t++ = '+';
@@ -512,15 +512,15 @@ public:
stepNo = 0;
}
addToShiftedSequence(t,ch);
- shifted = TRUE;
- mayContinueShiftedSequence = FALSE;
+ shifted = true;
+ mayContinueShiftedSequence = false;
}
if ( shifted ) {
endShiftedSequence(t);
- mayContinueShiftedSequence = TRUE;
+ mayContinueShiftedSequence = true;
};
- shifted = FALSE;
+ shifted = false;
}
*t = '\0';