MCPcopy Create free account
hub / github.com/TactilityProject/Tactility / getPathParent

Function getPathParent

TactilityCore/Source/StringUtils.cpp:10–21  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8namespace tt::string {
9
10bool getPathParent(const std::string& path, std::string& output) {
11 auto index = path.find_last_of('/');
12 if (index == std::string::npos) {
13 return false;
14 } else if (index == 0) {
15 output = "/";
16 return true;
17 } else {
18 output = path.substr(0, index);
19 return true;
20 }
21}
22
23std::string getLastPathSegment(const std::string& path) {
24 auto index = path.find_last_of('/');

Callers 4

onNavigateUpPressedMethod · 0.85
onShowMethod · 0.85
onNavigateUpPressedMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected