acl/lib_acl_cpp/include/acl_cpp/mime/mime.hpp

485 lines
12 KiB
C++
Raw Normal View History

#pragma once
2017-06-02 14:47:24 +08:00
#include "../acl_cpp_define.hpp"
#include "../stdlib/noncopyable.hpp"
2014-11-19 00:25:21 +08:00
#include <list>
#include <string>
2017-06-02 14:47:24 +08:00
#include "mime_head.hpp"
2014-11-19 00:25:21 +08:00
#if !defined(ACL_MIME_DISABLE)
2014-11-19 00:25:21 +08:00
struct MIME_STATE;
namespace acl {
class string;
class mime_node;
class mime_attach;
class mime_body;
class mime_image;
class ifstream;
class fstream;
class ACL_CPP_API mime : public noncopyable
2014-11-19 00:25:21 +08:00
{
public:
mime(void);
~mime(void);
2014-11-19 00:25:21 +08:00
/////////////////////////////////////////////////////////////////////
// <20><><EFBFBD>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>صĺ<D8B5><C4BA><EFBFBD>
2014-11-19 00:25:21 +08:00
/**
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͬһ<EFBFBD><EFBFBD>MIME<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Զ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ, <EFBFBD><EFBFBD>Ҫ<EFBFBD><EFBFBD><EFBFBD>ô˺<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֮ǰ
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>в<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڴ<EFBFBD>, <EFBFBD><EFBFBD>Ȼ<EFBFBD><EFBFBD><EFBFBD>ε<EFBFBD><EFBFBD>øú<EFBFBD><EFBFBD><EFBFBD><EFBFBD>޺<EFBFBD>, <EFBFBD><EFBFBD>Ϊ<EFBFBD>˲<EFBFBD>Ӱ<EFBFBD><EFBFBD>
* Ч<EFBFBD><EFBFBD>, <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>øý<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD>ǰ<EFBFBD><EFBFBD><EFBFBD>øú<EFBFBD><EFBFBD><EFBFBD>
2014-11-19 00:25:21 +08:00
*/
mime& reset(void);
/**
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>߿<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ô˺<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Դ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD>ͷ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
2014-11-19 00:25:21 +08:00
*/
void primary_head_finish(void);
/**
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD>ô˺<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ж<EFBFBD><EFBFBD>ʼ<EFBFBD>ͷ<EFBFBD>Ƿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
* @return {bool} <EFBFBD>Ƿ<EFBFBD><EFBFBD>ʼ<EFBFBD>ͷ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
2014-11-19 00:25:21 +08:00
*/
bool primary_head_ok(void) const;
2014-11-19 00:25:21 +08:00
/**
* <EFBFBD><EFBFBD>ʼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <EFBFBD>ú<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڲ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Զ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> reset() <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ý<EFBFBD><EFBFBD><EFBFBD>
* <EFBFBD><EFBFBD>״̬
* @param path {const char*} <EFBFBD>ʼ<EFBFBD><EFBFBD>ļ<EFBFBD>·<EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ò<EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>, <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, Ҳ<EFBFBD><EFBFBD><EFBFBD>ܵ<EFBFBD><EFBFBD><EFBFBD> save_xxx <EFBFBD><EFBFBD><EFBFBD>صĽӿ<EFBFBD>
2014-11-19 00:25:21 +08:00
*/
void update_begin(const char* path);
/**
* <EFBFBD><EFBFBD><EFBFBD>ô˺<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ<EFBFBD><EFBFBD>ʽ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD>ͷ, <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ô<EFBFBD>
* <EFBFBD>ӿڽ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD>ͷ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> update_end() <EFBFBD>ӿڼ<EFBFBD><EFBFBD><EFBFBD>, <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ
* <EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD>, <EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><EFBFBD><EFBFBD>ϵص<EFBFBD><EFBFBD>ô˺<EFBFBD><EFBFBD><EFBFBD>ֱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> true <EFBFBD><EFBFBD>ʾ multipart <EFBFBD><EFBFBD>ʽ
* <EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> multipart <EFBFBD><EFBFBD>ʽ<EFBFBD>ʼ<EFBFBD>, <EFBFBD><EFBFBD><EFBFBD>˺<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ܻ<EFBFBD><EFBFBD>ط<EFBFBD> true,
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ж<EFBFBD><EFBFBD>ʼ<EFBFBD><EFBFBD>Ľ<EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><EFBFBD>
* @param data {const char*} <EFBFBD>ʼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD>ͷҲ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD><EFBFBD><EFBFBD>, <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)
* @param len {size_t} data <EFBFBD><EFBFBD><EFBFBD>ݳ<EFBFBD><EFBFBD><EFBFBD>
* @return {bool} <EFBFBD><EFBFBD><EFBFBD><EFBFBD> multipart <EFBFBD>ʼ<EFBFBD>, <EFBFBD><EFBFBD><EFBFBD><EFBFBD> true <EFBFBD><EFBFBD>ʾ<EFBFBD>÷<EFBFBD><EFBFBD>ʼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>;
* <EFBFBD><EFBFBD><EFBFBD>ڷ<EFBFBD> multipart <EFBFBD>ʼ<EFBFBD>, <EFBFBD>÷<EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD>ԶΪ false, û<EFBFBD><EFBFBD><EFBFBD>κ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <EFBFBD><EFBFBD>Ҫ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
* <EFBFBD><EFBFBD><EFBFBD>Լ<EFBFBD><EFBFBD>ж<EFBFBD><EFBFBD>ʼ<EFBFBD><EFBFBD>Ľ<EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><EFBFBD>
* ע<EFBFBD><EFBFBD>: <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˺<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> update_end <EFBFBD><EFBFBD><EFBFBD><EFBFBD>֪ͨ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
2014-11-19 00:25:21 +08:00
*/
bool update(const char* data, size_t len);
/**
* <EFBFBD>ڲ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ô˺<EFBFBD><EFBFBD><EFBFBD>
2014-11-19 00:25:21 +08:00
*/
void update_end(void);
/**
* <EFBFBD><EFBFBD><EFBFBD>ô˺<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD>
* @param file_path {const char*} <EFBFBD>ʼ<EFBFBD><EFBFBD>ļ<EFBFBD>·<EFBFBD><EFBFBD>
* @return {bool} <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> false ˵<EFBFBD><EFBFBD>Դ<EFBFBD>ʼ<EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD>޷<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
2014-11-19 00:25:21 +08:00
*/
bool parse(const char* file_path);
/**
* <EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD>
* @param out {ostream&} Ŀ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
* @return {bool} <EFBFBD>Ƿ<EFBFBD><EFBFBD>ɹ<EFBFBD>
2014-11-19 00:25:21 +08:00
*/
2019-07-07 13:27:58 +08:00
bool save_as(ostream& out);
2014-11-19 00:25:21 +08:00
/**
* <EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD>
* @param file_path {const char*} Ŀ<EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD>
* @return {bool} <EFBFBD>Ƿ<EFBFBD><EFBFBD>ɹ<EFBFBD>
2014-11-19 00:25:21 +08:00
*/
bool save_as(const char* file_path);
/**
* <EFBFBD>ʼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϻ󣬰<EFBFBD><EFBFBD>ͻ<EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD>ķ<EFBFBD>ʽ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڴ<EFBFBD><EFBFBD>̣<EFBFBD>
* <EFBFBD>û<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>򿪸<EFBFBD> html ҳ<EFBFBD><EFBFBD>
* @param path {const char*} ҳ<EFBFBD><EFBFBD><EFBFBD>·<EFBFBD><EFBFBD>
* @param filename {const char*} Ŀ<EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD>
* @param enableDecode {bool} ת<EFBFBD><EFBFBD>ʱ<EFBFBD>Ƿ<EFBFBD><EFBFBD>Զ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>н<EFBFBD><EFBFBD><EFBFBD>
* @param toCharset {const char*} Ŀ<EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><EFBFBD><EFBFBD>
* @param off {off_t} <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƫ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
* @return {bool} <EFBFBD>Ƿ<EFBFBD><EFBFBD>ɹ<EFBFBD>
2014-11-19 00:25:21 +08:00
*/
bool save_mail(const char* path, const char* filename,
bool enableDecode = true, const char* toCharset = "gb2312",
off_t off = 0);
/**
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ľڵ<EFBFBD>
* @param htmlFirst {bool} <EFBFBD><EFBFBD><EFBFBD>Ȼ<EFBFBD><EFBFBD><EFBFBD>HTML<EFBFBD><EFBFBD>ʽ<EFBFBD><EFBFBD><EFBFBD>ı<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȼ<EFBFBD><EFBFBD><EFBFBD>
* <EFBFBD><EFBFBD><EFBFBD>ı<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֻ<EFBFBD><EFBFBD>HTML<EFBFBD>ı<EFBFBD><EFBFBD><EFBFBD>ת<EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD><EFBFBD>ı<EFBFBD>
* @param enableDecode {bool} ת<EFBFBD><EFBFBD>ʱ<EFBFBD>Ƿ<EFBFBD><EFBFBD><EFBFBD>ԭ<EFBFBD>Ľ<EFBFBD><EFBFBD>н<EFBFBD><EFBFBD><EFBFBD>
* @param toCharset {const char*} Ŀ<EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><EFBFBD><EFBFBD>
* @param off {off_t} <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƫ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
* @return {mime_body*} <EFBFBD><EFBFBD>δ<EFBFBD>ҵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>򷵻<EFBFBD> NULL
2014-11-19 00:25:21 +08:00
*/
mime_body* get_body_node(bool htmlFirst, bool enableDecode = true,
const char* toCharset = "gb2312", off_t off = 0);
/**
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD> text/plain <EFBFBD><EFBFBD>ʽ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ľڵ<EFBFBD>
* @param enableDecode {bool} ת<EFBFBD><EFBFBD>ʱ<EFBFBD>Ƿ<EFBFBD><EFBFBD><EFBFBD>ԭ<EFBFBD>Ľ<EFBFBD><EFBFBD>н<EFBFBD><EFBFBD><EFBFBD>
* @param toCharset {const char*} Ŀ<EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><EFBFBD><EFBFBD>
* @param off {off_t} <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƫ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
* @return {mime_body*} <EFBFBD><EFBFBD>δ<EFBFBD>ҵ<EFBFBD> plain <EFBFBD><EFBFBD>ʽ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>򷵻<EFBFBD> NULL
*/
mime_body* get_plain_body(bool enableDecode = true,
const char* toCharset = "gb2312", off_t off = 0);
/**
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD> text/html <EFBFBD><EFBFBD>ʽ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ľڵ<EFBFBD>
* @param enableDecode {bool} ת<EFBFBD><EFBFBD>ʱ<EFBFBD>Ƿ<EFBFBD><EFBFBD><EFBFBD>ԭ<EFBFBD>Ľ<EFBFBD><EFBFBD>н<EFBFBD><EFBFBD><EFBFBD>
* @param toCharset {const char*} Ŀ<EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><EFBFBD><EFBFBD>
* @param off {off_t} <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƫ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
* @return {mime_body*} <EFBFBD><EFBFBD>δ<EFBFBD>ҵ<EFBFBD> html <EFBFBD><EFBFBD>ʽ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>򷵻<EFBFBD> NULL
*/
mime_body* get_html_body(bool enableDecode = true,
const char* toCharset = "gb2312", off_t off = 0);
/**
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>е<EFBFBD> mime <EFBFBD>ڵ<EFBFBD><EFBFBD>б<EFBFBD>
* @param enableDecode {bool} ת<EFBFBD><EFBFBD>ʱ<EFBFBD>Ƿ<EFBFBD><EFBFBD>Զ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>н<EFBFBD><EFBFBD><EFBFBD>
* @param toCharset {const char*} Ŀ<EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><EFBFBD><EFBFBD>
* @param off {off_t} <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƫ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
2014-11-19 00:25:21 +08:00
* @return {const std::list<mime_node*>&}
*/
const std::list<mime_node*>& get_mime_nodes(bool enableDecode = true,
const char* toCharset = "gb2312", off_t off = 0);
/**
* <EFBFBD><EFBFBD><EFBFBD>ø<EFBFBD><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>
* @param enableDecode {bool} ת<EFBFBD><EFBFBD>ʱ<EFBFBD>Ƿ<EFBFBD><EFBFBD>Զ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>н<EFBFBD><EFBFBD><EFBFBD>
* @param toCharset {const char*} Ŀ<EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><EFBFBD><EFBFBD>
* @param off {off_t} <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƫ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
* @param all {bool} <EFBFBD><EFBFBD>ȡ<EFBFBD><EFBFBD><EFBFBD>а<EFBFBD><EFBFBD><EFBFBD> message/application/image <EFBFBD><EFBFBD><EFBFBD>ڵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>нڵ<EFBFBD>
2014-11-19 00:25:21 +08:00
* @return {const std::list<mime_attach*>&}
*/
const std::list<mime_attach*>& get_attachments(bool enableDecode = true,
const char* toCharset = "gb2312", off_t off = 0, bool all = true);
2014-11-19 00:25:21 +08:00
/**
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͼƬ<EFBFBD>б<EFBFBD>
* @param enableDecode {bool} ת<EFBFBD><EFBFBD>ʱ<EFBFBD>Ƿ<EFBFBD><EFBFBD>Զ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>н<EFBFBD><EFBFBD><EFBFBD>
* @param toCharset {const char*} Ŀ<EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><EFBFBD><EFBFBD>
* @param off {off_t} <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƫ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
2014-11-19 00:25:21 +08:00
* @return {const std::list<mime_image*>&}
*/
const std::list<mime_image*>& get_images(bool enableDecode = true,
const char* toCharset = "gb2312", off_t off = 0);
mime_image* get_image(const char* cld, bool enableDecode = true,
const char* toCharset = "gb2312", off_t off = 0);
/**
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD>MIME<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
* @param save_path {const char*} <EFBFBD> MIME <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>·<EFBFBD><EFBFBD>
* @param decode {bool} <EFBFBD>Ƿ<EFBFBD><EFBFBD><EFBFBD>ԭ<EFBFBD>Ľ<EFBFBD><EFBFBD>н<EFBFBD><EFBFBD><EFBFBD>
2014-11-19 00:25:21 +08:00
*/
void mime_debug(const char* save_path, bool decode = true);
/////////////////////////////////////////////////////////////////////
// <20><><EFBFBD>ʼ<EFBFBD>ͷ<EFBFBD><CDB7><EFBFBD>صĺ<D8B5><C4BA><EFBFBD>
2014-11-19 00:25:21 +08:00
/**
* <EFBFBD><EFBFBD><EFBFBD>÷<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
* @param addr {const char*} <EFBFBD>ʼ<EFBFBD><EFBFBD><EFBFBD>ַ
2014-11-19 00:25:21 +08:00
* @return {mime&}
*/
mime& set_sender(const char* addr)
{
m_primaryHeader.set_returnpath(addr);
2019-07-07 13:27:58 +08:00
return *this;
2014-11-19 00:25:21 +08:00
}
/**
* <EFBFBD><EFBFBD><EFBFBD>÷<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: From: zhengshuxin@51iker.com
* @param addr {const char*} <EFBFBD>ʼ<EFBFBD><EFBFBD><EFBFBD>ַ
2014-11-19 00:25:21 +08:00
* @return {mime&}
*/
mime& set_from(const char* addr)
{
m_primaryHeader.set_from(addr);
2019-07-07 13:27:58 +08:00
return *this;
2014-11-19 00:25:21 +08:00
}
/**
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD><EFBFBD>ص<EFBFBD>ַ: Reply-To: zhengshuxin@51iker.com
* @param addr {const char*} <EFBFBD>ʼ<EFBFBD><EFBFBD><EFBFBD>ַ
2014-11-19 00:25:21 +08:00
* @return {mime&}
*/
mime& set_replyto(const char* addr)
{
m_primaryHeader.set_replyto(addr);
2019-07-07 13:27:58 +08:00
return *this;
2014-11-19 00:25:21 +08:00
}
/**
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ Return-Path: <zhengshuxin@51iker.com>
* @param addr {const char*} <EFBFBD>ʼ<EFBFBD><EFBFBD><EFBFBD>ַ
2014-11-19 00:25:21 +08:00
* @return {mime&}
*/
mime& set_returnpath(const char* addr)
{
m_primaryHeader.set_returnpath(addr);
2019-07-07 13:27:58 +08:00
return *this;
2014-11-19 00:25:21 +08:00
}
/**
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: Subject: test
* @param s {const char*} <EFBFBD>ʼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
2014-11-19 00:25:21 +08:00
* @return {mime&}
*/
mime& set_subject(const char* s)
{
m_primaryHeader.set_subject(s);
2019-07-07 13:27:58 +08:00
return *this;
2014-11-19 00:25:21 +08:00
}
/**
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: To: <zhengshuxin@51iker.com>
* @param addr {const char*} <EFBFBD>ʼ<EFBFBD><EFBFBD><EFBFBD>ַ
2014-11-19 00:25:21 +08:00
* @return {mime&}
*/
mime& add_to(const char* addr)
{
m_primaryHeader.add_to(addr);
2019-07-07 13:27:58 +08:00
return *this;
2014-11-19 00:25:21 +08:00
}
/**
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: CC: <zhengshuxin@51iker.com>
* @param addr {const char* addr} <EFBFBD>ʼ<EFBFBD><EFBFBD><EFBFBD>ַ
2014-11-19 00:25:21 +08:00
* @return {mime&}
*/
mime& add_cc(const char* addr)
{
m_primaryHeader.add_cc(addr);
2019-07-07 13:27:58 +08:00
return *this;
2014-11-19 00:25:21 +08:00
}
/**
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: BCC: <zhengshuxin@51iker.com>
* @param addr {const char* addr} <EFBFBD>ʼ<EFBFBD><EFBFBD><EFBFBD>ַ
2014-11-19 00:25:21 +08:00
* @return {mime&}
*/
mime& add_bcc(const char* addr)
{
m_primaryHeader.add_bcc(addr);
2019-07-07 13:27:58 +08:00
return *this;
2014-11-19 00:25:21 +08:00
}
/**
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: CC: <zhengshuxin@51iker.com>
* @param addr {const char* addr} <EFBFBD>ʼ<EFBFBD><EFBFBD><EFBFBD>ַ
2014-11-19 00:25:21 +08:00
* @return {mime&}
*/
mime& add_rcpt(const char* addr)
{
m_primaryHeader.add_rcpt(addr);
2019-07-07 13:27:58 +08:00
return *this;
2014-11-19 00:25:21 +08:00
}
/**
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD>ͷ<EFBFBD><EFBFBD><EFBFBD>ֶ<EFBFBD>
* @param name {const char*} <EFBFBD>ֶ<EFBFBD><EFBFBD><EFBFBD>
* @param value {const char*} <EFBFBD>ֶ<EFBFBD>ֵ
2014-11-19 00:25:21 +08:00
* @return {mime&}
*/
mime& add_header(const char* name, const char* value)
{
m_primaryHeader.add_header(name, value);
2019-07-07 13:27:58 +08:00
return *this;
2014-11-19 00:25:21 +08:00
}
/**
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD>ͷ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: Content-Type: text/plain
* @param ctype {const char*} <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
* @param stype {const char*} <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
2014-11-19 00:25:21 +08:00
* @return {mime&}
*/
mime& set_type(const char* ctype, const char* stype)
2014-11-19 00:25:21 +08:00
{
m_primaryHeader.set_type(ctype, stype);
2019-07-07 13:27:58 +08:00
return *this;
2014-11-19 00:25:21 +08:00
}
/**
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD>ͷ<EFBFBD><EFBFBD><EFBFBD>ķָ<EFBFBD><EFBFBD><EFBFBD>
* @param s {const char*} <EFBFBD>ָ<EFBFBD><EFBFBD><EFBFBD>
2014-11-19 00:25:21 +08:00
* @return {mime&}
*/
mime& set_boundary(const char* s)
{
m_primaryHeader.set_boundary(s);
2019-07-07 13:27:58 +08:00
return *this;
2014-11-19 00:25:21 +08:00
}
/**
* <EFBFBD><EFBFBD><EFBFBD>÷<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
* @return {const string&} <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ض<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>
* (<EFBFBD><EFBFBD><EFBFBD><EFBFBD> string::empty()) <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾû<EFBFBD>д<EFBFBD><EFBFBD>ֶ<EFBFBD>
2014-11-19 00:25:21 +08:00
*/
const string& sender(void) const
{
2019-07-07 13:27:58 +08:00
return m_primaryHeader.sender();
2014-11-19 00:25:21 +08:00
}
/**
* <EFBFBD><EFBFBD><EFBFBD>÷<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
* @return {const string&} <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ض<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>
* (<EFBFBD><EFBFBD><EFBFBD><EFBFBD> string::empty()) <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾû<EFBFBD>д<EFBFBD><EFBFBD>ֶ<EFBFBD>
2014-11-19 00:25:21 +08:00
*/
const string& from(void) const
{
2019-07-07 13:27:58 +08:00
return m_primaryHeader.from();
2014-11-19 00:25:21 +08:00
}
/**
* <EFBFBD><EFBFBD><EFBFBD>ûظ<EFBFBD><EFBFBD>ʼ<EFBFBD><EFBFBD><EFBFBD>ַ
* @return {const string&} <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ض<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>
* (<EFBFBD><EFBFBD><EFBFBD><EFBFBD> string::empty()) <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾû<EFBFBD>д<EFBFBD><EFBFBD>ֶ<EFBFBD>
2014-11-19 00:25:21 +08:00
*/
const string& replyto(void) const
{
2019-07-07 13:27:58 +08:00
return m_primaryHeader.replyto();
2014-11-19 00:25:21 +08:00
}
/**
* <EFBFBD><EFBFBD><EFBFBD>ûظ<EFBFBD><EFBFBD>ʼ<EFBFBD><EFBFBD><EFBFBD>ַ
* @return {const string&} <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ض<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>
* (<EFBFBD><EFBFBD><EFBFBD><EFBFBD> string::empty()) <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾû<EFBFBD>д<EFBFBD><EFBFBD>ֶ<EFBFBD>
2014-11-19 00:25:21 +08:00
*/
const string& returnpath(void) const
{
2019-07-07 13:27:58 +08:00
return m_primaryHeader.returnpath();
2014-11-19 00:25:21 +08:00
}
/**
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
* @return {const string&} <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ض<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>
* (<EFBFBD><EFBFBD><EFBFBD><EFBFBD> string::empty()) <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾû<EFBFBD>д<EFBFBD><EFBFBD>ֶ<EFBFBD>
2014-11-19 00:25:21 +08:00
*/
const string& subject(void) const
{
2019-07-07 13:27:58 +08:00
return m_primaryHeader.subject();
2014-11-19 00:25:21 +08:00
}
/**
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ռ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>: To: xxx@xxx.com
* @return {const std::list<char*>&) <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ض<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>
* (<EFBFBD><EFBFBD><EFBFBD><EFBFBD> std::list<char*>::empty()) <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾû<EFBFBD>д<EFBFBD><EFBFBD>ֶ<EFBFBD>
2014-11-19 00:25:21 +08:00
*/
const std::list<char*>& to_list(void) const
{
2019-07-07 13:27:58 +08:00
return m_primaryHeader.to_list();
2014-11-19 00:25:21 +08:00
}
/**
* <EFBFBD><EFBFBD><EFBFBD>ó<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>: To: xxx@xxx.com
* @return {const std::list<char*>&) <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ض<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>
* (<EFBFBD><EFBFBD><EFBFBD><EFBFBD> std::list<char*>::empty()) <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾû<EFBFBD>д<EFBFBD><EFBFBD>ֶ<EFBFBD>
2014-11-19 00:25:21 +08:00
*/
const std::list<char*>& cc_list(void) const
{
2019-07-07 13:27:58 +08:00
return m_primaryHeader.cc_list();
2014-11-19 00:25:21 +08:00
}
/**
* <EFBFBD><EFBFBD><EFBFBD>ð<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>: To: xxx@xxx.com
* @return {const std::list<char*>&) <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ض<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>
* (<EFBFBD><EFBFBD><EFBFBD><EFBFBD> std::list<char*>::empty()) <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾû<EFBFBD>д<EFBFBD><EFBFBD>ֶ<EFBFBD>
2014-11-19 00:25:21 +08:00
*/
const std::list<char*>& bcc_list(void) const
{
2019-07-07 13:27:58 +08:00
return m_primaryHeader.bcc_list();
2014-11-19 00:25:21 +08:00
}
/**
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ռ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>:
2014-11-19 00:25:21 +08:00
* To: xxx@xxx.xxx, CC: xxx@xxx.xxx, BCC: xxx@xxx.xxx
* @return {const std::list<char*>&) <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ض<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>
* (<EFBFBD><EFBFBD><EFBFBD><EFBFBD> std::list<char*>::empty()) <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾû<EFBFBD>д<EFBFBD><EFBFBD>ֶ<EFBFBD>
2014-11-19 00:25:21 +08:00
*/
const std::list<char*>& rcpt_list(void) const
{
2019-07-07 13:27:58 +08:00
return m_primaryHeader.rcpt_list();
2014-11-19 00:25:21 +08:00
}
/**
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD>ͷ<EFBFBD>ĸ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֶ<EFBFBD><EFBFBD>б<EFBFBD>
2014-11-19 00:25:21 +08:00
* @return {const std::list<HEADER*>&)
*/
const std::list<HEADER*>& header_list(void) const
{
2019-07-07 13:27:58 +08:00
return m_primaryHeader.header_list();
2014-11-19 00:25:21 +08:00
}
/**
* <EFBFBD><EFBFBD>ѯ<EFBFBD>ʼ<EFBFBD>ͷ<EFBFBD><EFBFBD>Ӧ<EFBFBD>ֶ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֶ<EFBFBD>ֵ
* @param name {const char*} <EFBFBD>ֶ<EFBFBD><EFBFBD><EFBFBD>
* @return {const char*} <EFBFBD>ֶ<EFBFBD>ֵ, Ϊ<EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
2014-11-19 00:25:21 +08:00
*/
const char* header_value(const char* name) const
{
2019-07-07 13:27:58 +08:00
return m_primaryHeader.header_value(name);
2014-11-19 00:25:21 +08:00
}
/**
* <EFBFBD><EFBFBD>ѯ<EFBFBD>ʼ<EFBFBD>ͷ<EFBFBD><EFBFBD>Ӧ<EFBFBD>ֶ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֶ<EFBFBD>ֵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
* @param name {const char*} <EFBFBD>ֶ<EFBFBD><EFBFBD><EFBFBD>
* @param values {std::list<const char*>*} <EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD>Ľ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
* @return {int} <EFBFBD>ֶ<EFBFBD>ֵ<EFBFBD><EFBFBD><EFBFBD>ϵĸ<EFBFBD><EFBFBD><EFBFBD>
2014-11-19 00:25:21 +08:00
*/
int header_values(const char* name, std::list<const char*>* values) const
{
2019-07-07 13:27:58 +08:00
return m_primaryHeader.header_values(name, values);
2014-11-19 00:25:21 +08:00
}
/**
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD>ͷ<EFBFBD>й<EFBFBD><EFBFBD><EFBFBD> Content-Type: text/html <EFBFBD>е<EFBFBD> text <EFBFBD>ֶ<EFBFBD>
* @return {const char*} <EFBFBD><EFBFBD>Զ<EFBFBD><EFBFBD><EFBFBD>طǿ<EFBFBD>ֵ
2014-11-19 00:25:21 +08:00
*/
2019-07-07 13:27:58 +08:00
const char* get_ctype(void) const
2014-11-19 00:25:21 +08:00
{
return m_primaryHeader.get_ctype();
}
/**
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD>ͷ<EFBFBD>й<EFBFBD><EFBFBD><EFBFBD> Content-Type: text/html <EFBFBD>е<EFBFBD> html <EFBFBD>ֶ<EFBFBD>
* @return {const char*} <EFBFBD><EFBFBD>Զ<EFBFBD><EFBFBD><EFBFBD>طǿ<EFBFBD>ֵ
2014-11-19 00:25:21 +08:00
*/
2019-07-07 13:27:58 +08:00
const char* get_stype(void) const
2014-11-19 00:25:21 +08:00
{
return m_primaryHeader.get_stype();
}
/**
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD>ͷ
2014-11-19 00:25:21 +08:00
* @return {const mime_head&}
*/
const mime_head& primary_header(void) const
{
2019-07-07 13:27:58 +08:00
return m_primaryHeader;
2014-11-19 00:25:21 +08:00
}
private:
mime_head m_primaryHeader;
MIME_STATE* m_pMimeState;
bool m_bPrimaryHeadFinish;
char* m_pFilePath;
mime_body* m_pBody;
std::list<mime_node*>* m_pNodes;
std::list<mime_attach*>* m_pAttaches;
std::list<mime_image*>* m_pImages;
};
} // namespace acl
#endif // !defined(ACL_MIME_DISABLE)