![]() |
Spicy
|
#include <mime.h>
Public Member Functions | |
MIMEType (std::string_view main, std::string_view sub) | |
MIMEType (const std::string &type) | |
std::string | mainType () const |
std::string | subType () const |
bool | isWildcard () const |
MIMEType (const MIMEType &)=default | |
MIMEType (MIMEType &&) noexcept=default | |
MIMEType & | operator= (const MIMEType &)=default |
MIMEType & | operator= (MIMEType &&) noexcept=default |
operator std::string () const | |
std::string | asKey () const |
Static Public Member Functions | |
static hilti::rt::Result< MIMEType > | parse (const std::string &s) |
Friends | |
bool | operator== (const MIMEType &a, const MIMEType &b) |
bool | operator!= (const MIMEType &a, const MIMEType &b) |
Type representing a MIME type consisting of main type and a subtype.
|
inline |
Initializes a MIME type from provided main and sub type.
main | main type, with '*' meaning a catch-all wildcard. |
sub | main type, with '*' meaning a catch-all wildcard. |
|
inline |
Initializes a MIME type from provided string of the form main/sub
.
mt | string main/sub |
<tt>InvalidMIMEType</tt> | if it cannot parse the type |
|
inline |
Converts the type into textual key suitable for using as an index in map.
main/sub
form.
|
inline |
Returns true if either type or subtype is a wildcard.
|
inline |
Returns the main type, with '*' reflecting a wildcard.
|
inlinestatic |
Parses a string a/b
into a MIME type.
string | of the form main/sub . |
|
inline |
Returns the sub type, with '*' reflecting a wildcard.