2014-11-19 00:25:21 +08:00
|
|
|
|
#pragma once
|
2017-06-02 14:47:24 +08:00
|
|
|
|
#include "../acl_cpp_define.hpp"
|
2019-05-09 13:57:51 +08:00
|
|
|
|
#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
|
|
|
|
|
|
|
|
|
struct MIME_STATE;
|
|
|
|
|
|
|
|
|
|
namespace acl {
|
|
|
|
|
|
|
|
|
|
class string;
|
|
|
|
|
class mime_node;
|
|
|
|
|
class mime_attach;
|
|
|
|
|
class mime_body;
|
|
|
|
|
class mime_image;
|
|
|
|
|
class ifstream;
|
|
|
|
|
class fstream;
|
|
|
|
|
|
2019-05-09 13:57:51 +08:00
|
|
|
|
class ACL_CPP_API mime : public noncopyable
|
2014-11-19 00:25:21 +08:00
|
|
|
|
{
|
|
|
|
|
public:
|
2019-05-09 13:57:51 +08:00
|
|
|
|
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>
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* <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>
|
|
|
|
|
*/
|
|
|
|
|
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>
|
|
|
|
|
*/
|
|
|
|
|
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>
|
|
|
|
|
*/
|
2019-05-09 13:57:51 +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>
|
|
|
|
|
*/
|
|
|
|
|
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>
|
|
|
|
|
*/
|
|
|
|
|
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>
|
|
|
|
|
*/
|
|
|
|
|
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>
|
|
|
|
|
*/
|
|
|
|
|
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 {fstream&} Ŀ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @return {bool} <EFBFBD>Ƿ<EFBFBD><EFBFBD>ɹ<EFBFBD>
|
|
|
|
|
*/
|
|
|
|
|
bool save_as(fstream& out);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* <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>
|
|
|
|
|
*/
|
|
|
|
|
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>
|
|
|
|
|
*/
|
|
|
|
|
bool save_mail(const char* path, const char* filename,
|
|
|
|
|
bool enableDecode = true, const char* toCharset = "gb2312",
|
|
|
|
|
off_t off = 0);
|
|
|
|
|
|
|
|
|
|
/**
|
2016-07-29 16:43:46 +08:00
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ľڵ<EFBFBD>
|
2014-11-19 00:25:21 +08:00
|
|
|
|
* @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
|
|
|
|
|
*/
|
|
|
|
|
mime_body* get_body_node(bool htmlFirst, bool enableDecode = true,
|
|
|
|
|
const char* toCharset = "gb2312", off_t off = 0);
|
|
|
|
|
|
|
|
|
|
/**
|
2016-07-29 16:43:46 +08:00
|
|
|
|
* <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>
|
2014-11-19 00:25:21 +08:00
|
|
|
|
* @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 {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>
|
2016-03-17 14:42:58 +08:00
|
|
|
|
* @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,
|
2016-03-17 14:42:58 +08:00
|
|
|
|
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>
|
|
|
|
|
* @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>
|
|
|
|
|
*/
|
|
|
|
|
void mime_debug(const char* save_path, bool decode = true);
|
|
|
|
|
|
|
|
|
|
/////////////////////////////////////////////////////////////////////
|
|
|
|
|
// <20><><EFBFBD>ʼ<EFBFBD>ͷ<EFBFBD><CDB7><EFBFBD>صĺ<D8B5><C4BA><EFBFBD>
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD>÷<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param addr {const char*} <EFBFBD>ʼ<EFBFBD><EFBFBD><EFBFBD>ַ
|
|
|
|
|
* @return {mime&}
|
|
|
|
|
*/
|
|
|
|
|
mime& set_sender(const char* addr)
|
|
|
|
|
{
|
|
|
|
|
m_primaryHeader.set_returnpath(addr);
|
|
|
|
|
return (*this);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD>÷<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: From: zhengshuxin@51iker.com
|
|
|
|
|
* @param addr {const char*} <EFBFBD>ʼ<EFBFBD><EFBFBD><EFBFBD>ַ
|
|
|
|
|
* @return {mime&}
|
|
|
|
|
*/
|
|
|
|
|
mime& set_from(const char* addr)
|
|
|
|
|
{
|
|
|
|
|
m_primaryHeader.set_from(addr);
|
|
|
|
|
return (*this);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD><EFBFBD>ص<EFBFBD>ַ: Reply-To: zhengshuxin@51iker.com
|
|
|
|
|
* @param addr {const char*} <EFBFBD>ʼ<EFBFBD><EFBFBD><EFBFBD>ַ
|
|
|
|
|
* @return {mime&}
|
|
|
|
|
*/
|
|
|
|
|
mime& set_replyto(const char* addr)
|
|
|
|
|
{
|
|
|
|
|
m_primaryHeader.set_replyto(addr);
|
|
|
|
|
return (*this);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* <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>ַ
|
|
|
|
|
* @return {mime&}
|
|
|
|
|
*/
|
|
|
|
|
mime& set_returnpath(const char* addr)
|
|
|
|
|
{
|
|
|
|
|
m_primaryHeader.set_returnpath(addr);
|
|
|
|
|
return (*this);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: Subject: test
|
|
|
|
|
* @param s {const char*} <EFBFBD>ʼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @return {mime&}
|
|
|
|
|
*/
|
|
|
|
|
mime& set_subject(const char* s)
|
|
|
|
|
{
|
|
|
|
|
m_primaryHeader.set_subject(s);
|
|
|
|
|
return (*this);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: To: <zhengshuxin@51iker.com>
|
|
|
|
|
* @param addr {const char*} <EFBFBD>ʼ<EFBFBD><EFBFBD><EFBFBD>ַ
|
|
|
|
|
* @return {mime&}
|
|
|
|
|
*/
|
|
|
|
|
mime& add_to(const char* addr)
|
|
|
|
|
{
|
|
|
|
|
m_primaryHeader.add_to(addr);
|
|
|
|
|
return (*this);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* <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>ַ
|
|
|
|
|
* @return {mime&}
|
|
|
|
|
*/
|
|
|
|
|
mime& add_cc(const char* addr)
|
|
|
|
|
{
|
|
|
|
|
m_primaryHeader.add_cc(addr);
|
|
|
|
|
return (*this);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* <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>ַ
|
|
|
|
|
* @return {mime&}
|
|
|
|
|
*/
|
|
|
|
|
mime& add_bcc(const char* addr)
|
|
|
|
|
{
|
|
|
|
|
m_primaryHeader.add_bcc(addr);
|
|
|
|
|
return (*this);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* <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>ַ
|
|
|
|
|
* @return {mime&}
|
|
|
|
|
*/
|
|
|
|
|
mime& add_rcpt(const char* addr)
|
|
|
|
|
{
|
|
|
|
|
m_primaryHeader.add_rcpt(addr);
|
|
|
|
|
return (*this);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD>ͷ<EFBFBD><EFBFBD><EFBFBD>ֶ<EFBFBD>
|
|
|
|
|
* @param name {const char*} <EFBFBD>ֶ<EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param value {const char*} <EFBFBD>ֶ<EFBFBD>ֵ
|
|
|
|
|
* @return {mime&}
|
|
|
|
|
*/
|
|
|
|
|
mime& add_header(const char* name, const char* value)
|
|
|
|
|
{
|
|
|
|
|
m_primaryHeader.add_header(name, value);
|
|
|
|
|
return (*this);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD>ͷ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: Content-Type: text/plain
|
2016-01-17 13:35:12 +08:00
|
|
|
|
* @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&}
|
|
|
|
|
*/
|
2016-01-17 13:35:12 +08:00
|
|
|
|
mime& set_type(const char* ctype, const char* stype)
|
2014-11-19 00:25:21 +08:00
|
|
|
|
{
|
|
|
|
|
m_primaryHeader.set_type(ctype, stype);
|
|
|
|
|
return (*this);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD>ͷ<EFBFBD><EFBFBD><EFBFBD>ķָ<EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param s {const char*} <EFBFBD>ָ<EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @return {mime&}
|
|
|
|
|
*/
|
|
|
|
|
mime& set_boundary(const char* s)
|
|
|
|
|
{
|
|
|
|
|
m_primaryHeader.set_boundary(s);
|
|
|
|
|
return (*this);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* <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>
|
|
|
|
|
*/
|
|
|
|
|
const string& sender(void) const
|
|
|
|
|
{
|
|
|
|
|
return (m_primaryHeader.sender());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* <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>
|
|
|
|
|
*/
|
|
|
|
|
const string& from(void) const
|
|
|
|
|
{
|
|
|
|
|
return (m_primaryHeader.from());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* <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>
|
|
|
|
|
*/
|
|
|
|
|
const string& replyto(void) const
|
|
|
|
|
{
|
|
|
|
|
return (m_primaryHeader.replyto());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* <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>
|
|
|
|
|
*/
|
|
|
|
|
const string& returnpath(void) const
|
|
|
|
|
{
|
|
|
|
|
return (m_primaryHeader.returnpath());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* <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>
|
|
|
|
|
*/
|
|
|
|
|
const string& subject(void) const
|
|
|
|
|
{
|
|
|
|
|
return (m_primaryHeader.subject());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* <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>
|
|
|
|
|
*/
|
|
|
|
|
const std::list<char*>& to_list(void) const
|
|
|
|
|
{
|
|
|
|
|
return (m_primaryHeader.to_list());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* <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>
|
|
|
|
|
*/
|
|
|
|
|
const std::list<char*>& cc_list(void) const
|
|
|
|
|
{
|
|
|
|
|
return (m_primaryHeader.cc_list());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* <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>
|
|
|
|
|
*/
|
|
|
|
|
const std::list<char*>& bcc_list(void) const
|
|
|
|
|
{
|
|
|
|
|
return (m_primaryHeader.bcc_list());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ռ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>:
|
|
|
|
|
* 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>
|
|
|
|
|
*/
|
|
|
|
|
const std::list<char*>& rcpt_list(void) const
|
|
|
|
|
{
|
|
|
|
|
return (m_primaryHeader.rcpt_list());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD>ͷ<EFBFBD>ĸ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֶ<EFBFBD><EFBFBD>б<EFBFBD>
|
|
|
|
|
* @return {const std::list<HEADER*>&)
|
|
|
|
|
*/
|
|
|
|
|
const std::list<HEADER*>& header_list(void) const
|
|
|
|
|
{
|
|
|
|
|
return (m_primaryHeader.header_list());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* <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>
|
|
|
|
|
*/
|
|
|
|
|
const char* header_value(const char* name) const
|
|
|
|
|
{
|
|
|
|
|
return (m_primaryHeader.header_value(name));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* <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>
|
|
|
|
|
*/
|
|
|
|
|
int header_values(const char* name, std::list<const char*>* values) const
|
|
|
|
|
{
|
|
|
|
|
return (m_primaryHeader.header_values(name, values));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* <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>ֵ
|
|
|
|
|
*/
|
|
|
|
|
const char* get_ctype() const
|
|
|
|
|
{
|
|
|
|
|
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>ֵ
|
|
|
|
|
*/
|
|
|
|
|
const char* get_stype() const
|
|
|
|
|
{
|
|
|
|
|
return m_primaryHeader.get_stype();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD>ͷ
|
|
|
|
|
* @return {const mime_head&}
|
|
|
|
|
*/
|
|
|
|
|
const mime_head& primary_header(void) const
|
|
|
|
|
{
|
|
|
|
|
return (m_primaryHeader);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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
|