Skip to content

Commit bd0cf0b

Browse files
committed
Merge pull request cpp-netlib#428 from deanberris/0.11-devel-docfix
Documentation fixes & changes are trivial and the tests continue to pass.
2 parents 55e814b + 466600d commit bd0cf0b

File tree

18 files changed

+156
-42
lines changed

18 files changed

+156
-42
lines changed

.ycm_extra_conf.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
'/usr/include/c++/4.6',
2727
'-isystem',
2828
'/usr/include/clang/3.0/include',
29+
'-isystem',
30+
'/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/c++/v1',
2931
'-I',
3032
os.environ['BOOST_ROOT'],
3133
# Always enable debugging for the project when building for semantic

boost/network/protocol/http/message/wrappers/status_message.hpp

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
#ifndef BOOST_NETWORK_PROTOCOL_HTTP_MESSAGE_WRAPPERS_STATUS_MESSAGE_HPP_20100603
22
#define BOOST_NETWORK_PROTOCOL_HTTP_MESSAGE_WRAPPERS_STATUS_MESSAGE_HPP_20100603
33

4-
// Copyright 2010 (c) Dean Michael Berris
4+
// Copyright 2010 (c) Dean Michael Berris <dberris@google.com>
55
// Copyright 2010 (c) Sinefunc, Inc.
6+
// Copyright 2014 (c) Google, Inc.
67
// Distributed under the Boost Software License, Version 1.0.
78
// (See accompanying file LICENSE_1_0.txt or copy at
89
// http://www.boost.org/LICENSE_1_0.txt)
910

