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

Commit2e18f32

Browse files
committed
Merging from master to the netbook repo.
2 parents0ea9725 +9e4899e commit2e18f32

File tree

168 files changed

+8834
-2107
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

168 files changed

+8834
-2107
lines changed

‎.gitignore‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ CMakeCache.txt
55
CMakeFiles
66
Makefile
77
Testing
8+
build
9+
_build
810
bin
911
*.gch
1012

‎CMakeLists.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ endif()
1414
enable_testing()
1515
add_subdirectory(libs/network/test)
1616
add_subdirectory(libs/mime/test)
17-
17+
add_subdirectory(libs/network/example)

‎boost/mime.hpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ namespace detail {
362362

363363

364364
template<typename Iterator,typename traits>
365-
boost::shared_ptr< basic_mime<traits> >parse_mime ( Iterator &begin, Iterator end,constchar *default_content_type ="text/plain" );
365+
staticboost::shared_ptr< basic_mime<traits> >parse_mime ( Iterator &begin, Iterator end,constchar *default_content_type ="text/plain" );
366366
}
367367

368368

‎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

‎boost/network/message.hpp‎

Lines changed: 43 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,22 @@
66
#ifndef __NETWORK_MESSAGE_HPP__
77
#define__NETWORK_MESSAGE_HPP__
88

9-
#include<map>
10-
#include<string>
11-
12-
13-
// include message declaration
149
#include"boost/network/message_fwd.hpp"
15-
16-
// include traits implementation
1710
#include<boost/network/traits/string.hpp>
1811
#include<boost/network/traits/ostringstream.hpp>
1912
#include<boost/network/traits/headers_container.hpp>
20-
21-
// include directives base
2213
#include<boost/network/detail/directive_base.hpp>
23-
24-
// include wrappers base
2514
#include<boost/network/detail/wrapper_base.hpp>
15+
#include<boost/network/message/directives.hpp>
16+
#include<boost/network/message/wrappers.hpp>
17+
#include<boost/network/message/transformers.hpp>
18+
19+
#include<boost/network/message/modifiers/add_header.hpp>
20+
#include<boost/network/message/modifiers/remove_header.hpp>
21+
#include<boost/network/message/modifiers/clear_headers.hpp>
22+
#include<boost/network/message/modifiers/source.hpp>
23+
#include<boost/network/message/modifiers/destination.hpp>
24+
#include<boost/network/message/modifiers/body.hpp>
2625

2726
#include<boost/network/message/message_concept.hpp>
2827

