26#ifndef MYSQLROUTER_HTTP_CONTENT_TYPE_INCLUDED
27#define MYSQLROUTER_HTTP_CONTENT_TYPE_INCLUDED
38 static constexpr const char ApplicationJavascript[] =
39 "application/javascript";
40 static constexpr const char ApplicationJson[] =
"application/json";
41 static constexpr const char ApplicationOctetStream[] =
42 "application/octet-stream";
43 static constexpr const char TextCss[] =
"text/css";
44 static constexpr const char TextHtml[] =
"text/html";
45 static constexpr const char ImageJpeg[] =
"image/jpeg";
46 static constexpr const char ImagePng[] =
"image/png";
47 static constexpr const char ImageSvgXML[] =
"image/svg+xml";
64 const std::array<std::pair<std::string, const char *>, 9> mimetypes{{
83 extension.begin(), extension.end(), extension.begin(),
84 [](
char c) { return (c >=
'A' && c <=
'Z') ? c + (
'z' -
'Z') : c; });
86 auto low_bound_it = std::lower_bound(
87 mimetypes.begin(), mimetypes.end(), extension,
88 [](
const auto &a,
const auto &_ext) { return a.first < _ext; });
91 return (low_bound_it != mimetypes.end() && low_bound_it->first == extension)
92 ? low_bound_it->second
Definition: content_type.h:50
static const char * from_extension(std::string extension)
get a mimetype for a file-extension.
Definition: content_type.h:62
Definition: content_type.h:35
static constexpr const char ImageSvgXML[]
Definition: content_type.h:47
static constexpr const char ImageJpeg[]
Definition: content_type.h:45
static constexpr const char TextCss[]
Definition: content_type.h:43
static constexpr const char ImagePng[]
Definition: content_type.h:46
static constexpr const char ApplicationOctetStream[]
Definition: content_type.h:41
static constexpr const char TextHtml[]
Definition: content_type.h:44
static constexpr const char ApplicationJson[]
Definition: content_type.h:40
static constexpr const char ApplicationJavascript[]
Definition: content_type.h:38
#define HTTP_SERVER_EXPORT
Definition: http_server_export.h:40
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