Thoth
A functional, expressive, asynchronous C++26 webdev library
Loading...
Searching...
No Matches
MimeType.hpp
Go to the documentation of this file.
1#pragma once
2#include <string>
3#include <optional>
5
6namespace Thoth::Http::NHeaders {
7 struct MimeType {
8 std::string type{};
9 std::string subtype{};
10 std::vector<std::pair<std::string, std::string>> options{};
11
12 bool operator==(const MimeType& other) const;
13 };
14
15 struct MimeTypes {
16 MimeTypes() = delete;
17
18 inline static const MimeType textPlain { "text", "plain" };
19 inline static const MimeType textHtml { "text", "html" };
20 inline static const MimeType appJson { "application", "json" };
21 inline static const MimeType appXml { "application", "xml" };
22 inline static const MimeType appOctetStream { "application", "octet-stream" };
23 inline static const MimeType imagePng { "image", "png" };
24 inline static const MimeType imageJpeg { "image", "jpeg" };
25 inline static const MimeType multipartForm { "multipart", "form-data" };
26 };
27}
28
29#include <Thoth/Http/NHeaders/Headers/MimeType.tpp>
Definition _base.hpp:5
Definition MimeType.hpp:7
std::vector< std::pair< std::string, std::string > > options
Definition MimeType.hpp:10
std::string type
Definition MimeType.hpp:8
std::string subtype
Definition MimeType.hpp:9
bool operator==(const MimeType &other) const
Definition MimeType.hpp:15
static const MimeType appJson
Definition MimeType.hpp:20
static const MimeType multipartForm
Definition MimeType.hpp:25
static const MimeType appOctetStream
Definition MimeType.hpp:22
static const MimeType textPlain
Definition MimeType.hpp:18
static const MimeType appXml
Definition MimeType.hpp:21
static const MimeType textHtml
Definition MimeType.hpp:19
static const MimeType imagePng
Definition MimeType.hpp:23
static const MimeType imageJpeg
Definition MimeType.hpp:24