MCPcopy Create free account
hub / github.com/Xtra-Computing/thundersvm / extractPathFromFilename

Method extractPathFromFilename

src/thundersvm/util/log.cpp:742–751  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

740 }
741
742 std::string File::extractPathFromFilename(const std::string& fullPath, const char* separator) {
743 if ((fullPath == "") || (fullPath.find(separator) == std::string::npos)) {
744 return fullPath;
745 }
746 std::size_t lastSlashAt = fullPath.find_last_of(separator);
747 if (lastSlashAt == 0) {
748 return std::string(separator);
749 }
750 return fullPath.substr(0, lastSlashAt + 1);
751 }
752
753 void File::buildStrippedFilename(const char* filename, char buff[], std::size_t limit) {
754 std::size_t sizeOfFilename = strlen(filename);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected