kioslave/imap4
32int mimeIO::inputLine (QByteArray & aLine)
37 while ( inputChar( input ) ) {
39 if ( input ==
'\n' ) {
44 return aLine.length();
47int mimeIO::outputLine (
const QByteArray & aLine,
int len)
55 for ( i = 0; i < start; ++i ) {
56 if ( !outputChar( aLine[i] ) ) {
63int 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 ) {
72 if ( aLine[theLF - 1] ==
'\r' ) {
76 aLine.truncate( theLF );
82 int start, end, offset;
84 end = aLine.indexOf(
'\n', start );
87 if ( end && aLine[end - 1] ==
'\r' ) {
91 outputLine( aLine.mid( start, end - start ) + theCRLF, end - start + crlfLen );
93 end = aLine.indexOf(
'\n', start );
95 outputLine( aLine.mid( start, len - start ) + theCRLF, len - start + crlfLen );
100int mimeIO::inputChar (
char &aChar)
110int mimeIO::outputChar (
char aChar)
122mimeIOQFile::mimeIOQFile (
const QString & aName):
126 myFile.open( QIODevice::ReadOnly );
129mimeIOQFile::~mimeIOQFile ()
134int mimeIOQFile::outputLine (
const QByteArray &,
int)
139int mimeIOQFile::inputLine (QByteArray & data)
142 myFile.readLine( data.data(), 1024 );
144 return data.length();
147mimeIOQString::mimeIOQString ()
151mimeIOQString::~mimeIOQString ()
155int mimeIOQString::outputLine (
const QByteArray & _str,
int len)
164int mimeIOQString::inputLine (QByteArray & _str)
166 if ( theString.isEmpty() ) {
170 int i = theString.indexOf(
'\n' );
175 _str = theString.left( i + 1 ).toLatin1();
176 theString = theString.right( theString.length() - i - 1 );
177 return _str.length();
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Wed Jan 24 2024 00:00:00 by
doxygen 1.10.0 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.