34 mimeIO::inputLine (TQCString & aLine)
38 aLine = ( const char *) NULL;
39 while (inputChar (input))
46 return aLine.length ();
50 mimeIO::outputLine ( const TQCString & aLine, int len)
58 for (i = 0; i < start; i++)
59 if (!outputChar (aLine[i]))
65 mimeIO::outputMimeLine ( const TQCString & inLine)
68 TQCString aLine = inLine;
69 int len = inLine.length();
71 int theLF = aLine.findRev ( '\n');
72 if (theLF == len - 1 && theLF != -1)
75 if (aLine[theLF - 1] == '\r')
78 aLine.truncate(theLF);
84 int start, end, offset;
86 end = aLine.find ( '\n', start);
90 if (end && aLine[end - 1] == '\r')
95 outputLine (aLine.mid (start, end - start) + theCRLF, end - start + crlfLen);
97 end = aLine.find ( '\n', start);
99 outputLine (aLine.mid (start, len - start) + theCRLF, len - start + crlfLen);
105 mimeIO::inputChar ( char &aChar)
117 mimeIO::outputChar ( char aChar)
124 mimeIO::setCRLF ( const char *aCRLF)
127 crlfLen = strlen(aCRLF);
130 mimeIOTQFile::mimeIOTQFile ( const TQString & aName):
134 myFile.open (IO_ReadOnly);
137 mimeIOTQFile::~mimeIOTQFile ()
143 mimeIOTQFile::outputLine ( const TQCString &, int)
149 mimeIOTQFile::inputLine (TQCString & data)
152 myFile.readLine (data.data(), 1024);
154 return data.length ();
157 mimeIOTQString::mimeIOTQString ()
161 mimeIOTQString::~mimeIOTQString ()
166 mimeIOTQString::outputLine ( const TQCString & _str, int len)
176 mimeIOTQString::inputLine (TQCString & _str)
178 if (theString.isEmpty ())
181 int i = theString.find ( '\n');
185 _str = theString.left (i + 1).latin1 ();
186 theString = theString.right (theString.length () - i - 1);
187 return _str.length ();
|