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

Commit0c77811

Browse files
committed
Added headers which move boost::network::http::* types into network::http. Updated examples accordingly.
1 parent1338fb4 commit0c77811

File tree

16 files changed

+90
-146
lines changed

16 files changed

+90
-146
lines changed

‎include/network/http/client.hpp‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// Copyright (c) Glyn Matthews 2012.
2+
// Distributed under the Boost Software License, Version 1.0.
3+
// (See accompanying file LICENSE_1_0.txt or copy at
4+
// http://www.boost.org/LICENSE_1_0.txt)
5+
6+
#ifndef __NETWORK_HTTP_CLIENT_INC__
7+
#define__NETWORK_HTTP_CLIENT_INC__
8+
9+
#include<boost/network/protocol/http/client.hpp>
10+
#include<network/http/request.hpp>
11+
#include<network/http/response.hpp>
12+
#include<network/http/errors.hpp>
13+
14+
namespacenetwork {
15+
using boost::network::header;
16+
17+
namespacehttp {
18+
using boost::network::http::client;
19+
}// namespace http
20+
}// namespace network
21+
22+
#endif// __NETWORK_HTTP_CLIENT_INC__

‎include/network/http/errors.hpp‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// Copyright (c) Glyn Matthews 2012.
2+
// Distributed under the Boost Software License, Version 1.0.
3+
// (See accompanying file LICENSE_1_0.txt or copy at
4+
// http://www.boost.org/LICENSE_1_0.txt)
5+
6+
#ifndef __NETWORK_HTTP_ERRORS_INC__
7+
#define__NETWORK_HTTP_ERRORS_INC__
8+
9+
#include<boost/network/protocol/http/errors.hpp>
10+
11+
namespacenetwork {
12+
namespacehttp {
13+
namespaceerrors {
14+
using boost::network::http::errors::connection_timeout;
15+
}// namespace errors
16+
}// namespace http
17+
}// namespace network
18+
19+
#endif// __NETWORK_HTTP_ERRORS_INC__

‎include/network/http/request.hpp‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// Copyright (c) Glyn Matthews 2012.
2+
// Distributed under the Boost Software License, Version 1.0.
3+
// (See accompanying file LICENSE_1_0.txt or copy at
4+
// http://www.boost.org/LICENSE_1_0.txt)
5+
6+
#ifndef __NETWORK_HTTP_REQUEST_INC__
7+
#define__NETWORK_HTTP_REQUEST_INC__
8+
9+
#include<boost/network/protocol/http/request.hpp>
10+
11+
namespacenetwork {
12+
namespacehttp {
13+
using boost::network::http::request;
14+
}// namespace http
15+
}// namespace network
16+
17+
#endif// __NETWORK_HTTP_REQUEST_INC__

‎include/network/http/response.hpp‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// Copyright (c) Glyn Matthews 2012.
2+
// Distributed under the Boost Software License, Version 1.0.
3+
// (See accompanying file LICENSE_1_0.txt or copy at
4+
// http://www.boost.org/LICENSE_1_0.txt)
5+
6+
#ifndef __NETWORK_HTTP_RESPONSE_INC__
7+
#define__NETWORK_HTTP_RESPONSE_INC__
8+
9+
#include<boost/network/protocol/http/response.hpp>
10+
11+
namespacenetwork {
12+
namespacehttp {
13+
using boost::network::http::response;
14+
}// namespace http
15+
}// namespace network
16+
17+
#endif// __NETWORK_HTTP_RESPONSE_INC__

‎libs/network/example/CMakeLists.txt‎

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ if (OPENSSL_FOUND)
1010
endif (OPENSSL_FOUND)
1111

1212
add_executable(uri_builder uri_builder.cpp)
13-
#add_executable(http_client http_client.cpp)
1413
add_executable(simple_wget simple_wget.cpp)
1514
add_executable(atom_reader atom/atom.cpp atom/main.cpp)
1615
add_executable(rss_reader rss/rss.cpp rss/main.cpp)
@@ -41,19 +40,6 @@ target_link_libraries(uri_builder
4140
${CMAKE_THREAD_LIBS_INIT}
4241
cppnetlib-uri)
4342

