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

Function getFirstPathSegment

TactilityCore/Source/file/File.cpp:256–267  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

254}
255
256std::string getFirstPathSegment(const std::string& path) {
257 if (path.empty()) {
258 return path;
259 }
260 auto start_index = path[0] == SEPARATOR ? 1 : 0;
261 auto index = path.find_first_of(SEPARATOR, start_index);
262 if (index != std::string::npos) {
263 return path.substr(0, index);
264 } else {
265 return path;
266 }
267}
268
269bool findOrCreateDirectory(const std::string& path, mode_t mode) {
270 if (path.empty()) {

Callers 1

getUserDataPathMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected