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

Function getFileNameForPath

native/cocos/network/WebSocket-libwebsockets.cpp:288–295  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

286
287#if (CC_PLATFORM == CC_PLATFORM_ANDROID || CC_PLATFORM == CC_PLATFORM_OHOS || CC_PLATFORM == CC_PLATFORM_OPENHARMONY)
288static ccstd::string getFileNameForPath(const ccstd::string &filePath) {
289 ccstd::string fileName = filePath;
290 const size_t lastSlashIdx = fileName.find_last_of("\\/");
291 if (ccstd::string::npos != lastSlashIdx) {
292 fileName.erase(0, lastSlashIdx + 1);
293 }
294 return fileName;
295}
296#endif
297
298static struct lws_protocols defaultProtocols[2];

Callers 1

createVhostMethod · 0.85

Calls 1

eraseMethod · 0.45

Tested by

no test coverage detected