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

Method dirName

source/core/StarFile_unix.cpp:93–104  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

91}
92
93String File::dirName(const String& fileName) {
94 String ret;
95
96 std::string file = fileName.utf8();
97 char* fn = new char[file.size() + 1];
98 std::copy(file.begin(), file.end(), fn);
99 fn[file.size()] = 0;
100 ret = String(::dirname(fn));
101 delete[] fn;
102
103 return ret;
104}
105
106String File::relativeTo(String const& relativeTo, String const& path) {
107 if (path.beginsWith("/"))

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