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

Function UriEncodeHost

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

Source from the content-addressed store, hash-verified

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