bool FileIStream::write(const void *data, unsigned int size, unsigned int &processedSize) { processedSize = 0; do { unsigned int processedLoc = 0; bool res = writePart(data, size, processedLoc); processedSize += processedLoc; if (!res) return false; if (processedLoc == 0) return true; data = (const void *)((const unsigned char *)data + processedLoc); size -= processedLoc; } while (size > 0); return true; }
void MailMessage::writeMultipart(MessageHeader& header, std::ostream& ostr) const { if (_boundary.empty()) _boundary = MultipartWriter::createBoundary(); MediaType mediaType(getContentType()); mediaType.setParameter("boundary", _boundary); header.set(HEADER_CONTENT_TYPE, mediaType.toString()); header.set(HEADER_MIME_VERSION, "1.0"); writeHeader(header, ostr); MultipartWriter writer(ostr, _boundary); for (PartVec::const_iterator it = _parts.begin(); it != _parts.end(); ++it) { writePart(writer, *it); } writer.close(); }
void write(CMailInfo & info) const { writePart(inlined, info); writePart(attachment, info); writePartEnd(info); }