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

Commit6565e06

Browse files
committed
Adding missing files.
1 parent78363fc commit6565e06

File tree

11 files changed

+566
-0
lines changed

11 files changed

+566
-0
lines changed

‎boost/network/constants.hpp‎

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
#ifndef BOOST_NETWORK_CONSTANTS_HPP_20100808
2+
#defineBOOST_NETWORK_CONSTANTS_HPP_20100808
3+
4+
// Copyright 2010 (C) Dean Michael Berris
5+
// Distributed under the Boost Software License, Version 1.0.
6+
// (See accompanying file LICENSE_1_0.txt or copy at
7+
// http://www.boost.org/LICENSE_1_0.txt)
8+
9+
#include<boost/network/support/is_default_string.hpp>
10+
#include<boost/network/support/is_default_wstring.hpp>
11+
#include<boost/mpl/if.hpp>
12+
13+
namespaceboost {namespacenetwork {
14+
15+
namespaceimpl {
16+
template<classTag>
17+
structconstants_narrow {
18+
19+
staticcharconst *crlf() {
20+
staticchar crlf_[] = {'\r','\n',0 };
21+
return crlf_;
22+
}
23+
24+
staticcharconst *dot() {
25+
staticchar dot_[] = {'.',0 };
26+
return dot_;
27+
}
28+
29+
staticcharconst *http_slash() {
30+
staticchar http_slash_[] = {'H','T','T','P','/',0 };
31+
return http_slash_;
32+
}
33+
34+
staticcharconst *space() {
35+
staticchar space_[] = {'',0};
36+
return space_;
37+
}
38+
39+
staticcharconst *slash() {
40+
staticchar slash_[] = {'/',0};
41+
return slash_;
42+
}
43+
44+
staticcharconst *host() {
45+
staticchar host_[] = {'H','o','s','t',0};
46+
return host_;
47+
}
48+
49+
staticcharconst *colon() {
50+
staticchar colon_[] = {':',0};
51+
return colon_;
52+
}
53+
54+
staticcharconst *accept() {
55+
staticchar accept_[] = {'A','c','c','e','p','t',0};
56+
return accept_;
57+
}
58+
59+
staticcharconst *default_accept_mime() {
60+
staticchar mime_[] = {
61+
'*','/','*',0
62+
};
63+
return mime_;
64+
}
65+
66+
staticcharconst *accept_encoding() {
67+
staticchar accept_encoding_[] = {
68+
'A','c','c','e','p','t','-','E','n','c','o','d','i','n','g',0
69+
};
70+
return accept_encoding_;
71+
}
72+
73+
staticcharconst *default_accept_encoding() {
74+
staticchar default_accept_encoding_[] = {
75+
'i','d','e','n','t','i','t','y',';','q','=','1','.','0',',','','*',';','q','=','0',0
76+
};
77+
return default_accept_encoding_;
78+
}
79+
80+
staticcharconst *user_agent() {
81+
staticchar user_agent_[] = {
82+
'U','s','e','r','-','A','g','e','n','t',0
83+
};
84+
return user_agent_;
85+
}
86+
87+
staticcharconst *cpp_netlib_slash() {
88+
staticchar cpp_netlib_slash_[] = {
89+
'c','p','p','-','n','e','t','l','i','b','/',0
90+
};
91+
return cpp_netlib_slash_;
92+
}
93+
94+
};
95+
96+
template<classTag>
97+
structconstants_wide {
98+
};
99+
}
100+
101+
template<classTag>
102+
structconstants :
103+
mpl::if_<
104+
is_default_string<Tag>,
105+
impl::constants_narrow<Tag>,
106+
typename mpl::if_<
107+
is_default_wstring<Tag>,
108+
impl::constants_wide<Tag>,
109+
unsupported_tag<Tag>
110+
>::type
111+
>::type
112+
{};
113+
114+
}// namespace network
115+
116+
}// namespace boost
117+
118+
#endif// BOOST_NETWORK_CONSTANTS_HPP_20100808
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
2+
#ifndef BOOST_NETWORK_MESSAGE_MODIFIER_ADD_HEADER_HPP_20100824
3+
#defineBOOST_NETWORK_MESSAGE_MODIFIER_ADD_HEADER_HPP_20100824
4+
5+
// Copyright 2010 (c) Dean Michael Berris
6+
// Distributed under the Boost Software License, Version 1.0.
7+
// (See accompanying file LICENSE_1_0.txt or copy at
8+
// http://www.boost.org/LICENSE_1_0.txt)
9+
10+
#include<boost/network/support/is_async.hpp>
11+
12+
namespaceboost {namespacenetwork {
13+
14+
namespaceimpl {
15+
template<classMessage,classKeyType,classValueType>
16+
inlinevoidadd_header(Messageconst & message, KeyTypeconst & key, ValueTypeconst & value, tags::default_stringconst &, mpl::false_const &) {
17+
message.headers().insert(std::make_pair(key, value));
18+
}
19+
20+
template<classMessage,classKeyType,classValueType>
21+
inlinevoidadd_header(Messageconst & message, KeyTypeconst & key, ValueTypeconst & value, tags::default_wstringconst &, mpl::false_const &) {
22+
message.headers().insert(std::make_pair(key, value));
23+
}
24+
25+
template<classMessage,classKeyType,classValueType>
26+
inlinevoidadd_header(Messageconst & message, KeyTypeconst & key, ValueTypeconst & value, tags::asyncconst &, mpl::true_const &) {
27+
message.add_header(std::make_pair(key, value));
28+
}
29+
30+
}
31+
32+
template<classTag,template<class>classMessage,classKeyType,classValueType>
33+
inlinevoidadd_header(Message<Tag>const & message, KeyTypeconst & key, ValueTypeconst & value) {
34+
impl::add_header(message, key, value,Tag(), is_async<Tag>());
35+
}
36+
37+
}// namespace network
38+
39+
}// namespace boost
40+
41+
#endif// BOOST_NETWORK_MESSAGE_MODIFIER_ADD_HEADER_HPP_20100824
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#ifndef BOOST_NETWORK_MODIFIERS_BODY_HPP_20100824
2+
#defineBOOST_NETWORK_MODIFIERS_BODY_HPP_20100824
3+
4+
// Copyright 2010 (c) Dean Michael Berris
5+
// Distributed under the Boost Software License, Version 1.0.
6+
// (See accompanying file LICENSE_1_0.txt or copy at
7+
// http://www.boost.org/LICENSE_1_0.txt)
8+
9+
#include<boost/network/support/is_async.hpp>
10+
#include<boost/thread/future.hpp>
11+
12+
namespaceboost {namespacenetwork {
13+
14+
namespaceimpl {
15+
16+
template<classMessage,classValueType,classTag>
17+
inlinevoidbody(Messageconst & message, ValueTypeconst & body_, Tagconst &, mpl::false_const &) {
18+
message.body(body_);
19+
}
20+
21+
template<classMessage,classValueType,classTag>
22+
inlinevoidbody(Messageconst & message, ValueTypeconst & body_, Tagconst &, mpl::true_const &) {
23+
message.body(body_);
24+
}
25+
26+
}// namespace impl
27+
28+
template<classTag,template<class>classMessage,classValueType>
29+
inlinevoidbody(Message<Tag>const & message, ValueTypeconst & body_) {
30+
impl::body(message, body_,Tag(), is_async<Tag>());
31+
}
32+
33+
}// namespace network
34+
35+
}// namespace boost
36+
37+
#endif// BOOST_NETWORK_MODIFIERS_BODY_HPP_20100824
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#ifndef BOOST_NETWORK_MESSAGE_MODIFIER_CLEAR_HEADERS_HPP_20100824
2+
#defineBOOST_NETWORK_MESSAGE_MODIFIER_CLEAR_HEADERS_HPP_20100824
3+
4+
// Copyright 2010 (c) Dean Michael Berris
5+
// Distributed under the Boost Software License, Version 1.0.
6+
// (See accompanying file LICENSE_1_0.txt or copy at
7+
// http://www.boost.org/LICENSE_1_0.txt)
8+
9+
#include<boost/network/support/is_async.hpp>
10+
#include<boost/thread/future.hpp>
11+
12+
namespaceboost {namespacenetwork {
13+
14+
namespaceimpl {
15+
template<classMessage>
16+
inlinevoidclear_headers(Messageconst & message, mpl::false_const &) {
17+
(typenameMessage::headers_container_type()).swap(message.headers());
18+
}
19+
20+
template<classMessage>
21+
inlinevoidclear_headers(Messageconst & message, mpl::true_const &) {
22+
boost::promise<typename Message::headers_container_type> header_promise;
23+
boost::shared_future<typename Message::headers_container_type> headers_future = header_promise.get_future();
24+
message.headers(headers_future);
25+
header_promise.set_value(typenameMessage::headers_container_type());
26+
}
27+
28+
}// namespace impl
29+
30+
template<classTag,template<class>classMessage>
31+
inlinevoidclear_headers(Message<Tag>const & message) {
32+
impl::clear_headers(message, is_async<Tag>());
33+
}
34+
35+
}// namespace network
36+
37+
}// namespace boost
38+
39+
#endif// BOOST_NETWORK_MESSAGE_MODIFIER_CLEAR_HEADERS_HPP_20100824
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
2+
#ifndef BOOST_NETWORK_MESSAGE_MODIFIER_DESTINATION_HPP_20100824
3+
#defineBOOST_NETWORK_MESSAGE_MODIFIER_DESTINATION_HPP_20100824
4+
5+
// Copyright 2010 (c) Dean Michael Berris
6+
// Distributed under the Boost Software License, Version 1.0.
7+
// (See accompanying file LICENSE_1_0.txt or copy at
8+
// http://www.boost.org/LICENSE_1_0.txt)
9+
10+
#include<boost/network/support/is_async.hpp>
11+
#include<boost/thread/future.hpp>
12+
13+
namespaceboost {namespacenetwork {
14+
15+
namespaceimpl {
16+
17+
template<classMessage,classValueType,classTag>
18+
inlinevoiddestination(Messageconst & message, ValueTypeconst & destination_, Tagconst &, mpl::false_const &){
19+
message.destination(destination_);
20+
}
21+
22+
template<classMessage,classValueType,classTag>
23+
inlinevoiddestination(Messageconst & message, ValueTypeconst & destination_, Tagconst &, mpl::true_const &) {
24+
message.destination(destination_);
25+
}
26+
}
27+
28+
template<classTag,template<class>classMessage,classValueType>
29+
inlinevoiddestination(Message<Tag>const & message, ValueTypeconst & destination_) {
30+
impl::destination(message, destination_,Tag(), is_async<Tag>());
31+
}
32+
33+
}// namespace network
34+
35+
}// namespace boost
36+
37+
#endif// BOOST_NETWORK_MESSAGE_MODIFIER_DESTINATION_HPP_20100824
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
2+
#ifndef BOOST_NETWORK_MESSAGE_MODIFIER_REMOVE_HEADER_HPP_20100824
3+
#defineBOOST_NETWORK_MESSAGE_MODIFIER_REMOVE_HEADER_HPP_20100824
4+
5+
// Copyright 2010 (c) Dean Michael Berris
6+
// Distributed under the Boost Software License, Version 1.0.
7+
// (See accompanying file LICENSE_1_0.txt or copy at
8+
// http://www.boost.org/LICENSE_1_0.txt)
9+
10+
#include<boost/network/support/is_async.hpp>
11+
12+
namespaceboost {namespacenetwork {
13+
14+
namespaceimpl {
15+
16+
template<classMessage,classKeyType>
17+
inlinevoidremove_header(Messageconst & message, KeyTypeconst & key, tags::default_stringconst &, mpl::false_const &) {
18+
message.headers().erase(key);
19+
}
20+
21+
template<classMessage,classKeyType>
22+
inlinevoidremove_header(Messageconst & message, KeyTypeconst & key, tags::default_wstringconst &, mpl::false_const &) {
23+
message.headers().erase(key);
24+
}
25+
26+
template<classMessage,classKeyType,classTag>
27+
inlinevoidremove_header(Messageconst & message, KeyTypeconst & key, Tagconst &, mpl::true_const &) {
28+
message.remove_header(key);
29+
}
30+
31+
}// namespace impl
32+
33+
template<classTag,template<class>classMessage,classKeyType>
34+
inlinevoidremove_header(Message<Tag>const & message, KeyTypeconst & key) {
35+
impl::remove_header(message, key,Tag(), is_async<Tag>());
36+
}
37+
38+
}// namespace network
39+
40+
}// namespace boost
41+
42+
#endif// BOOST_NETWORK_MESSAGE_MODIFIER_REMOVE_HEADER_HPP_20100824
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
2+
#ifndef BOOST_NETWORK_MESSAGE_MODIFIER_SOURCE_HPP_20100824
3+
#defineBOOST_NETWORK_MESSAGE_MODIFIER_SOURCE_HPP_20100824
4+
5+
// Copyright 2010 (c) Dean Michael Berris
6+
// Distributed under the Boost Software License, Version 1.0.
7+
// (See accompanying file LICENSE_1_0.txt or copy at
8+
// http://www.boost.org/LICENSE_1_0.txt)
9+
10+
#include<boost/network/support/is_async.hpp>
11+
12+
namespaceboost {namespacenetwork {
13+
14+
namespaceimpl {
15+
16+
template<classMessage,classValueType,classTag>
17+
inlinevoidsource(Messageconst & message, ValueTypeconst & source_, Tagconst &, mpl::false_const &) {
18+
message.source(source_);
19+
}
20+
21+
template<classMessage,classValueType,classTag>
22+
inlinevoidsource(Messageconst & message, ValueTypeconst & source_, Tagconst &, mpl::true_const &) {
23+
message.source(source_);
24+
}
25+
26+
}// namespace impl
27+
28+
template<classTag,template<class>classMessage,classValueType>
29+
inlinevoidsource(Message<Tag>const & message, ValueTypeconst & source_) {
30+
impl::source(message, source_,Tag(), is_async<Tag>());
31+
}
32+
33+
}// namespace network
34+
35+
}// namespace boost
36+
37+
#endif// BOOST_NETWORK_MESSAGE_MODIFIER_SOURCE_HPP_20100824

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp