MCPcopy Create free account
hub / github.com/ElementsProject/elements / GetDirName

Function GetDirName

src/leveldb/db/fault_injection_test.cc:39–46  ·  view source on GitHub ↗

Assume a filename, and not a directory name like "/foo/bar/"

Source from the content-addressed store, hash-verified

37
38// Assume a filename, and not a directory name like "/foo/bar/"
39static std::string GetDirName(const std::string& filename) {
40 size_t found = filename.find_last_of("/\\");
41 if (found == std::string::npos) {
42 return "";
43 } else {
44 return filename.substr(0, found);
45 }
46}
47
48Status SyncDir(const std::string& dir) {
49 // As this is a test it isn't required to *actually* sync this directory.

Callers 2

TruncateFunction · 0.85
SyncParentMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected