Exemplo n.º 1
0
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;
}
Exemplo n.º 2
0
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();
}
Exemplo n.º 3
0
 void write(CMailInfo & info) const
 {
     writePart(inlined, info);
     writePart(attachment, info);
     writePartEnd(info);
 }