11+
#include <boost/network/traits/string.hpp>
12+
1013
namespace boost { namespace network { namespace http {
1114

1215
template <class Tag>
@@ -27,12 +30,19 @@ namespace boost { namespace network { namespace http {
2730
status_message_wrapper(status_message_wrapper const & other)
2831
: response_(other.response_) {}
2932

30-
operator string_type () {
33+
operator string_type () const {
3134
return response_.status_message();
3235
}
3336

3437
};
3538

39+
template <class Tag>
40+
inline std::ostream&
41+
operator<<(std::ostream& os,
42+
const status_message_wrapper<Tag>& wrapper) {
43+
return os << static_cast<typename string<Tag>::type>(wrapper);
44+
}
45+
3646
} // namespace impl
3747

3848
template <class Tag>

libs/network/doc/examples/http/hello_world_client.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ perform the request via HTTP:
8787
http::client client;
8888
http::client::request request("http://my.webservice.com/");
8989
http::client::response =
90-
client.post(request, "application/xml", some_xml_string);
90+
client.post(request, some_xml_string, "application/xml");
9191
std::data = body(response);
9292

9393
The next set of examples show some more practical applications using

libs/network/doc/html/_sources/examples/http/hello_world_client.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ perform the request via HTTP:
8787
http::client client;
8888
http::client::request request("http://my.webservice.com/");
8989
http::client::response =
90-
client.post(request, "application/xml", some_xml_string);
90+
client.post(request, some_xml_string, "application/xml");
9191
std::data = body(response);
9292

9393
The next set of examples show some more practical applications using

libs/network/doc/html/_sources/reference/http_client.txt

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ behave as a fully synchronous client.
7171

7272
The synchronous client implements all the operations of the client underneath
7373
the interface all block to wait for I/O to finish. All the member methods are
74-
synchronous and will block until the response object is ready or throws if erros
74+
synchronous and will block until the response object is ready or throws if errors
7575
are encountered in the performance of the HTTP requests.
7676

7777
.. warning:: The synchronous clients are **NOT** thread safe. You will need to do
@@ -137,7 +137,7 @@ In this section we assume that the following typedef is in effect:
137137
typedef boost::network::http::basic_client<
138138
boost::network::http::tags::http_default_8bit_udp_resolve
139139
, 1
140-
,1
140+
, 1
141141
>
142142
client;
143143

@@ -290,6 +290,17 @@ and that there is an appropriately constructed response object named
290290
body chunks be handled by the ``callback`` parameter. The signature of
291291
``callback`` should be the following: ``void(iterator_range<char const *> const
292292
&, boost::system::error_code const &)``.
293+
``response_ = client_.post(request_, body, content_type, callback, streaming_callback)``
294+
The body and content_type parameters are of type
295+
``boost::network::string<Tag>::type`` where ``Tag`` is the HTTP Client's
296+
``Tag``. This uses the request object's other headers. Have the response
297+
body chunks be handled by the ``callback`` parameter. The signature of
298+
``callback`` should be the following: ``void(iterator_range<char const *> const
299+
&, boost::system::error_code const &)``. The ``streaming_callback``
300+
argument should have a which has a signature of the form:
301+
``bool(string_type&)``. The provided ``string_type&`` will be streamed as
302+
soon as the function returns. A return value of ``false`` signals the
303+
client that the most recent invocation is the last chunk to be sent.
293304
``response_ = client_.post(request_, streaming_callback)``
294305
Perform and HTTP POST request, and have the request's body chunks be
295306
generated by the ``streaming_callback`` which has a signature of the form:
@@ -329,13 +340,25 @@ and that there is an appropriately constructed response object named
329340
The body and content_type parameters are of type
330341
``boost::network::string<Tag>::type`` where ``Tag`` is the HTTP Client's
331342
``Tag``. This uses the request object's other headers.
332-
``response_ = client_.put(request_, body, content_type, body_handler=callback)``
343+
``response_ = client_.put(request_, body, content_type, callback)``
333344
The body and content_type parameters are of type
334345
``boost::network::string<Tag>::type`` where ``Tag`` is the HTTP Client's
335346
``Tag``. This uses the request object's other headers. Have the response
336347
body chunks be handled by the ``callback`` parameter. The signature of
337348
``callback`` should be the following: ``void(iterator_range<char const *> const
338349
&, boost::system::error_code const &)``.
350+
``response_ = client_.put(request_, body, content_type, callback, streaming_callback)``
351+
The body and content_type parameters are of type
352+
``boost::network::string<Tag>::type`` where ``Tag`` is the HTTP Client's
353+
``Tag``. This uses the request object's other headers. Have the response
354+
body chunks be handled by the ``callback`` parameter. The signature of
355+
``callback`` should be the following: ``void(iterator_range<char const *> const
356+
&, boost::system::error_code const &)``. This form also has the request's body
357+
chunks be generated by the ``streaming_callback`` which has a signature of
358+
the form: ``bool(string_type&)``. The provided ``string_type&`` will be
359+
streamed as soon as the function returns. A return value of ``false``
360+
signals the client that the most recent invocation is the last chunk to be
361+
sent
339362
``response_ = client_.put(request_, streaming_callback)``
340363
Perform and HTTP PUT request, and have the request's body chunks be
341364
generated by the ``streaming_callback`` which has a signature of the form:

libs/network/doc/html/contents.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ <h3>Navigation</h3>
281281
</div>
282282
<div class="footer">
283283
&copy; Copyright 2008-2014, Glyn Matthews, Dean Michael Berris; 2013 Google, Inc..
284-
Last updated on Aug 12, 2014.
284+
Last updated on Aug 27, 2014.
285285
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.2.
286286
</div>
287287
</body>

libs/network/doc/html/examples.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ <h3>Navigation</h3>
129129
</div>
130130
<div class="footer">
131131
&copy; Copyright 2008-2014, Glyn Matthews, Dean Michael Berris; 2013 Google, Inc..
132-
Last updated on Aug 12, 2014.
132+
Last updated on Aug 27, 2014.
133133
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.2.
134134
</div>
135135
</body>

libs/network/doc/html/examples/http/hello_world_client.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ <h2>Diving into the code<a class="headerlink" href="#diving-into-the-code" title
129129
<div class="highlight-c++"><div class="highlight"><pre><span class="n">http</span><span class="o">::</span><span class="n">client</span> <span class="n">client</span><span class="p">;</span>
130130
<span class="n">http</span><span class="o">::</span><span class="n">client</span><span class="o">::</span><span class="n">request</span> <span class="n">request</span><span class="p">(</span><span class="s">&quot;http://my.webservice.com/&quot;</span><span class="p">);</span>
131131
<span class="n">http</span><span class="o">::</span><span class="n">client</span><span class="o">::</span><span class="n">response</span> <span class="o">=</span>
132-
<span class="n">client</span><span class="p">.</span><span class="n">post</span><span class="p">(</span><span class="n">request</span><span class="p">,</span> <span class="s">&quot;application/xml&quot;</span><span class="p">,</span> <span class="n">some_xml_string</span><span class="p">);</span>
132+
<span class="n">client</span><span class="p">.</span><span class="n">post</span><span class="p">(</span><span class="n">request</span><span class="p">,</span> <span class="n">some_xml_string</span><span class="p">,</span> <span class="s">&quot;application/xml&quot;</span><span class="p">);</span>
133133
<span class="n">std</span><span class="o">::</span><span class="n">data</span> <span class="o">=</span> <span class="n">body</span><span class="p">(</span><span class="n">response</span><span class="p">);</span>
134134
</pre></div>
135135
</div>
@@ -192,7 +192,7 @@ <h3>Navigation</h3>
192192
</div>
193193
<div class="footer">
194194
&copy; Copyright 2008-2014, Glyn Matthews, Dean Michael Berris; 2013 Google, Inc..
195-
Last updated on Aug 12, 2014.
195+
Last updated on Aug 27, 2014.
196196
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.2.
197197
</div>
198198
</body>

libs/network/doc/html/objects.inv

-3 Bytes
Binary file not shown.

libs/network/doc/html/reference.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ <h3>Navigation</h3>
134134
</div>
135135
<div class="footer">
136136
&copy; Copyright 2008-2014, Glyn Matthews, Dean Michael Berris; 2013 Google, Inc..
137-
Last updated on Aug 12, 2014.
137+
Last updated on Aug 27, 2014.
138138
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.2.
139139
</div>
140140
</body>

0 commit comments

Comments
 (0)