diff options
author | DongHun Kwak <dh0128.kwak@samsung.com> | 2016-10-06 10:41:18 +0900 |
---|---|---|
committer | DongHun Kwak <dh0128.kwak@samsung.com> | 2016-10-06 10:43:11 +0900 |
commit | f763a99a501650eff2c60288aa6f10ef916d769e (patch) | |
tree | 02af7e13f9a38c888ebf340fe764cbe7dae99da9 /doc/html/boost_asio/example/cpp03/http/server2/mime_types.cpp | |
parent | 5cde13f21d36c7224b0e13d11c4b49379ae5210d (diff) | |
download | boost-f763a99a501650eff2c60288aa6f10ef916d769e.tar.gz boost-f763a99a501650eff2c60288aa6f10ef916d769e.tar.bz2 boost-f763a99a501650eff2c60288aa6f10ef916d769e.zip |
Imported Upstream version 1.62.0upstream/1.62.0
Change-Id: I9d4c1ddb7b7d8f0069217ecc582700f9fda6dd4c
Signed-off-by: DongHun Kwak <dh0128.kwak@samsung.com>
Diffstat (limited to 'doc/html/boost_asio/example/cpp03/http/server2/mime_types.cpp')
-rw-r--r-- | doc/html/boost_asio/example/cpp03/http/server2/mime_types.cpp | 46 |
1 files changed, 0 insertions, 46 deletions
diff --git a/doc/html/boost_asio/example/cpp03/http/server2/mime_types.cpp b/doc/html/boost_asio/example/cpp03/http/server2/mime_types.cpp deleted file mode 100644 index 11a47a688a..0000000000 --- a/doc/html/boost_asio/example/cpp03/http/server2/mime_types.cpp +++ /dev/null @@ -1,46 +0,0 @@ -// -// mime_types.cpp -// ~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2015 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#include "mime_types.hpp" - -namespace http { -namespace server2 { -namespace mime_types { - -struct mapping -{ - const char* extension; - const char* mime_type; -} mappings[] = -{ - { "gif", "image/gif" }, - { "htm", "text/html" }, - { "html", "text/html" }, - { "jpg", "image/jpeg" }, - { "png", "image/png" }, - { 0, 0 } // Marks end of list. -}; - -std::string extension_to_type(const std::string& extension) -{ - for (mapping* m = mappings; m->extension; ++m) - { - if (m->extension == extension) - { - return m->mime_type; - } - } - - return "text/plain"; -} - -} // namespace mime_types -} // namespace server2 -} // namespace http |