MCPcopy Create free account
hub / github.com/LadybugDB/ladybug / getExtensionRepoInfo

Function getExtensionRepoInfo

src/extension/extension.cpp:153–165  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

151}
152
153static ExtensionRepoInfo getExtensionRepoInfo(const std::string& extensionURL) {
154 auto parsedURL = parseURL(extensionURL);
155 auto scheme = parsedURL.scheme.empty() ? "http" : parsedURL.scheme;
156 auto hostStart = extensionURL.find("://");
157 hostStart = hostStart == std::string::npos ? 0 : hostStart + 3;
158 auto hostPathStart = extensionURL.find('/', hostStart);
159 auto hostName = hostPathStart == std::string::npos ?
160 extensionURL.substr(hostStart) :
161 extensionURL.substr(hostStart, hostPathStart - hostStart);
162 auto hostURL = std::format("{}://{}", scheme, hostName);
163 auto hostPath = hostPathStart == std::string::npos ? "/" : extensionURL.substr(hostPathStart);
164 return {hostPath, hostURL, extensionURL};
165}
166
167std::string ExtensionSourceUtils::toString(ExtensionSource source) {
168 switch (source) {

Callers 2

getExtensionFilePathFunction · 0.85
getSharedLibRepoInfoMethod · 0.85

Calls 3

parseURLFunction · 0.85
emptyMethod · 0.45
findMethod · 0.45

Tested by

no test coverage detected