44-
#target_link_libraries(http_client
45-
# ${BOOST_CLIENT_LIBS}
46-
# ${CMAKE_THREAD_LIBS_INIT}
47-
# cppnetlib-uri
48-
# cppnetlib-message
49-
# cppnetlib-message-directives
50-
# cppnetlib-message-wrappers
51-
# cppnetlib-http-message-wrappers
52-
# cppnetlib-http-message
53-
# cppnetlib-constants
54-
# cppnetlib-http-client
55-
# cppnetlib-http-client-connections)
56-
5743
target_link_libraries(simple_wget
5844
${BOOST_CLIENT_LIBS}
5945
${CMAKE_THREAD_LIBS_INIT}
@@ -126,7 +112,6 @@ target_link_libraries(hello_world_client
126112

127113
if (OPENSSL_FOUND)
128114
target_link_libraries(uri_builder${OPENSSL_LIBRARIES})
129-
#target_link_libraries(http_client ${OPENSSL_LIBRARIES})
130115
target_link_libraries(simple_wget${OPENSSL_LIBRARIES})
131116
target_link_libraries(atom_reader${OPENSSL_LIBRARIES})
132117
target_link_libraries(rss_reader${OPENSSL_LIBRARIES})
@@ -144,7 +129,6 @@ endif (OPENSSL_FOUND)
144129
#endif (UNIX)
145130

146131
set_target_properties(uri_builder PROPERTIESRUNTIME_OUTPUT_DIRECTORY ${CPP-NETLIB_BINARY_DIR}/example)
147-
#set_target_properties(http_client PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CPP-NETLIB_BINARY_DIR}/example)
148132
set_target_properties(simple_wget PROPERTIESRUNTIME_OUTPUT_DIRECTORY ${CPP-NETLIB_BINARY_DIR}/example)
149133
set_target_properties(atom_reader PROPERTIESRUNTIME_OUTPUT_DIRECTORY ${CPP-NETLIB_BINARY_DIR}/example)
150134
set_target_properties(rss_reader PROPERTIESRUNTIME_OUTPUT_DIRECTORY ${CPP-NETLIB_BINARY_DIR}/example)

‎libs/network/example/Jamfile.v2‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,6 @@ project network_test :
2323

2424
exe uri : uri.cpp /cpp-netlib//cppnetlib-uri ;
2525

26-
exe http_client : http_client.cpp /cpp-netlib//cppnetlib-uri /cpp-netlib//cppnetlib-client-connections ;
27-
28-
exe http_client1 : http_client1.cpp /cpp-netlib//cppnetlib-uri /cpp-netlib//cppnetlib-client-connections ;
2926

3027
exe simple_wget : simple_wget.cpp /cpp-netlib//cppnetlib-uri /cpp-netlib//cppnetlib-client-connections ;
3128

‎libs/network/example/atom/atom.cpp‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
#include<stdexcept>
1010
#include<cassert>
1111

12-
13-
namespaceboost {
1412
namespacenetwork {
1513
namespaceatom {
1614
feed::feed(const http::client::response &response) {
@@ -94,4 +92,3 @@ feed::feed(const http::client::response &response) {
9492
}
9593
}// namespace atom
9694
}// namespace network
97-
}// namespace boost

‎libs/network/example/atom/atom.hpp‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,9 @@
99

1010
#include<string>
1111
#include<vector>
12-
#include<boost/network/protocol/http.hpp>
12+
#include<network/http/client.hpp>
1313

1414

15-
namespaceboost {
1615
namespacenetwork {
1716
namespaceatom {
1817
classentry {
@@ -172,6 +171,5 @@ class feed {
172171
};
173172
}// namespace atom
174173
}// namespace network
175-
}// namespace boost
176174

177175
#endif// ___ATOM_INC__

‎libs/network/example/atom/main.cpp‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
1-
// Copyright (c) Glyn Matthews 2011.
1+
// Copyright (c) Glyn Matthews 2011, 2012.
22
// Distributed under the Boost Software License, Version 1.0.
33
// (See accompanying file LICENSE_1_0.txt or copy at
44
// http://www.boost.org/LICENSE_1_0.txt)
55

66

77
#include"atom.hpp"
8-
#include<boost/network/protocol/http/client.hpp>
8+
#include<network/http/client.hpp>
99
#include<boost/foreach.hpp>
1010
#include<iostream>
1111

1212
intmain(int argc,char * argv[]) {
13-
usingnamespaceboost::network;
13+
namespacehttp= network::http;
14+
namespaceatom= network::atom;
1415

1516
if (argc !=2) {
1617
std::cout <<"Usage:" << argv[0] <<" <url>" << std::endl;
@@ -20,7 +21,7 @@ int main(int argc, char * argv[]) {
2021
try {
2122
http::client client;
2223
http::client::requestrequest(argv[1]);
23-
request <<header("Connection","close");
24+
request <<network::header("Connection","close");
2425
http::client::response response = client.get(request);
2526
atom::feedfeed(response);
2627

‎libs/network/example/http_client.cpp‎

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

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp