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
27namespace core
28{
29namespace net
30{
31
32
36struct 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
53
63
73};
74
88Uri 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_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.
The Uri class encapsulates the components of a URI.
Definition uri.h:37
Host host
The host is the first part of the URI, including the protocol.
Definition uri.h:52
QueryParameters query_parameters
The CGI query parameters as ordered key-value pairs.
Definition uri.h:72
std::vector< std::pair< std::string, std::string > > QueryParameters
Definition uri.h:42
std::vector< std::string > Path
Definition uri.h:40
Path path
the path components
Definition uri.h:62
std::string Host
Definition uri.h:38
#define CORE_NET_DLL_PUBLIC
Definition visibility.h:25