MCPcopy Create free account
hub / github.com/apache/arrow / UriEncodeHost

Function UriEncodeHost

cpp/src/arrow/util/uri.cc:84–95  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

82}
83
84std::string UriEncodeHost(std::string_view host) {
85 // Fairly naive check: if it contains a ':', it's IPv6 and needs
86 // brackets, else it's OK
87 if (host.find(":") != std::string::npos) {
88 std::string result = "[";
89 result += host;
90 result += ']';
91 return result;
92 } else {
93 return std::string(host);
94 }
95}
96
97bool IsValidUriScheme(std::string_view s) {
98 auto is_alpha = [](char c) { return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z'); };

Callers 3

InitMethod · 0.85
InitMethod · 0.85
TESTFunction · 0.85

Calls 1

findMethod · 0.45

Tested by 1

TESTFunction · 0.68