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

Commit150220a

Browse files
committed
Cleaned my branch and merged changes from upstream.
2 parentsc6c249e +1b71524 commit150220a

File tree

156 files changed

+7969
-2017
lines changed

Some content is hidden

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

156 files changed

+7969
-2017
lines changed

‎.gitignore‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,6 @@ CMakeFiles
66
Makefile
77
Testing
88
build
9+
_build
910
bin
1011

‎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

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp