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

Commitc810667

Browse files
author
glynos
committed
Merged latest documentation from docs branch; minor changes to allow tests to compile with the gcc -pedantic flag. Works on gcc 4.3, needs double checking on other platforms.
1 parent603c71a commitc810667

File tree

18 files changed

+1001
-38
lines changed

18 files changed

+1001
-38
lines changed

‎boost/network/message.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ namespace boost { namespace network {
9595
voidswap(basic_message<Tag> & left, basic_message<Tag> & right) {
9696
// swap for ADL
9797
left.swap(right);
98-
};
98+
}
9999

100100
}// namespace network
101101

‎boost/network/protocol/http/client.hpp

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
namespaceboost {namespacenetwork {namespacehttp {
2828

29-
template<classtag,unsignedint version_major =1,unsigned version_minor =0>
29+
template<classTag,unsignedint version_major =1,unsigned version_minor =0>
3030
classbasic_client {
3131

3232
private:
@@ -38,7 +38,7 @@ namespace boost { namespace network { namespace http {
3838
boost::asio::ip::tcp::resolver::iterator
3939
> resolver_iterator_pair;
4040

41-
typedeftypename string_traits<tag>::type string_type;
41+
typedeftypename string_traits<Tag>::type string_type;
4242

4343
resolver_iterator_pairresolve(string_typeconst & hostname, string_typeconst & port) {
4444
returnstd::make_pair(
@@ -67,7 +67,7 @@ namespace boost { namespace network { namespace http {
6767
throwboost::system::system_error(error);
6868
};
6969

70-
voidcreate_request(boost::asio::streambuf & request_buffer, string_typeconst & method, basic_request<tag> request_)const {
70+
voidcreate_request(boost::asio::streambuf & request_buffer, string_typeconst & method, basic_request<Tag> request_)const {
7171
std::ostreamrequest_stream(&request_buffer);
7272

7373
request_stream
@@ -110,13 +110,13 @@ namespace boost { namespace network { namespace http {
110110
request_stream << body_;
111111
};
112112

113-
voidsend_request(boost::asio::ip::tcp::socket & socket, string_typeconst & method, basic_request<tag>const & request_)const {
113+
voidsend_request(boost::asio::ip::tcp::socket & socket, string_typeconst & method, basic_request<Tag>const & request_)const {
114114
boost::asio::streambuf request_buffer;
115115
create_request(request_buffer, method, request_);
116116
write(socket, request_buffer);
117117
};
118118

119-
voidread_status(basic_response<tag> & response_, boost::asio::ip::tcp::socket & socket, boost::asio::streambuf & response_buffer)const {
119+
voidread_status(basic_response<Tag> & response_, boost::asio::ip::tcp::socket & socket, boost::asio::streambuf & response_buffer)const {
120120
boost::asio::read_until(socket, response_buffer,"\r\n");
121121
std::istreamresponse_stream(&response_buffer);
122122
string_type http_version;
@@ -136,7 +136,7 @@ namespace boost { namespace network { namespace http {
136136
response_.status_message() = status_message;
137137
};
138138

139-
voidread_headers(basic_response<tag> & response_, boost::asio::ip::tcp::socket & socket, boost::asio::streambuf & response_buffer)const {
139+
voidread_headers(basic_response<Tag> & response_, boost::asio::ip::tcp::socket & socket, boost::asio::streambuf & response_buffer)const {
140140
boost::asio::read_until(socket, response_buffer,"\r\n\r\n");
141141
std::istreamresponse_stream(&response_buffer);
142142
string_type header_line, name;
@@ -160,8 +160,8 @@ namespace boost { namespace network { namespace http {
160160
};
161161
};
162162

163-
voidread_body(basic_response<tag> & response_, boost::asio::ip::tcp::socket & socket, boost::asio::streambuf & response_buffer)const {
164-
typename ostringstream_traits<tag>::type body_stream;
163+
voidread_body(basic_response<Tag> & response_, boost::asio::ip::tcp::socket & socket, boost::asio::streambuf & response_buffer)const {
164+
typename ostringstream_traits<Tag>::type body_stream;
165165

166166
if (response_buffer.size() >0)
167167
body_stream << &response_buffer;
@@ -176,14 +176,14 @@ namespace boost { namespace network { namespace http {
176176
response_ <<body(body_stream.str());
177177
};
178178

179-
responseconstsync_request_skeleton(basic_request<tag>const & request_, string_type method,bool get_body) {
179+
responseconstsync_request_skeleton(basic_request<Tag>const & request_, string_type method,bool get_body) {
180180
using boost::asio::ip::tcp;
181181

182182
tcp::socketsocket(_service);
183183
init_socket(socket, request_.host(), boost::lexical_cast<string_type>(request_.port()));
184184
send_request(socket, method, request_);
185185

186-
basic_response<tag> response_;
186+
basic_response<Tag> response_;
187187
response_ <<source(request_.host());
188188

189189
boost::asio::streambuf response_buffer;
@@ -199,47 +199,47 @@ namespace boost { namespace network { namespace http {
199199
basic_client()
200200
: _service(), _resolver(_service) { };
201201

202-
responseconsthead (basic_request<tag>const & request_) {
202+
responseconsthead (basic_request<Tag>const & request_) {
203203
returnsync_request_skeleton(request_,"HEAD",false);
204204
};
205205

206-
responseconstget (basic_request<tag>const & request_) {
206+
responseconstget (basic_request<Tag>const & request_) {
207207
returnsync_request_skeleton(request_,"GET",true);
208208
};
209209

210-
responseconstpost (basic_request<tag>const & request_) {
210+
responseconstpost (basic_request<Tag>const & request_) {
211211
returnsync_request_skeleton(request_,"POST",true);
212212
};
213213

214-
responseconstpost (basic_request<tag>const & request_, string_typeconst & content_type, string_typeconst & body_) {
215-
basic_request<tag>request_copy(request_);
214+
responseconstpost (basic_request<Tag>const & request_, string_typeconst & content_type, string_typeconst & body_) {
215+
basic_request<Tag>request_copy(request_);
216216
request_copy <<body(body_)
217217
<<header("Content-type", content_type)
218218
<<header("Content-Length", boost::lexical_cast<string_type>(body_.size()));
219219
returnpost(request_copy);
220220
};
221221

222-
responseconstpost (basic_request<tag>const & request_, string_typeconst & body_) {
222+
responseconstpost (basic_request<Tag>const & request_, string_typeconst & body_) {
223223
returnpost(request_,"x-application/octet-stream", body_);
224224
};
225225

226-
responseconstput (basic_request<tag>const & request_) {
226+
responseconstput (basic_request<Tag>const & request_) {
227227
returnsync_request_skeleton(request_,"PUT",true);
228228
};
229229

230-
responseconstput (basic_request<tag>const & request_, string_typeconst & body_) {
230+
responseconstput (basic_request<Tag>const & request_, string_typeconst & body_) {
231231
returnput(request_,"x-application/octet-stream", body_);
232232
};
233233

234-
responseconstput (basic_request<tag>const & request_, string_typeconst & content_type, string_typeconst & body_) {
235-
basic_request<tag>request_copy(request_);
234+
responseconstput (basic_request<Tag>const & request_, string_typeconst & content_type, string_typeconst & body_) {
235+
basic_request<Tag>request_copy(request_);
236236
request_copy <<body(body_)
237237
<<header("Content-type", content_type)
238238
<<header("Content-Length", boost::lexical_cast<string_type>(body_.size()));
239239
returnput(request_copy);
240240
};
241241

242-
responseconstdelete_ (basic_request<tag>const & request_) {
242+
responseconstdelete_ (basic_request<Tag>const & request_) {
243243
returnsync_request_skeleton(request_,"DELETE",true);
244244
};
245245

‎boost/network/protocol/http/impl/request.hpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -105,20 +105,20 @@ namespace boost { namespace network { namespace http {
105105
if (fusion::at_key<typename tags::path>(uri_parts).empty()) {
106106
fusion::at_key<typename tags::path>(uri_parts) ="/";
107107
}
108-
};
108+
}
109109

110110
basic_request() :
111111
basic_message<tag>(), uri_parts()
112-
{ };
112+
{ }
113113

114114
basic_request(basic_requestconst & other) :
115115
basic_message<tag>(other), uri_parts(other.uri_parts)
116-
{ };
116+
{ }
117117

118118
basic_request &operator=(basic_request rhs) {
119119
rhs.swap(*this);
120120
return *this;
121-
};
121+
}
122122

123123
voidswap(basic_request & other) {
124124
basic_message<tag> &base_ref(other);
@@ -127,33 +127,33 @@ namespace boost { namespace network { namespace http {
127127
uri_parts_type &other_uri_parts(other.uri_parts);
128128
uri_parts_type &this_uri_parts(this->uri_parts);
129129
std::swap(other_uri_parts, this_uri_parts);
130-
};
130+
}
131131

132132
typename string_traits<tag>::typeconsthost()const {
133133
return fusion::at_key<typename tags::host>(uri_parts);
134-
};
134+
}
135135

136136
unsignedintport()const {
137137
return fusion::at_key<typename tags::port>(uri_parts);
138-
};
138+
}
139139

140140
typename string_traits<tag>::typeconstpath()const {
141141
return fusion::at_key<typename tags::path>(uri_parts);
142-
};
142+
}
143143

144144
typename string_traits<tag>::typeconstquery()const {
145145
return fusion::at_key<typename tags::query>(uri_parts);
146-
};
146+
}
147147

148148
typename string_traits<tag>::typeconstanchor()const {
149149
return fusion::at_key<typename tags::anchor>(uri_parts);
150-
};
150+
}
151151
};
152152

153153
template<classTag>
154154
inlinevoidswap(basic_request<Tag> & lhs, basic_request<Tag> & rhs) {
155155
lhs.swap(rhs);
156-
};
156+
}
157157

158158
}// namespace http
159159

‎boost/network/protocol/http/response.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ namespace boost { namespace network { namespace http {
5858
template<classTag>
5959
inlinevoidswap(basic_response<Tag> & lhs, basic_response<Tag> & rhs) {
6060
lhs.swap(rhs);
61-
};
61+
}
6262

6363
typedef basic_response<http::message_tag> response;
6464

‎libs/network/doc/Jamfile.v2

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# (C) Copyright 2008 Glyn Matthews
2+
#
3+
# Distributed under the Boost Software License, Version 1.0. (See accompanying
4+
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
5+
6+
path-constant boost-images : doc/src/images ;
7+
8+
xml network : network.qbk ;
9+
10+
boostbook standalone
11+
:
12+
network
13+
:
14+
# HTML options first:
15+
# Use graphics not text for navigation:
16+
<xsl:param>navig.graphics=1
17+
# How far down we chunk nested sections, basically all of them:
18+
<xsl:param>chunk.section.depth=3
19+
# Don't put the first section on the same page as the TOC:
20+
<xsl:param>chunk.first.sections=1
21+
# How far down sections get TOC's
22+
<xsl:param>toc.section.depth=10
23+
# Max depth in each TOC:
24+
<xsl:param>toc.max.depth=3
25+
# How far down we go with TOC's
26+
<xsl:param>generate.section.toc.level=10
27+
# Path for links to Boost:
28+
<xsl:param>boost.root=http://www.boost.org
29+
# Path for libraries index:
30+
<xsl:param>boost.libraries=http://www.boost.org/libs/libraries.htm
31+
# Use the main Boost stylesheet:
32+
<xsl:param>html.stylesheet=../boostbook.css
33+
34+
# PDF Options:
35+
# TOC Generation: this is needed for FOP-0.9 and later:
36+
#<xsl:param>fop1.extensions=1
37+
# Or enable this if you're using XEP:
38+
<xsl:param>xep.extensions=1
39+
# TOC generation: this is needed for FOP 0.2, but must not be set to zero for FOP-0.9!
40+
<xsl:param>fop.extensions=0
41+
# No indent on body text:
42+
<xsl:param>body.start.indent=0pt
43+
# Margin size:
44+
<xsl:param>page.margin.inner=0.5in
45+
# Margin size:
46+
<xsl:param>page.margin.outer=0.5in
47+
# Yes, we want graphics for admonishments:
48+
<xsl:param>admon.graphics=1
49+
# Set this one for PDF generation *only*:
50+
# default pnd graphics are awful in PDF form,
51+
# better use SVG's instead:
52+
<format>pdf:<xsl:param>admon.graphics.extension=".svg"
53+
<format>pdf:<xsl:param>admon.graphics.path=$(boost-images)/
54+
;
55+

‎libs/network/doc/acknowledgements.qbk

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
[/
2+
(C) Copyright 2008 Glyn Matthews.
3+
Distributed under the Boost Software License, Version 1.0.
4+
(See accompanying file LICENSE_1_0.txt or copy at
5+
http://www.boost.org/LICENSE_1_0.txt).
6+
]
7+
8+
9+
[section:acknowledgements Acknowledgements]
10+
11+
Much of the implementation of the HTTP package was ported from __pion__.
12+
13+
[endsect]

‎libs/network/doc/architecture.qbk

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
[/
2+
(C) Copyright 2008 Glyn Matthews.
3+
Distributed under the Boost Software License, Version 1.0.
4+
(See accompanying file LICENSE_1_0.txt or copy at
5+
http://www.boost.org/LICENSE_1_0.txt).
6+
]
7+
8+
9+
[section:architecture Architecture]
10+
__cnl__ is built upon the __boost_asio__, for reasons of portability.
11+
12+
The architecture is driven by the requirement to separate requests from the transport mechanism. Additionally, its possible to utilise templates and static mechanisms to make decisions at compile-time, resulting in more efficient and stable client code.
13+
14+
[include message.qbk]
15+
16+
17+
[endsect]
18+

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp