MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / baseName

Method baseName

source/core/StarFile_unix.cpp:80–91  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

78}
79
80String File::baseName(const String& fileName) {
81 String ret;
82
83 std::string file = fileName.utf8();
84 char* fn = new char[file.size() + 1];
85 std::copy(file.begin(), file.end(), fn);
86 fn[file.size()] = 0;
87 ret = String(::basename(fn));
88 delete[] fn;
89
90 return ret;
91}
92
93String File::dirName(const String& fileName) {
94 String ret;

Callers

nothing calls this directly

Calls 5

StringClass · 0.85
copyFunction · 0.70
sizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected