Skip to content

Commit 9b5ecb1

Browse files
ras0219ras0219-msft
authored andcommitted
Move mime_types and charset_types to the header matching the defining cpp
1 parent 9869462 commit 9b5ecb1

File tree

3 files changed

+32
-31
lines changed

3 files changed

+32
-31
lines changed

Release/include/cpprest/details/http_helpers.h

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -34,45 +34,16 @@ namespace web { namespace http
3434
namespace details
3535
{
3636

37-
/// <summary>
38-
/// Constants for MIME types.
39-
/// </summary>
40-
class mime_types
41-
{
42-
public:
43-
#define _MIME_TYPES
44-
#define DAT(a,b) _ASYNCRTIMP const static utility::string_t a;
45-
#include "cpprest/details/http_constants.dat"
46-
#undef _MIME_TYPES
47-
#undef DAT
48-
};
49-
50-
/// <summary>
51-
/// Constants for charset types.
52-
/// </summary>
53-
class charset_types
54-
{
55-
public:
56-
#define _CHARSET_TYPES
57-
#define DAT(a,b) _ASYNCRTIMP const static utility::string_t a;
58-
#include "cpprest/details/http_constants.dat"
59-
#undef _CHARSET_TYPES
60-
#undef DAT
61-
};
62-
6337
/// <summary>
6438
/// Helper function to get the default HTTP reason phrase for a status code.
6539
/// </summary>
6640
utility::string_t get_default_reason_phrase(status_code code);
6741

6842
// simple helper functions to trim whitespace.
69-
_ASYNCRTIMP void __cdecl ltrim_whitespace(utility::string_t &str);
70-
_ASYNCRTIMP void __cdecl rtrim_whitespace(utility::string_t &str);
7143
_ASYNCRTIMP void __cdecl trim_whitespace(utility::string_t &str);
7244

7345
bool validate_method(const utility::string_t& method);
7446

75-
7647
namespace chunked_encoding
7748
{
7849
// Transfer-Encoding: chunked support

Release/include/cpprest/http_msg.h

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,36 @@ class status_codes
8989
#undef DAT
9090
};
9191

92+
namespace details {
93+
94+
/// <summary>
95+
/// Constants for MIME types.
96+
/// </summary>
97+
class mime_types
98+
{
99+
public:
100+
#define _MIME_TYPES
101+
#define DAT(a,b) _ASYNCRTIMP const static utility::string_t a;
102+
#include "cpprest/details/http_constants.dat"
103+
#undef _MIME_TYPES
104+
#undef DAT
105+
};
106+
107+
/// <summary>
108+
/// Constants for charset types.
109+
/// </summary>
110+
class charset_types
111+
{
112+
public:
113+
#define _CHARSET_TYPES
114+
#define DAT(a,b) _ASYNCRTIMP const static utility::string_t a;
115+
#include "cpprest/details/http_constants.dat"
116+
#undef _CHARSET_TYPES
117+
#undef DAT
118+
};
119+
120+
}
121+
92122
/// Message direction
93123
namespace message_direction
94124
{

Release/src/http/common/http_helpers.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,13 +72,13 @@ utility::string_t get_default_reason_phrase(status_code code)
7272
}
7373

7474

75-
void ltrim_whitespace(utility::string_t &str)
75+
static void ltrim_whitespace(utility::string_t &str)
7676
{
7777
size_t index;
7878
for (index = 0; index < str.size() && isspace(str[index]); ++index);
7979
str.erase(0, index);
8080
}
81-
void rtrim_whitespace(utility::string_t &str)
81+
static void rtrim_whitespace(utility::string_t &str)
8282
{
8383
size_t index;
8484
for (index = str.size(); index > 0 && isspace(str[index - 1]); --index);

0 commit comments

Comments
 (0)