kioslave/imap4
32 int mimeIO::inputLine (QByteArray & aLine)
37 while (inputChar (input))
44 return aLine.length ();
47 int mimeIO::outputLine (
const QByteArray & aLine,
int len)
55 for (i = 0; i < start; ++i) {
56 if (!outputChar (aLine[i])) {
63 int mimeIO::outputMimeLine (
const QByteArray & inLine)
66 QByteArray aLine = inLine;
67 int len = inLine.length();
69 int theLF = aLine.lastIndexOf (
'\n');
70 if (theLF == len - 1 && theLF != -1)
73 if (aLine[theLF - 1] ==
'\r')
76 aLine.truncate(theLF);
82 int start, end, offset;
84 end = aLine.indexOf (
'\n', start);
88 if (end && aLine[end - 1] ==
'\r')
93 outputLine (aLine.mid (start, end - start) + theCRLF, end - start + crlfLen);
95 end = aLine.indexOf (
'\n', start);
97 outputLine (aLine.mid (start, len - start) + theCRLF, len - start + crlfLen);
102 int mimeIO::inputChar (
char &aChar)
113 int mimeIO::outputChar (
char aChar)
125 mimeIOQFile::mimeIOQFile (
const QString & aName):
129 myFile.open (QIODevice::ReadOnly);
132 mimeIOQFile::~mimeIOQFile ()
137 int mimeIOQFile::outputLine (
const QByteArray &,
int)
142 int mimeIOQFile::inputLine (QByteArray & data)
145 myFile.readLine (data.data(), 1024);
147 return data.length ();
150 mimeIOQString::mimeIOQString ()
154 mimeIOQString::~mimeIOQString ()
158 int mimeIOQString::outputLine (
const QByteArray & _str,
int len)
167 int mimeIOQString::inputLine (QByteArray & _str)
169 if (theString.isEmpty ())
172 int i = theString.indexOf (
'\n');
176 _str = theString.left (i + 1).toLatin1 ();
177 theString = theString.right (theString.length () - i - 1);
178 return _str.length ();
This file is part of the KDE documentation.
Documentation copyright © 1996-2012 The KDE developers.
Generated on Wed Nov 28 2012 21:44:04 by
doxygen 1.8.1.2 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.