uri.h
Go to the documentation of this file.
/*
* Copyright © 2014 Canonical Ltd.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License version 3,
* as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* Authored by: Pete Woods <pete.woods@canonical.com>
*/
#ifndef CORE_NET_URI_H_
#define CORE_NET_URI_H_
#include <string>
#include <vector>
#include <core/net/visibility.h>
namespace core
{
namespace net
{
struct Uri
{
typedef std::string Host;
typedef std::vector<std::string> Path;
typedef std::vector<std::pair<std::string, std::string>> QueryParameters;
Host host;
Path path;
QueryParameters query_parameters;
};
CORE_NET_DLL_PUBLIC
Uri make_uri (const Uri::Host& host, const Uri::Path& path = Uri::Path(),
const Uri::QueryParameters& query_parameters = Uri::QueryParameters());
}
}
#endif // CORE_NET_URI_H_
core::net
Definition error.h:28
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::Uri
The Uri class encapsulates the components of a URI.
Definition uri.h:37
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::query_parameters
QueryParameters query_parameters
The CGI query parameters as ordered key-value pairs.
Definition uri.h:72
core::net::Uri::QueryParameters
std::vector< std::pair< std::string, std::string > > QueryParameters
Definition uri.h:42
core::net::Uri::Path
std::vector< std::string > Path
Definition uri.h:40
core::net::Uri::path
Path path
the path components
Definition uri.h:62
core::net::Uri::Host
std::string Host
Definition uri.h:38
visibility.h
CORE_NET_DLL_PUBLIC
#define CORE_NET_DLL_PUBLIC
Definition visibility.h:25