26#ifndef MYSQLROUTER_HTTP_CONTENT_TYPE_INCLUDED
27#define MYSQLROUTER_HTTP_CONTENT_TYPE_INCLUDED
37 "application/javascript";
40 "application/octet-stream";
41 static constexpr const char TextCss[] =
"text/css";
42 static constexpr const char TextHtml[] =
"text/html";
43 static constexpr const char ImageJpeg[] =
"image/jpeg";
44 static constexpr const char ImagePng[] =
"image/png";
62 constexpr auto mimetypes =
63 std::to_array<std::pair<std::string_view, const char *>>({
82 extension.begin(), extension.end(), extension.begin(),
83 [](
char c) { return (c >=
'A' && c <=
'Z') ? c + (
'z' -
'Z') : c; });
85 const auto low_bound_it = std::lower_bound(
86 mimetypes.begin(), mimetypes.end(), extension,
87 [](
const auto &a,
const auto &_ext) { return a.first < _ext; });
90 return (low_bound_it != mimetypes.end() && low_bound_it->first == extension)
91 ? low_bound_it->second
Definition: content_type.h:48
static const char * from_extension(std::string extension)
get a mimetype for a file-extension.
Definition: content_type.h:60
Definition: content_type.h:33
static constexpr const char ImageSvgXML[]
Definition: content_type.h:45
static constexpr const char ImageJpeg[]
Definition: content_type.h:43
static constexpr const char TextCss[]
Definition: content_type.h:41
static constexpr const char ImagePng[]
Definition: content_type.h:44
static constexpr const char ApplicationOctetStream[]
Definition: content_type.h:39
static constexpr const char TextHtml[]
Definition: content_type.h:42
static constexpr const char ApplicationJson[]
Definition: content_type.h:38
static constexpr const char ApplicationJavascript[]
Definition: content_type.h:36
bool transform(const dd::Spatial_reference_system *source_srs, const Geometry &in, const dd::Spatial_reference_system *target_srs, const char *func_name, std::unique_ptr< Geometry > *out) noexcept
Transforms a geometry from one SRS to another.
Definition: transform.cc:216