159 explicit operator bool()
const;
A class that parses, handles and encapsulates a MIME-like content type.
Definition ContentType.hpp:18
const String & getTree() const
ContentType()
Creates a empty FileContentType object.
const String & getParameter(const String &name) const
ContentType(String type, String subtype, Map< String, String > parameters) noexcept
Creates a new content type from its type, subtype and parameters.
bool operator>=(const ContentType &other) const
A lexicographical comparison for a content type.
void setType(String type)
Set the type.
const Map< String, String > & getParameters() const
void setSubtype(String subtype)
Set the subtype.
ContentType(ContentType &&other) noexcept
Creates a new content type by moving the contents of another.
const String & getSubtype() const
ContentType(String type, String subtype, String tree={}, String suffix={}, Map< String, String > parameters={}) noexcept
Creates a new content type from its individual parts.
std::ostream & operator<<(std::ostream &str, const ContentType &obj)
Stream output.
String toString() const
Creates a string representation as "type[/subtype]".
void setParameters(Map< String, String > parameters)
Set the parameters.
String mSubtype
The content type "subtype" field.
Definition ContentType.hpp:27
ContentType(const char *type)
Creates a new content type by parsing a content type string.
const String & getType() const
Map< String, String > mParameters
The content type parameters.
Definition ContentType.hpp:33
const String & getSuffix() const
bool operator==(const ContentType &other) const
Checks if two contents types are equal.
void parse(StringView str)
Parses the file content type.
bool operator<(const ContentType &other) const
A lexicographical comparison for a content type.
String mType
The content type "type" field.
Definition ContentType.hpp:21
bool emptyParameters() const
ContentType & operator=(const ContentType &other)
Assigns the content type by copying the contents of another.
void setTree(String tree)
Set the tree.
bool operator!=(const ContentType &other) const
Checks if two contents types are not equal.
bool emptySubtype() const
ContentType & operator=(ContentType &&other) noexcept
Assigns the content type by moving the contents of another.
String mTree
The content type "tree" field.
Definition ContentType.hpp:24
ContentType & operator=(StringView contentType)
Assigns the content type by parsing the assigned string.
void setSuffix(String suffix)
Set the suffix.
ContentType(const ContentType &other)
Creates a new content type by copying the contents of another.
void setParameter(const String &name, String value)
Set a parameter.
String mSuffix
The content type "suffix" field.
Definition ContentType.hpp:30
bool operator>(const ContentType &other) const
A lexicographical comparison for a content type.
ContentType(StringView type)
Creates a new content type by parsing a content type string.
bool operator<=(const ContentType &other) const
A lexicographical comparison for a content type.
Definition Application.hpp:19
constexpr size_t hash(const T &v)
Generates a hash for the provided type.
Definition Hash.hpp:25
std::map< Key, T, Compare, ScopedAllocatorAdaptor< StdAllocator< Pair< const Key, T >, RawAllocator > > > Map
Map is a sorted associative container that contains key-value pairs with unique keys.
Definition Map.hpp:24