MCPcopy Create free account
hub / github.com/RomanKubiak/ctrlr / removeLastPathSection

Function removeLastPathSection

JUCE/modules/juce_core/network/juce_URL.cpp:293–305  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

291 }
292
293 static String removeLastPathSection (const String& url)
294 {
295 auto startOfPath = findStartOfPath (url);
296 auto lastSlash = url.lastIndexOfChar ('/');
297
298 if (lastSlash > startOfPath && lastSlash == url.length() - 1)
299 return removeLastPathSection (url.dropLastCharacters (1));
300
301 if (lastSlash < 0)
302 return url;
303
304 return url.substring (0, std::max (startOfPath, lastSlash));
305 }
306}
307
308void URL::addParameter (const String& name, const String& value)

Callers 1

getParentURLMethod · 0.85

Calls 5

findStartOfPathFunction · 0.85
lastIndexOfCharMethod · 0.80
dropLastCharactersMethod · 0.80
lengthMethod · 0.45
substringMethod · 0.45

Tested by

no test coverage detected