CreOS SDK
The CreOS SDK allows you to interact with Avular robots
 
Loading...
Searching...
No Matches
url.hpp
1// Copyright (C) 2024 Avular Holding B.V. - All Rights Reserved
2// You may use this code under the terms of the Avular
3// Software End-User License Agreement.
4//
5// You should have received a copy of the Avular
6// Software End-User License Agreement license with
7// this file, or download it from: avular.com/eula
8//
9/*****************************************************************************
10 * Created on: 2024 August 20
11 * Author: Robbert-Jan de Jager
12 *
13 * Helper tools for working with URLs.
14 ****************************************************************************/
15#pragma once
16
17#include <creos/utils_global.hpp>
18#include <string>
19#include <string_view>
20#include <unordered_map>
21
22namespace creos {
23
30std::string CREOS_UTILS_API url_encode(const std::string_view& value);
31
38std::string CREOS_UTILS_API url_decode(const std::string_view& value);
39
46std::string CREOS_UTILS_API create_query(const std::unordered_map<std::string, std::string>& parameters);
47
54std::unordered_map<std::string, std::string> CREOS_UTILS_API parse_query(const std::string_view& query);
55
56} // namespace creos
The main namespace for the CreOS client library.
std::string CREOS_UTILS_API url_decode(const std::string_view &value)
Decodes a string from a URL.
Definition url.cpp:42
std::string CREOS_UTILS_API url_encode(const std::string_view &value)
Encodes a string to be used in a URL.
Definition url.cpp:24
std::unordered_map< std::string, std::string > CREOS_UTILS_API parse_query(const std::string_view &query)
Parses a query string into a map of parameters.
Definition url.cpp:90
std::string CREOS_UTILS_API create_query(const std::unordered_map< std::string, std::string > &parameters)
Creates a query string from a map of parameters.
Definition url.cpp:74