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
00038
00044 #ifndef CCXX_MIME_H_
00045 #define CCXX_MIME_H_
00046
00047 #ifndef CCXX_CONFIG_H_
00048 #include <cc++/config.h>
00049 #endif
00050
00051 #ifndef CCXX_SOCKET_H_
00052 #include <cc++/socket.h>
00053 #endif
00054
00055 #ifdef CCXX_NAMESPACES
00056 namespace ost {
00057 #endif
00058
00059 class __EXPORT MIMEMultipart;
00060 class __EXPORT MIMEItemPart;
00061
00069 class __EXPORT MIMEMultipart
00070 {
00071 protected:
00072 friend class __EXPORT MIMEItemPart;
00073 char boundry[8];
00074 char mtype[80];
00075 char *header[16];
00076 MIMEItemPart *first, *last;
00077
00078 virtual ~MIMEMultipart();
00079
00080 public:
00086 MIMEMultipart(const char *document);
00087
00094 virtual void head(std::ostream *output);
00095
00102 virtual void body(std::ostream *output);
00103
00110 char **getHeaders(void)
00111 {return header;};
00112 };
00113
00122 class __EXPORT MIMEMultipartForm : public MIMEMultipart
00123 {
00124 protected:
00125 virtual ~MIMEMultipartForm();
00126
00127 public:
00132 MIMEMultipartForm();
00133 };
00134
00143 class __EXPORT MIMEItemPart
00144 {
00145 protected:
00146 friend class __EXPORT MIMEMultipart;
00147
00148 MIMEMultipart *base;
00149 MIMEItemPart *next;
00150 const char *ctype;
00151
00157 virtual void head(std::ostream *output);
00158
00164 virtual void body(std::ostream *output) = 0;
00165
00172 MIMEItemPart(MIMEMultipart *top, const char *ct);
00173
00174 virtual ~MIMEItemPart();
00175 };
00176
00184 class __EXPORT MIMEFormData : public MIMEItemPart
00185 {
00186 protected:
00187 const char *content;
00188 const char *name;
00189
00190 virtual ~MIMEFormData();
00191
00192 public:
00198 void head(std::ostream *output);
00199
00205 void body(std::ostream *output);
00206
00214 MIMEFormData(MIMEMultipartForm *top, const char *name, const char *content);
00215 };
00216
00217 #ifdef CCXX_NAMESPACES
00218 }
00219 #endif
00220
00221 #endif
00222