MCPcopy Create free account
hub / github.com/SpartanJ/efsw / fileNameFromPath

Method fileNameFromPath

src/efsw/FileSystem.cpp:54–64  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

52}
53
54std::string FileSystem::fileNameFromPath( std::string filepath ) {
55 dirRemoveSlashAtEnd( filepath );
56
57 size_t pos = filepath.find_last_of( getOSSlash() );
58
59 if ( pos != std::string::npos ) {
60 return filepath.substr( pos + 1 );
61 }
62
63 return filepath;
64}
65
66std::string FileSystem::pathRemoveFileName( std::string filepath ) {
67 dirRemoveSlashAtEnd( filepath );

Callers

nothing calls this directly

Calls 2

find_last_ofMethod · 0.80
substrMethod · 0.80

Tested by

no test coverage detected