diff --git a/Release/include/cpprest/details/http_helpers.h b/Release/include/cpprest/details/http_helpers.h index fd6c3c1ffa..a7c589b996 100644 --- a/Release/include/cpprest/details/http_helpers.h +++ b/Release/include/cpprest/details/http_helpers.h @@ -34,45 +34,16 @@ namespace web { namespace http namespace details { - /// - /// Constants for MIME types. - /// - class mime_types - { - public: - #define _MIME_TYPES - #define DAT(a,b) _ASYNCRTIMP const static utility::string_t a; - #include "cpprest/details/http_constants.dat" - #undef _MIME_TYPES - #undef DAT - }; - - /// - /// Constants for charset types. - /// - class charset_types - { - public: - #define _CHARSET_TYPES - #define DAT(a,b) _ASYNCRTIMP const static utility::string_t a; - #include "cpprest/details/http_constants.dat" - #undef _CHARSET_TYPES - #undef DAT - }; - /// /// Helper function to get the default HTTP reason phrase for a status code. /// utility::string_t get_default_reason_phrase(status_code code); // simple helper functions to trim whitespace. - _ASYNCRTIMP void __cdecl ltrim_whitespace(utility::string_t &str); - _ASYNCRTIMP void __cdecl rtrim_whitespace(utility::string_t &str); _ASYNCRTIMP void __cdecl trim_whitespace(utility::string_t &str); bool validate_method(const utility::string_t& method); - namespace chunked_encoding { // Transfer-Encoding: chunked support diff --git a/Release/include/cpprest/http_msg.h b/Release/include/cpprest/http_msg.h index 9ad32d937b..90669accc4 100644 --- a/Release/include/cpprest/http_msg.h +++ b/Release/include/cpprest/http_msg.h @@ -89,6 +89,36 @@ class status_codes #undef DAT }; +namespace details { + +/// +/// Constants for MIME types. +/// +class mime_types +{ +public: +#define _MIME_TYPES +#define DAT(a,b) _ASYNCRTIMP const static utility::string_t a; +#include "cpprest/details/http_constants.dat" +#undef _MIME_TYPES +#undef DAT +}; + +/// +/// Constants for charset types. +/// +class charset_types +{ +public: +#define _CHARSET_TYPES +#define DAT(a,b) _ASYNCRTIMP const static utility::string_t a; +#include "cpprest/details/http_constants.dat" +#undef _CHARSET_TYPES +#undef DAT +}; + +} + /// Message direction namespace message_direction { diff --git a/Release/src/http/common/http_helpers.cpp b/Release/src/http/common/http_helpers.cpp index a5baccf976..75ef626820 100644 --- a/Release/src/http/common/http_helpers.cpp +++ b/Release/src/http/common/http_helpers.cpp @@ -72,13 +72,13 @@ utility::string_t get_default_reason_phrase(status_code code) } -void ltrim_whitespace(utility::string_t &str) +static void ltrim_whitespace(utility::string_t &str) { size_t index; for (index = 0; index < str.size() && isspace(str[index]); ++index); str.erase(0, index); } -void rtrim_whitespace(utility::string_t &str) +static void rtrim_whitespace(utility::string_t &str) { size_t index; for (index = str.size(); index > 0 && isspace(str[index - 1]); --index);