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

Method buildBaseFilename

src/thundersvm/util/log.cpp:765–778  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

763 }
764
765 void File::buildBaseFilename(const std::string& fullPath, char buff[], std::size_t limit, const char* separator) {
766 const char *filename = fullPath.c_str();
767 std::size_t lastSlashAt = fullPath.find_last_of(separator);
768 filename += lastSlashAt ? lastSlashAt+1 : 0;
769 std::size_t sizeOfFilename = strlen(filename);
770 if (sizeOfFilename >= limit) {
771 filename += (sizeOfFilename - limit);
772 if (filename[0] != '.' && filename[1] != '.') { // prepend if not already
773 filename += 3; // 3 = '..'
774 STRCAT(buff, "..", limit);
775 }
776 }
777 STRCAT(buff, filename, limit);
778 }
779
780// Str
781

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected