Audacity 3.2.0
UriParser.h
Go to the documentation of this file.
1/*
2 * SPDX-License-Identifier: GPL-2.0-or-later
3 * SPDX-FileName: UriParser.h
4 * SPDX-FileContributor: Dmitry Vedenko
5 */
6
7#pragma once
8
9#include <string_view>
10#include <unordered_map>
11
12struct UriFields final {
13 std::string_view Scheme;
14 std::string_view UserInfo;
15 std::string_view Host;
16 std::string_view Port;
17 std::string_view Path;
18 std::string_view Query;
19 std::string_view Fragment;
20};
21
22
25STRING_UTILS_API UriFields ParseUri(std::string_view uri) noexcept;
26
27using QueryFields = std::unordered_map<std::string_view, std::string_view>;
28
30STRING_UTILS_API QueryFields ParseUriQuery(
31 std::string_view query, std::string_view delimiter = "&") noexcept;
std::unordered_map< std::string_view, std::string_view > QueryFields
Definition: UriParser.h:27
STRING_UTILS_API QueryFields ParseUriQuery(std::string_view query, std::string_view delimiter="&") noexcept
Parses URI query and returns QueryFields structure with parsed fields.
Definition: UriParser.cpp:59
STRING_UTILS_API UriFields ParseUri(std::string_view uri) noexcept
Definition: UriParser.cpp:9
std::string_view UserInfo
Definition: UriParser.h:14
std::string_view Port
Definition: UriParser.h:16
std::string_view Fragment
Definition: UriParser.h:19
std::string_view Host
Definition: UriParser.h:15
std::string_view Query
Definition: UriParser.h:18
std::string_view Scheme
Definition: UriParser.h:13
std::string_view Path
Definition: UriParser.h:17