/** * @file mime-printdoc.cc * @brief Implementation of main mime parser components * @author Andreas Aardal Hanssen * @date 2002-2005 */ #include "convert.h" #include "iodevice.h" #include "iofactory.h" #include "mime-inputsource.h" #include "mime-utils.h" #include "mime.h" #include #include #include #include #include #include #include #include #include void Binc::MimePart::printDoc(int fd, IODevice &output, unsigned int startoffset, unsigned int length) const { if (!mimeSource || mimeSource->getFileDescriptor() != fd) { delete mimeSource; mimeSource = new MimeInputSource(fd); } mimeSource->reset(); mimeSource->seek(headerstartoffsetcrlf); char c; for (unsigned int i = 0; i < length; ++i) { if (!mimeSource->getChar(&c)) break; output << (char)c; } }