MCPcopy Create free account
hub / github.com/cocos/cocos-engine / getFileDir

Method getFileDir

native/cocos/platform/FileUtils.cpp:1170–1180  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1168}
1169
1170ccstd::string FileUtils::getFileDir(const ccstd::string &path) const {
1171 ccstd::string ret;
1172 size_t pos = path.rfind('/');
1173 if (pos != ccstd::string::npos) {
1174 ret = path.substr(0, pos);
1175 }
1176
1177 normalizePath(ret);
1178
1179 return ret;
1180}
1181
1182ccstd::string FileUtils::normalizePath(const ccstd::string &path) const {
1183 ccstd::string ret;

Callers 1

doModuleRequireFunction · 0.80

Calls 2

substrMethod · 0.80
normalizePathFunction · 0.50

Tested by

no test coverage detected