Skip to content

Commit e113adc

Browse files
committed
Updating the documentation.
1 parent dfc95a6 commit e113adc

15 files changed

+228
-164
lines changed

README.rst

Lines changed: 30 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ cpp-netlib offers the following implementations:
1515
generate message objects from strings.
1616
* Adapters and Wrappers -- A collection of Adapters and wrappers aimed
1717
towards making the message type STL friendly.
18-
* Network protocol client and server implementations -- A collection
19-
of network protocol implementations that include embeddable client
18+
* Network protocol client and server implementations -- A collection
19+
of network protocol implementations that include embeddable client
2020
and server types.
2121

2222
This library is released under the Boost Software License (please see
@@ -47,30 +47,15 @@ The recommended installation procedure would be to follow the steps below::
4747
$ sudo mkdir -p /usr/local/include/cpp-netlib
4848
$ sudo cp -r cpp-netlib/boost /usr/local/include/cpp-netlib
4949

50-
Now don't forget to add ``/usr/local/include/cpp-netlib`` in your project's
51-
compiler include directories to start using cpp-netlib in your projects.
52-
53-
Running Tests
54-
-------------
55-
56-
If you want to run the tests that come with cpp-netlib, there are a few things
57-
you will need. These are:
58-
59-
* A compiler (GCC 4.x or Clang 2.8)
60-
* A build tool (CMake [#]_ recommended, Boost.Build also an option)
61-
* OpenSSL headers (optional with CMake, mandatory for Boost.Build)
62-
* Python 2.6
63-
64-
.. note:: This assumes that you have the cpp-netlib distribution package
65-
unpacked somwhere in your home directory. This specifically assumes that you
66-
have cpp-netlib at the toplevel of your home directory.
67-
.. [#] http://www.cmake.org/
50+
Don't forget to add ``/usr/local/include/cpp-netlib`` in your project's
51+
compiler include directories to start using cpp-netlib.
6852

6953
Building with CMake
7054
~~~~~~~~~~~~~~~~~~~
7155

72-
To build and run the tests with CMake, you will need to have CMake version 2.8
73-
or higher installed appropriately in your system.
56+
To build the libraries and run the tests with CMake, you will need to
57+
have CMake version 2.8 or higher installed appropriately in your
58+
system.
7459

7560
::
7661

@@ -81,16 +66,11 @@ Inside the cpp-netlib directory, you can issue the following statements to
8166
configure and generate the Makefiles, and build the tests::
8267

8368
$ cd ~/cpp-netlib # we're assuming it's where cpp-netlib is
84-
$ cmake -DCMAKE_BUILD_TYPE=Debug \
85-
> -CMAKE_C_COMPILER=clang \
86-
> -CMAKE_CXX_COMPILER=clang++ \
69+
$ cmake -DCMAKE_BUILD_TYPE=Debug \
70+
> -DCMAKE_C_COMPILER=clang \
71+
> -DCMAKE_CXX_COMPILER=clang++ \
8772
> .
8873

89-
.. note:: This uses the source directory as the build directory as well. At the
90-
time of this writing, cpp-netlib is meant to be tested in the same directory
91-
where the source files are, because of the way the tests depend on Python
92-
being installed and having access to Python scripts during the build.
93-
9474
Once CMake is done with generating the Makefiles and configuring the project,
9575
you can now build the tests and run them::
9676

@@ -102,7 +82,7 @@ If for some reason some of the tests fail, you can send the files in
10282
``Testing/Temporary/`` as attachments to the cpp-netlib `developers mailing
10383
list`_.
10484

105-
.. _`developers mailing list`: https://lists.sourceforge.net/lists/listinfo/cpp-netlib-devel
85+
.. _`developers mailing list`: cpp-netlib@googlegroups.com
10686

10787
Building with Boost.Build
10888
~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -113,7 +93,7 @@ to copy the ``bjam`` executable to a directory that is already in your ``PATH``
11393
so that you don't have to go hunting for it all the time. A good place to put it
11494
is in ``/usr/local/bin``.
11595

116-
.. [#] http://www.boost.org/doc/libs/1_44_0/more/getting_started/index.html
96+
.. [#] http://www.boost.org/doc/libs/release/more/getting_started/
11797
11898
Building and running the tests can be as simple as doing the following::
11999

@@ -130,7 +110,22 @@ please do the following::
130110
And then attach the ``build-test.log`` file to the email you will send to the
131111
cpp-netlib `developers mailing list`_.
132112

133-
.. _`developers mailing list`: https://lists.sourceforge.net/lists/listinfo/cpp-netlib-devel
113+
.. _`developers mailing list`: cpp-netlib@googlegroups.com
114+
115+
Running Tests
116+
-------------
117+
118+
If you want to run the tests that come with cpp-netlib, there are a few things
119+
you will need. These are:
120+
121+
* A compiler (GCC 4.x, Clang 2.8, MSVC 2008)
122+
* A build tool (CMake [#]_ recommended, Boost.Build also an option)
123+
* OpenSSL headers (optional)
124+
125+
.. note:: This assumes that you have the cpp-netlib distribution package
126+
unpacked somwhere in your home directory. This specifically assumes that you
127+
have cpp-netlib at the toplevel of your home directory.
128+
.. [#] http://www.cmake.org/
134129
135130
Hacking on cpp-netlib
136131
---------------------
@@ -174,14 +169,10 @@ In case you have any questions or would like to make feature requests, you can
174169
contact the development team through the `developers mailing list`_
175170
or by filing issues at http://github.com/cpp-netlib/cpp-netlib/issues.
176171

177-
.. _`developers mailing list`:
178-
https://lists.sourceforge.net/lists/listinfo/cpp-netlib-devel
172+
.. _`developers mailing list`: cpp-netlib@googlegroups.com
179173

180174
You can reach the maintainers of the project through::
181175

182176
Dean Michael Berris (dberris@google.com)
183177

184-
Glyn Matthews
185-
186-
Mike Dickey
187-
178+
Glyn Matthews (glyn.matthews@gmail.com)

libs/network/doc/CMakeLists.txt

Lines changed: 0 additions & 9 deletions
This file was deleted.

libs/network/doc/atom_reader.rst

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
.. _atom_reader:
2+
3+
*************
4+
Atom reader
5+
*************
6+
7+
The Code
8+
========
9+
10+
11+
Building and Running The Code
12+
=============================
13+
14+
Diving into the Code
15+
====================

libs/network/doc/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
# The short X.Y version.
6262
version = '0.9'
6363
# The full version, including alpha/beta/rc tags.
64-
release = '0.9'
64+
release = '0.9.3'
6565

6666
# The language for content autogenerated by Sphinx. Refer to documentation
6767
# for a list of supported languages.
@@ -74,7 +74,7 @@
7474
#today_fmt = '%B %d, %Y'
7575

7676
# List of documents that shouldn't be included in the build.
77-
unused_docs = [ 'http_client_tags.rst' ]
77+
unused_docs = [ '' ]
7878

7979
# List of directories, relative to source directory, that shouldn't be searched
8080
# for source files.

libs/network/doc/examples.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ The :mod:`cpp-netlib` is a practical library that is designed to aid
55
the development of applications for that need to communicate using
66
common networking protocols. The following set of examples describe a
77
series of realistic examples that use the :mod:`cpp-netlib` for these
8-
kinds of application.
8+
kinds of application. All examples are built using CMake.
99

1010
.. toctree::
1111
:maxdepth: 2
1212

1313
examples_http.rst
14-
.. examples_xmpp.rst
14+

libs/network/doc/examples_http.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,7 @@ embedded into larger applications.
1111
http_client.rst
1212
hello_world_server.rst
1313
hello_world_client.rst
14+
simple_wget.rst
15+
atom_reader.rst
16+
rss_reader.rst
17+
twitter_search.rst

libs/network/doc/http.rst

Lines changed: 3 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ returns, in the default case, a multimap of strings to strings:
9999
response_headers headers_ = headers(response);
100100
for (iterator it = headers_.begin(); it != headers_.end(); ++it) {
101101
std::cout << it->first << ": " << it->second << std::endl;
102-
}
102+
}
103103
std::cout << std::endl;
104104

105105

@@ -145,9 +145,9 @@ implementation while the user-visible implementation is the
145145
namespace boost { namespace network { namespace http {
146146

147147
template <class RequestHandler>
148-
class server :
148+
class server :
149149
public basic_server<default_, RequestHandler> {};
150-
150+
151151
}}}
152152

153153
To use the forwarding server type you just supply the request handler
@@ -178,36 +178,3 @@ Here, all we're doing is returning the original request body with an
178178
HTTP OK response (200). We are also printing the IP address from where the
179179
request came from. Notice that we are using a wrapper to access the source of
180180
the request.
181-
182-
HTTP URI
183-
````````
184-
185-
:mod:`cpp-netlib` provides a specialization and ``typedef`` for an
186-
HTTP URI:
187-
188-
.. code-block:: c++
189-
190-
namespace http {
191-
template <class T> class basic_uri;
192-
typedef basic_uri<default_> uri;
193-
}
194-
195-
``basic_uri`` provides a parser which breaks down a URI string passed
196-
to it's constructor into different parts.
197-
198-
.. code-block:: c++
199-
200-
using namespace boost::network::uri;
201-
http::uri uri_("http://www.boost.org/");
202-
assert(valid(uri_));
203-
assert(scheme(uri_) == "http");
204-
assert(host(uri_) == "www.boost.org")
205-
assert(port(uri_) == 80)
206-
assert(path(uri_) == "/");
207-
208-
The syntax of the HTTP URI are defined in RFC 1738 section 3.3 [#]_
209-
and the default URI provided with cpp-netlib conforms to this. In
210-
such a way, specializations that conform to any URI scheme can be
211-
provided.
212-
213-
.. [#] http://tools.ietf.org/html/rfc1738

libs/network/doc/http_client.rst

Lines changed: 10 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
The first code example is the simplest thing you can do with the
88
:mod:`cpp-netlib`. The application is a simple HTTP client, which can
99
be found in the subdirectory ``libs/network/example/http_client.cpp``.
10-
All we are doing is creating and sending an HTTP request to a server
11-
and printing the response body.
10+
All this example doing is creating and sending an HTTP request to a server
11+
and printing the response body.
1212

13-
The Code
13+
The code
1414
========
1515

1616
Without further ado, the code to do this is as follows:
@@ -19,45 +19,34 @@ Without further ado, the code to do this is as follows:
1919

2020
#include <boost/network/protocol/http/client.hpp>
2121
#include <iostream>
22-
22+
2323
int main(int argc, char *argv[]) {
2424
using namespace boost::network;
25-
25+
2626
if (argc != 2) {
2727
std::cout << "Usage: " << argv[0] << " [url]" << std::endl;
2828
return 1;
2929
}
30-
30+
3131
http::client client;
3232
http::client::request request(argv[1]);
3333
request << header("Connection", "close");
3434
http::client::response response = client.get(request);
3535
std::cout << body(response) << std::endl;
36-
36+
3737
return 0;
3838
}
3939

40-
Building and Running The Code
41-
=============================
42-
43-
To be build this example, you can follow the steps below without having to build
44-
the whole :mod:`cpp-netlib` distribution::
45-
46-
$ cd ~/cpp-netlib
47-
$ g++ -o http_client1 libs/network/example/http_client1.cpp \
48-
> -I. \
49-
> -I$BOOST_ROOT \
50-
> -L$BOOST_ROOT/stage/lib \
51-
> -lboost_system \
52-
> -pthread
40+
Running the example
41+
===================
5342

5443
You can then run this to get the Boost_ website::
5544

5645
$ ./http_client1 http://www.boost.org/
5746

5847
.. _Boost: http://www.boost.org/
5948

60-
Diving into the Code
49+
Diving into the code
6150
====================
6251

6352
Since this is the first example, each line will be presented and

libs/network/doc/http_client_tags.rst

Lines changed: 0 additions & 43 deletions
This file was deleted.

libs/network/doc/rss_reader.rst

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
.. _rss_reader:
2+
3+
************
4+
RSS reader
5+
************
6+
7+
The Code
8+
========
9+
10+
11+
Building and Running The Code
12+
=============================
13+
14+
Diving into the Code
15+
====================

0 commit comments

Comments
 (0)