Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit53459a8

Browse files
glynosDean Michael Berris
authored and
Dean Michael Berris
committed
Added concept checks for HTTP request and response.
1 parent7602c3e commit53459a8

File tree

2 files changed

+83
-0
lines changed

2 files changed

+83
-0
lines changed
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
// Copyright (c) Glyn Matthews 2010.
2+
// Distributed under the Boost Software License, Version 1.0.
3+
// (See accompanying file LICENSE_1_0.txt or copy at
4+
// http://www.boost.org/LICENSE_1_0.txt)
5+
6+
7+
#ifndef __BOOST_NETWORK_PROTOCOL_HTTP_MESSAGE_REQUEST_CONCEPT_INC__
8+
#define__BOOST_NETWORK_PROTOCOL_HTTP_MESSAGE_REQUEST_CONCEPT_INC__
9+
10+
11+
#include<boost/concept_check.hpp>
12+
#include<boost/network/message/message_concept.hpp>
13+
14+
15+
namespaceboost {
16+
namespacenetwork {
17+
namespacehttp {
18+
template<
19+
classR
20+
>
21+
structRequest
22+
: Message<R> {
23+
typedeftypename R::string_type string_type;
24+
25+
BOOST_CONCEPT_USAGE(Request) {
26+
27+
string_type uri = request.uri();
28+
string_type method = request.method();
29+
string_type http_version_major = request.http_version_major();
30+
string_type http_version_minor = request.http_version_minor();
31+
32+
(void)uri;
33+
(void)method;
34+
(void)http_version_major;
35+
(void)http_version_minor;
36+
}
37+
38+
private:
39+
40+
R request;
41+
};
42+
}// namespace http
43+
}// namespace network
44+
}// namespace boost
45+
46+
47+
#endif// __BOOST_NETWORK_PROTOCOL_HTTP_MESSAGE_REQUEST_CONCEPT_INC__
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
// Copyright (c) Glyn Matthews 2010.
2+
// Distributed under the Boost Software License, Version 1.0.
3+
// (See accompanying file LICENSE_1_0.txt or copy at
4+
// http://www.boost.org/LICENSE_1_0.txt)
5+
6+
7+
#ifndef __BOOST_NETWORK_PROTOCOL_HTTP_MESSAGE_RESPONSE_CONCEPT_INC__
8+
#define__BOOST_NETWORK_PROTOCOL_HTTP_MESSAGE_RESPONSE_CONCEPT_INC__
9+
10+
11+
namespaceboost {
12+
namespacenetwork {
13+
namespacehttp {
14+
template<
15+
classR
16+
>
17+
structResponse
18+
: Message<R> {
19+
20+
BOOST_CONCEPT_USAGE(Response) {
21+
22+
// version
23+
// status
24+
// message
25+
}
26+
27+
private:
28+
29+
R response;
30+
};
31+
}// namespace http
32+
}// namespace network
33+
}// namespace boost
34+
35+
36+
#endif// __BOOST_NETWORK_PROTOCOL_HTTP_MESSAGE_RESPONSE_CONCEPT_INC__

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp