00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00043 #ifndef COMMONCPP_MIME_H_
00044 #define COMMONCPP_MIME_H_
00045
00046 #ifndef COMMONCPP_CONFIG_H_
00047 #include <commoncpp/config.h>
00048 #endif
00049
00050 #ifndef COMMONCPP_SOCKET_H_
00051 #include <commoncpp/socket.h>
00052 #endif
00053
00054 NAMESPACE_COMMONCPP
00055
00056 class MIMEMultipart;
00057 class MIMEItemPart;
00058
00066 class __EXPORT MIMEMultipart
00067 {
00068 protected:
00069 friend class MIMEItemPart;
00070 char boundry[8];
00071 char mtype[80];
00072 char *header[16];
00073 MIMEItemPart *first, *last;
00074
00075 virtual ~MIMEMultipart();
00076
00077 public:
00083 MIMEMultipart(const char *document);
00084
00091 virtual void head(std::ostream *output);
00092
00099 virtual void body(std::ostream *output);
00100
00107 char **getHeaders(void)
00108 {return header;};
00109 };
00110
00119 class __EXPORT MIMEMultipartForm : public MIMEMultipart
00120 {
00121 protected:
00122 virtual ~MIMEMultipartForm();
00123
00124 public:
00129 MIMEMultipartForm();
00130 };
00131
00140 class __EXPORT MIMEItemPart
00141 {
00142 protected:
00143 friend class MIMEMultipart;
00144
00145 MIMEMultipart *base;
00146 MIMEItemPart *next;
00147 const char *ctype;
00148
00154 virtual void head(std::ostream *output);
00155
00161 virtual void body(std::ostream *output) = 0;
00162
00169 MIMEItemPart(MIMEMultipart *top, const char *ct);
00170
00171 virtual ~MIMEItemPart();
00172 };
00173
00181 class __EXPORT MIMEFormData : public MIMEItemPart
00182 {
00183 protected:
00184 const char *content;
00185 const char *name;
00186
00187 virtual ~MIMEFormData();
00188
00189 public:
00195 void head(std::ostream *output);
00196
00202 void body(std::ostream *output);
00203
00211 MIMEFormData(MIMEMultipartForm *top, const char *name, const char *content);
00212 };
00213
00214 END_NAMESPACE
00215
00216 #endif
00217