kioslave/imap4
18 #include "mimehdrline.h"
26 mimeHdrLine::mimeHdrLine ():
27 mimeValue (), mimeLabel ()
31 mimeHdrLine::mimeHdrLine (
const QByteArray & aLabel,
const QByteArray & aValue):
38 mimeValue (aHdrLine->mimeValue), mimeLabel (aHdrLine->mimeLabel)
42 mimeHdrLine::~mimeHdrLine ()
46 int mimeHdrLine::appendStr (
const char *aCStr)
92 int label = 0, advance;
93 while ((advance =
parseWord (&aCStr[label])))
97 if (label && aCStr[label - 1] !=
':')
122 while (*aCStr && *aCStr !=
'\r' && *aCStr !=
'\n')
172 if (*aCStr == startQuote)
179 while (*aCStr && *aCStr != endQuote)
191 if (*aCStr == endQuote)
211 while (*aCStr && isalnum (*aCStr))
237 if (isalnum (*aCStr))
245 else if (!isspace (*aCStr))
266 while (*aCStr && *aCStr !=
'\n')
298 while (*aCStr ==
' ' || *aCStr ==
'\t')
309 if (*aCStr++ ==
'\n')
311 if (*aCStr ==
'\t' || *aCStr ==
' ')
320 retVal = -retVal - 1;
355 else if ((advance =
skipWS (aCStr)))
398 if (*aCStr != separator)
452 QByteArray mimeHdrLine::truncateLine(QByteArray aLine,
unsigned int truncate)
456 uint len = aLine.length();
460 int validStart = aLine.indexOf(
": ");
461 if (validStart > -1) {
464 while (len > truncate) {
465 cutHere = aLine.lastIndexOf(
' ', truncate);
466 if (cutHere < 1 || cutHere < validStart) {
467 cutHere = aLine.lastIndexOf(
'\t', truncate);
469 cutHere = aLine.indexOf(
' ', 1);
471 cutHere = aLine.indexOf(
'\t', 1);
474 return aLine.left(truncate);
480 retVal += aLine.left(cutHere) +
'\n';
481 int chop = len - cutHere;
482 aLine = aLine.right(chop);
This file is part of the KDE documentation.
Documentation copyright © 1996-2012 The KDE developers.
Generated on Mon Sep 24 2012 09:02:51 by
doxygen 1.8.1.1 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.