22 #include "wscontent.h" 30 const char *content_type;
37 {
"application/x-www-form-urlencoded",
"" },
38 {
"application/soap+xml",
"xml" },
39 {
"application/json",
"txt" },
40 {
"text/xml",
"xml" },
41 {
"text/plain",
"txt" },
42 {
"image/gif",
"gif" },
43 {
"image/png",
"png" },
44 {
"image/jpeg",
"jpg" },
45 {
"application/octet-stream",
"" }
48 CT_t NSROOT::ContentTypeFromMime(
const char *mime)
51 for (i = 0; i < CT_UNKNOWN; ++i)
53 if (0 == strcmp(mimetypes[i].content_type, mime))
59 const char* NSROOT::MimeFromContentType(CT_t ct)
61 if (ct >= 0 && ct < CT_UNKNOWN)
62 return mimetypes[ct].content_type;
63 return mimetypes[CT_UNKNOWN].content_type;
66 const char* NSROOT::ExtnFromContentType(CT_t ct)
68 if (ct >= 0 && ct < CT_UNKNOWN)
69 return mimetypes[ct].extn;
70 return mimetypes[CT_UNKNOWN].extn;