MCPcopy Create free account
hub / github.com/OpenMS/OpenMS / path

Method path

src/openms/source/SYSTEM/File.cpp:334–342  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

332 }
333
334 String File::path(const String& file)
335 {
336 size_t pos = file.find_last_of("\\/");
337 // do NOT return an empty string, because this leads to issues when in generic code you do:
338 // String new_path = path("a.txt") + '/' + basename("a.txt");
339 // , as this would lead to "/a.txt", i.e. create a wrong absolute path from a relative name
340 String no_path = ".";
341 return pos == string::npos ? no_path : file.substr(0, pos);
342 }
343
344 bool File::readable(const String& file)
345 {

Callers 4

openContainingFolderMethod · 0.80
updateTOPPASMethod · 0.80
updateINIMethod · 0.80
saveFileName_Function · 0.80

Calls 1

substrMethod · 0.80

Tested by

no test coverage detected