p≡p MIME library
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

45 lines
1.0 KiB

#ifndef PEP_MIME_MIME_HEADERS_HH
#define PEP_MIME_MIME_HEADERS_HH
#include "pEpMIME_internal.hh"
namespace pEpMIME
{
struct ContentType
{
//ContentType() = default;
ContentType(sv header_line);
std::string type;
std::string subtype;
std::vector<NameValue> tparams;
void tolower(); // only for ASCII chars, but that's sufficient here.
void sanitize()
{
tolower();
if(type.empty()) { type = "text"; subtype="plain"; }
}
};
struct ContentDisposition
{
ContentDisposition(sv header_line);
content_disposition_type dispo_type;
std::vector<NameValue> dparams;
};
struct MimeHeaders : public ContentType, public ContentDisposition
{
typedef char* (*Decoder)(const BodyLines&, size_t&);
MimeHeaders(const HeaderSection& headers);
std::string transfer_encoding;
Decoder decoder;
};
} // end of namespace pEpMIME
#endif // PEP_MIME_MIME_HEADERS_HH