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 const std::array<std::pair<std::string, const char *>, 9> mimetypes{{
81 extension.begin(), extension.end(), extension.begin(),
82 [](
char c) { return (c >=
'A' && c <=
'Z') ? c + (
'z' -
'Z') : c; });
84 auto low_bound_it = std::lower_bound(
85 mimetypes.begin(), mimetypes.end(), extension,
86 [](
const auto &a,
const auto &_ext) { return a.first < _ext; });
89 return (low_bound_it != mimetypes.end() && low_bound_it->first == extension)
90 ? 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