LeviLamina
Loading...
Searching...
No Matches
Url.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated forward declare list
6// clang-format off
7namespace Util::ResourceUri { struct ValidationResult; }
8namespace Util::Url { struct Components; }
9namespace Util::Url { struct ComponentsView; }
10// clang-format on
11
12namespace Util::Url {
13// functions
14// NOLINTBEGIN
15#ifdef LL_PLAT_C
16MCNAPI ::std::string addUrlSchemeIfNotPresent(::std::string const& url, ::std::string const& scheme);
17#endif
18
19MCNAPI ::std::string anonymizeIPAddress(::std::string const& ipAddress);
20
21MCNAPI ::std::string anonymizeIPv6Address(::std::string const& ipAddress);
22
23MCNAPI ::std::string append(::std::string const& lhs, ::std::string const& rhs);
24
25#ifdef LL_PLAT_C
26MCNAPI ::std::string appendQueryString(::std::string const& url, ::std::string const& query);
27
28MCNAPI ::std::string buildMailtoUrl(::std::string const& subject, ::std::string const& body);
29
30MCNAPI bool doesRouteMatch(::std::string_view routePattern, ::std::string_view route);
31
32MCNAPI ::std::string extractAuthorityAndPathFromUrl(::std::string const& url);
33
34MCNAPI ::std::optional<::std::string> getExtension(::std::string const& url);
35
36MCNAPI ::std::vector<::std::pair<::std::string_view, ::std::string_view>> getQueryParameters(::std::string_view url);
37
38MCNAPI bool isValidAbsoluteUrl(::std::string const& url);
39#endif
40
41MCNAPI bool isValidIP(::std::string_view ipAddrStr, bool considerIPv4Valid, bool considerIPv6Valid);
42
43MCNAPI ::Util::Url::ComponentsView parseUrl(::std::string_view url);
44
45#ifdef LL_PLAT_C
46MCNAPI ::std::string setQueryParameter(::std::string_view url, ::std::string_view key, ::std::string_view value);
47
48MCNAPI bool startsWithMatchingFullPathSegments(::std::string_view route, ::std::string_view start);
49
50MCNAPI ::std::string stripProtocol(::std::string const& url);
51
52MCNAPI ::std::optional<::std::string> urlDecode(::std::string_view value, bool replacePlusWithSpace);
53
54MCNAPI ::std::string urlEncode(::std::string const& value);
55#endif
56
57MCNAPI ::std::string urlEncode(::std::string_view value, ::std::function<bool(uchar)> isAlphaNum);
58
59MCNAPI ::Util::ResourceUri::ValidationResult validateAbsoluteUrl(::std::string const& url);
60// NOLINTEND
61
62// static variables
63// NOLINTBEGIN
64MCNAPI ::std::vector<::std::pair<::std::string, ::std::string>> const& EMPTY_QUERY_PARAMETERS();
65
66MCNAPI ::Util::Url::Components const& EMPTY_URL();
67// NOLINTEND
68
69} // namespace Util::Url
Definition ValidationResult.h:7
Definition ComponentsView.h:12
Definition Components.h:7