Skip to content

Commit 113fc21

Browse files
committed
Merge branch '0.6-devel' of git://github.com/mikhailberis/cpp-netlib into 0.6-devel
2 parents f317ff7 + 4e1d254 commit 113fc21

File tree

13 files changed

+555
-453
lines changed

13 files changed

+555
-453
lines changed

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ namespace boost { namespace network { namespace http {
8787
}
8888

8989
string_type const protocol() const {
90-
return uri_.protocol();
90+
return uri_.scheme();
9191
}
9292

9393
};

boost/network/protocol/http/policies/sync_resolver.hpp

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include <utility>
1010
#include <boost/asio.hpp>
1111
#include <boost/network/protocol/http/traits/resolver.hpp>
12+
#include <boost/fusion/adapted/std_pair.hpp>
1213

1314
namespace boost { namespace network { namespace http { namespace policies {
1415

boost/network/uri/basic_uri.hpp

+66-11
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
#ifndef BOOST_NETWORK_URL_BASIC_URL_
22
#define BOOST_NETWORK_URL_BASIC_URL_
33

4-
// Copyright 2009 Dean Michael Berris.
4+
// Copyright 2009 Dean Michael Berris, Jeroen Habraken.
55
// Distributed under the Boost Software License, Version 1.0.
66
// (See accompanying file LICENSE_1_0.txt or copy at
77
// http://www.boost.org/LICENSE_1_0.txt)
88

9-
#include <boost/fusion/adapted/std_pair.hpp>
109
#include <boost/range.hpp>
1110

1211
#include <boost/network/tags.hpp>
@@ -45,17 +44,38 @@ namespace boost { namespace network { namespace uri {
4544

4645
void swap(uri_base & other) {
4746
using std::swap;
47+
4848
swap(other.raw_, raw_);
4949
swap(other.parts_, parts_);
5050
swap(other.valid_, valid_);
5151
}
5252

53-
string_type protocol() const {
53+
string_type scheme() const {
5454
return parts_.scheme;
5555
}
5656

57-
string_type rest() const {
58-
return parts_.scheme_specific_part;
57+
string_type user_info() const {
58+
return parts_.user_info ? *parts_.user_info : string_type();
59+
}
60+
61+
string_type host() const {
62+
return parts_.host ? *parts_.host : string_type();
63+
}
64+
65+
uint16_t port() const {
66+
return parts_.port ? *parts_.port : 0;
67+
}
68+
69+
string_type path() const {
70+
return parts_.path;
71+
}
72+
73+
string_type query() const {
74+
return parts_.query ? *parts_.query : string_type();
75+
}
76+
77+
string_type fragment() const {
78+
return parts_.fragment ? *parts_.fragment : string_type();
5979
}
6080

6181
bool valid() const {
@@ -97,15 +117,50 @@ namespace boost { namespace network { namespace uri {
97117
template <class Tag>
98118
inline
99119
typename string<Tag>::type
100-
protocol(basic_uri<Tag> const & uri) {
101-
return uri.protocol();
120+
scheme(basic_uri<Tag> const & uri) {
121+
return uri.scheme();
102122
}
103123

104124
template <class Tag>
105-
inline
106-
typename string<Tag>::type
107-
rest(basic_uri<Tag> const & uri) {
108-
return uri.rest();
125+
inline
126+
typename string<Tag>::type
127+
user_info(basic_uri<Tag> const & uri) {
128+
return uri.user_info();
129+
}
130+
131+
template <class Tag>
132+
inline
133+
typename string<Tag>::type
134+
host(basic_uri<Tag> const & uri) {
135+
return uri.host();
136+
}
137+
138+
template <class Tag>
139+
inline
140+
uint16_t
141+
port(basic_uri<Tag> const & uri) {
142+
return uri.port();
143+
}
144+
145+
template <class Tag>
146+
inline
147+
typename string<Tag>::type
148+
path(basic_uri<Tag> const & uri) {
149+
return uri.path();
150+
}
151+
152+
template <class Tag>
153+
inline
154+
typename string<Tag>::type
155+
query(basic_uri<Tag> const & uri) {
156+
return uri.query();
157+
}
158+
159+
template <class Tag>
160+
inline
161+
typename string<Tag>::type
162+
fragment(basic_uri<Tag> const & uri) {
163+
return uri.fragment();
109164
}
110165

111166
template <class Tag>

0 commit comments

Comments
 (0)