acl  3.5.3.0
mime_head.hpp
浏览该文件的文档.
1 #pragma once
2 #include "../acl_cpp_define.hpp"
3 #include "../stdlib/string.hpp"
4 #include "../stdlib/noncopyable.hpp"
5 #include <list>
6 
7 #if !defined(ACL_MIME_DISABLE)
8 
9 namespace acl {
10 
11 typedef struct HEADER
12 {
13  char *name;
14  char *value;
15 } HEADER;
16 
18 {
19 public:
20  mime_head(void);
21  ~mime_head(void);
22 
23  const string& get_boundary(void) const;
24  const char* get_ctype(void) const;
25  const char* get_stype(void) const;
26  const string& sender(void) const;
27  const string& from(void) const;
28  const string& replyto(void) const;
29  const string& returnpath(void) const;
30  const string& subject(void) const;
31  const std::list<char*>& to_list(void) const;
32  const std::list<char*>& cc_list(void) const;
33  const std::list<char*>& bcc_list(void) const;
34  const std::list<char*>& rcpt_list(void) const;
35  const std::list<HEADER*>& header_list(void) const;
36  const char* header_value(const char* name) const;
37  int header_values(const char* name, std::list<const char*>* values) const;
38 
39  mime_head& set_sender(const char*);
40  mime_head& set_from(const char*);
41  mime_head& set_replyto(const char*);
42  mime_head& set_returnpath(const char*);
43  mime_head& set_subject(const char*);
44  mime_head& add_to(const char*);
45  mime_head& add_cc(const char*);
46  mime_head& add_bcc(const char*);
47  mime_head& add_rcpt(const char*);
48  mime_head& add_header(const char*, const char*);
49  mime_head& set_type(const char*, const char*);
50  mime_head& set_boundary(const char*);
51 
52  void build_head(string& buf, bool clean);
53 
54  mime_head& reset(void);
55 
56 protected:
57 private:
58  string* m_boundary;
59  std::list<char*>* m_rcpts;
60  std::list<char*>* m_tos;
61  std::list<char*>* m_ccs;
62  std::list<char*>* m_bccs;
63  std::list<HEADER*>* m_headers;
64  string* m_sender;
65  string* m_from;
66  string* m_replyto;
67  string* m_returnpath;
68  string* m_subject;
69 
70  string m_ctype;
71  string m_stype;
72 };
73 
74 } // namespace acl
75 
76 #endif // !defined(ACL_MIME_DISABLE)
HTTP_API void const char * name
Definition: lib_http.h:620
char * name
Definition: mime_head.hpp:13
char * value
Definition: mime_head.hpp:14
struct acl::HEADER HEADER
#define ACL_CPP_API