示例#1
0
void extractContentHandlerToFile(vmime::ref<const vmime::contentHandler> content_handler, string file_name) {
	ofstream file;
	file.open(file_name.c_str(), ios::out | ios::binary);		
	vmime::utility::outputStreamAdapter out(file);
	content_handler->extract(out);
	file.close();		
}
	static const vmime::string extractContents(const vmime::ref <const vmime::contentHandler> cts)
	{
		std::ostringstream oss;
		vmime::utility::outputStreamAdapter os(oss);

		cts->extract(os);

		return oss.str();
	}
示例#3
0
vmime::ref<vmime::message> convertMessage(vmime::ref<vmime::net::message> message) {
	vmime::string data;
	vmime::utility::outputStreamStringAdapter out(data);
	message->extract(out);	
	// in string data - message data 
	
	vmime::ref<vmime::message> msg = vmime::create<vmime::message>();	
	msg->parse(data);
	
	return msg;
}
	VMIME_TEST_LIST_END


	static const vmime::string extractContent
		(vmime::ref <const vmime::contentHandler> cth)
	{
		std::ostringstream oss;
		vmime::utility::outputStreamAdapter osa(oss);

		cth->extract(osa);

		return oss.str();
	}