MCPcopy Create free account
hub / github.com/Snapchat/Valdi / URL

Method URL

valdi_core/src/valdi_core/cpp/Utils/URL.cpp:12–23  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10namespace Valdi {
11
12URL::URL(const StringBox& url) : _url(url) {
13 auto schemeIndex = url.find("://");
14 if (schemeIndex) {
15 _scheme = url.substring(0, schemeIndex.value());
16 _path = url.substring(schemeIndex.value() + 3);
17 } else {
18 if (url.hasPrefix("data:")) {
19 _scheme = url.substring(0, 4);
20 }
21 _path = url;
22 }
23}
24
25URL::URL(StringBox&& scheme, StringBox&& path) : _scheme(std::move(scheme)), _path(std::move(path)) {
26 if (!_scheme.isEmpty()) {

Callers

nothing calls this directly

Calls 6

substringMethod · 0.80
hasPrefixMethod · 0.80
valueMethod · 0.65
appendMethod · 0.65
findMethod · 0.45
isEmptyMethod · 0.45

Tested by

no test coverage detected