class mime_view
#
-
class mime_view#
A non-owning reference to a valid MIME type.
Public Functions
-
inline auto source() const noexcept -> name_view#
Get complete string of the mime.
- DESCRIPTION
Get complete string of the mime.
"text/plain; charset=utf-8"
->"text/plain; charset=utf-8"
"image/svg+xml"
->"image/svg+xml"
-
inline auto essence() const noexcept -> name_view#
Get essense part of the mime.
- DESCRIPTION
Get essense part of the mime.
"text/plain; charset=utf-8"
->"text/plain"
"image/svg+xml"
->"image/svg+xml"
-
inline auto type() const noexcept -> name_view#
Get type part of the mime.
- DESCRIPTION
Get type part of the mime.
"text/plain; charset=utf-8"
->"text"
"image/svg+xml"
->"image"
-
inline auto subtype() const noexcept -> name_view#
Get subtype part of the mime.
- DESCRIPTION
Get subtype part of the mime.
"text/plain; charset=utf-8"
->"plain"
"image/svg+xml"
->"svg"
-
inline auto suffix() const noexcept -> optional<name_view>#
Get suffix part of the mime.
- DESCRIPTION
Get suffix part of the mime.
"text/plain; charset=utf-8"
->nullopt
"image/svg+xml"
->"xml"
-
inline auto params() const noexcept -> const params_view&#
Get parameters of the mime.
- DESCRIPTION
Get parameters of the mime.
"text/plain; charset=utf-8"
->{ { "charset", "utf-8" } }
"image/svg+xml"
->{}
-
inline operator std::string_view() const noexcept#
Get complete string of the mime.
- DESCRIPTION
Get complete string of the mime.
"text/plain; charset=utf-8"
->"text/plain; charset=utf-8"
"image/svg+xml"
->"image/svg+xml"
Public Static Functions
-
static inline auto parse(std::string_view str) -> optional<mime_view>#
Parses a string into
mime_view
.
Friends
-
inline friend auto operator==(const mime_view &lhs, const mime_view &rhs) -> bool#
Compare
mime_view
s for equality.- DESCRIPTION
Compare
mime_view
s for equality. It’s considered equivalent if and only if thesource
ofmime_view
s are case-insensitively equivalent.
-
inline friend auto operator==(const mime_view &lhs, const std::string_view &rhs) -> bool#
Compare
mime_view
‘s equivalence against a string.- DESCRIPTION
Compare
mime_view
‘s equivalence against a string. It’s considered equivalent if and only if thesource
of themime_view
are case-insensitively equivalent to the string.
-
inline auto source() const noexcept -> name_view#
-
inline auto fitoria::mime::application_octet_stream() noexcept -> mime_view#
"application/octet-stream"
-
inline auto fitoria::mime::application_shockwave_flash() noexcept -> mime_view#
"application/x-shockwave-flash"