@@ -61,24 +60,40 @@ namespace boost { namespace network {
6160
}
6261

6362
voidswap(basic_message<Tag> & other) {
64-
other._headers.swap(_headers);
65-
other._body.swap(_body);
66-
other._source.swap(_source);
67-
other._destination.swap(_destination);
63+
std::swap(other._headers,_headers);
64+
std::swap(other._body,_body);
65+
std::swap(other._source,_source);
66+
std::swap(other._destination,_destination);
6867
}
6968

7069
headers_container_type &headers() {
7170
return _headers;
7271
}
7372

74-
headers_container_typeheaders()const {
73+
voidheaders(headers_container_typeconst & headers_)const {
74+
_headers = headers_;
75+
}
76+
77+
voidadd_header(typename headers_container_type::value_typeconst & pair_)const {
78+
_headers.insert(pair_);
79+
}
80+
81+
voidremove_header(typename headers_container_type::key_typeconst & key)const {
82+
_headers.erase(key);
83+
}
84+
85+
headers_container_type &headers()const {
7586
return _headers;
7687
}
7788

7889
string_type &body() {
7990
return _body;
8091
}
8192

93+
voidbody(string_typeconst & body_)const {
94+
_body = body_;
95+
}
96+
8297
string_typebody()const {
8398
return _body;
8499
}
@@ -87,6 +102,10 @@ namespace boost { namespace network {
87102
return _source;
88103
}
89104

105+
voidsource(string_typeconst & source_)const {
106+
_source = source_;
107+
}
108+
90109
string_typesource()const {
91110
return _source;
92111
}
@@ -95,6 +114,10 @@ namespace boost { namespace network {
95114
return _destination;
96115
}
97116

117+
voiddestination(string_typeconst & destination_)const {
118+
_destination = destination_;
119+
}
120+
98121
string_typedestination()const {
99122
return _destination;
100123
}
@@ -104,10 +127,10 @@ namespace boost { namespace network {
104127
friendstructdetail::directive_base<Tag> ;
105128
friendstructdetail::wrapper_base<Tag> ;
106129

107-
headers_container_type _headers;
108-
string_type _body;
109-
string_type _source;
110-
string_type _destination;
130+
mutableheaders_container_type _headers;
131+
mutablestring_type _body;
132+
mutablestring_type _source;
133+
mutablestring_type _destination;
111134
};
112135

113136
template<classTag>
@@ -122,14 +145,5 @@ BOOST_CONCEPT_ASSERT((Message<basic_message<boost::network::tags::default_wstrin
122145
}// namespace network
123146
}// namespace boost
124147

125-
#include<boost/network/message/directives.hpp>
126-
// pull in directives header file
127-
128-
#include<boost/network/message/wrappers.hpp>
129-
// pull in wrappers header file
130-
131-
#include<boost/network/message/transformers.hpp>
132-
// pull in transformer header file
133-
134148
#endif// __NETWORK_MESSAGE_HPP__
135149

‎boost/network/message/directives/body.hpp‎

Lines changed: 33 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,69 +1,54 @@
11

2-
// Copyright Dean Michael Berris 2007.
2+
// Copyright Dean Michael Berris 2007-2010.
33
// Distributed under the Boost Software License, Version 1.0.
44
// (See accompanying file LICENSE_1_0.txt or copy at
55
// http://www.boost.org/LICENSE_1_0.txt)
66

77
#ifndef __NETWORK_MESSAGE_DIRECTIVES_BODY_HPP__
88
#define__NETWORK_MESSAGE_DIRECTIVES_BODY_HPP__
99

10-
#include<boost/network/traits/string.hpp>
10+
#include<boost/network/message/directives/detail/string_directive.hpp>
11+
#include<boost/network/message/directives/detail/string_value.hpp>
1112

12-
13-
/** body.hpp
14-
*
15-
* Defines the types involved and the semantics of adding
16-
* body contents into message objects.
17-
*
18-
* WARNING: DO NOT INCLUDE THIS HEADER DIRECTLY. THIS REQUIRES
19-
* TYPES TO BE DEFINED FROM EARLIER FILES THAT INCLUDE THIS
20-
* HEADER.
21-
*/
2213
namespaceboost {namespacenetwork {
23-
namespaceimpl {
24-
template<
25-
classT
26-
>
27-
structbody_directive {
28-
29-
explicitbody_directive(T body) :
30-
_body(body)
31-
{ };
32-
33-
template<classMessageTag>
34-
voidoperator() (basic_message<MessageTag> & msg)const {
35-
msg.body() = _body;
36-
}
3714

38-
private:
15+
namespaceimpl {
16+
17+
structbody_directive_base {
18+
19+
template<classMessage>
20+
structstring_visitor : boost::static_visitor<> {
21+
Messageconst & message_;
22+
string_visitor(Messageconst & message)
23+
: message_(message) {}
24+
voidoperator()(typename detail::string_value<typename Message::tag>::typeconst & body)const {
25+
message_.body(body);
26+
}
27+
template<classT>voidoperator()(Tconst &)const {
28+
// FIXME -- fail here
29+
}
30+
};
3931

40-
T _body;
41-
};
42-
}// namespace impl
32+
};
4333

34+
typedef detail::string_directive<body_directive_base> body_directive;
4435

45-
// template <
46-
// class T
47-
// >
48-
// inline
49-
// impl::body_directive<T>
50-
// body(T body_, boost::disable_if<T::message>::type) {
51-
// return impl::body_directive<T>(body_);
52-
// }
36+
}// namespace impl
5337

5438

55-
inline
56-
impl::body_directive<std::string>
57-
body(std::string body_) {
58-
return impl::body_directive<std::string>(body_);
59-
}
39+
inline impl::body_directiveconstbody(string<tags::default_string>::typeconst & input) {
40+
returnimpl::body_directive(input);
41+
}
42+
43+
inline impl::body_directiveconstbody(string<tags::default_wstring>::typeconst & input) {
44+
returnimpl::body_directive(input);
45+
}
6046

47+
template<classInputType>
48+
inline impl::body_directiveconstbody(boost::shared_future<InputType>const & input) {
49+
returnimpl::body_directive(input);
50+
}
6151

62-
inline
63-
impl::body_directive<std::wstring>
64-
body(std::wstring body_) {
65-
return impl::body_directive<std::wstring>(body_);
66-
}
6752
}// namespace network
6853
}// namespace boost
6954

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp