net-cpp: /home/odroid/lomiri/net-cpp-git/src/net-cpp/include/core/net/uri.h Source File

net-cpp .. C++11 library for networking purposes

uri.h
Go to the documentation of this file.
1 /*
2 * Copyright © 2014 Canonical Ltd.
3 *
4 * This program is free software: you can redistribute it and/or modify it
5 * under the terms of the GNU Lesser General Public License version 3,
6 * as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authored by: Pete Woods <pete.woods@canonical.com>
17 */
18
19 #ifndef CORE_NET_URI_H_
20 #define CORE_NET_URI_H_
21
22 #include <string>
23 #include <vector>
24
25 #include <core/net/visibility.h>
26
27 namespace core
28 {
29 namespace net
30 {
31
32
36 struct Uri
37 {
38 typedef std::string Host;
39
40 typedef std::vector<std::string> Path;
41
42 typedef std::vector<std::pair<std::string, std::string>> QueryParameters;
43
52 Host host;
53
62 Path path;
63
72 QueryParameters query_parameters;
73 };
74
87 CORE_NET_DLL_PUBLIC
88 Uri make_uri (const Uri::Host& host, const Uri::Path& path = Uri::Path(),
89 const Uri::QueryParameters& query_parameters = Uri::QueryParameters());
90
91 }
92 }
93
94 #endif // CORE_NET_URI_H_
core::net::Uri::QueryParameters
std::vector< std::pair< std::string, std::string > > QueryParameters
Definition: uri.h:42
core::net::Uri::path
Path path
the path components
Definition: uri.h:62
visibility.h
core::net::make_uri
CORE_NET_DLL_PUBLIC Uri make_uri(const Uri::Host &host, const Uri::Path &path=Uri::Path(), const Uri::QueryParameters &query_parameters=Uri::QueryParameters())
Build a URI from its components.
core
Definition: location.h:24
CORE_NET_DLL_PUBLIC
#define CORE_NET_DLL_PUBLIC
Definition: visibility.h:25
core::net::Uri::host
Host host
The host is the first part of the URI, including the protocol.
Definition: uri.h:52
core::net::Uri::Host
std::string Host
Definition: uri.h:38
core::net::Uri
The Uri class encapsulates the components of a URI.
Definition: uri.h:37
core::net::Uri::query_parameters
QueryParameters query_parameters
The CGI query parameters as ordered key-value pairs.
Definition: uri.h:72
core::net::Uri::Path
std::vector< std::string > Path
Definition: uri.h:40