docs: update resources API docs

This commit is contained in:
2026-03-20 02:35:35 +08:00
parent fd792b7df1
commit ea756c0177
314 changed files with 9439 additions and 1360 deletions

View File

@@ -0,0 +1,32 @@
# ResourcePath::GetFileName
```cpp
Containers::String GetFileName() const
```
获取文件名(含扩展名)。
**详细描述:**
返回路径中最后一个路径分隔符后的部分,包括文件名和扩展名。兼容 Windows (`\`) 和 Unix (`/`) 路径分隔符。
**返回:** `Containers::String`,文件名(含扩展名)
**复杂度:** O(n)n 为路径长度
**示例:**
```cpp
ResourcePath path("textures/player.png");
Containers::String name = path.GetFileName(); // "player.png"
ResourcePath path2("player.png");
Containers::String name2 = path2.GetFileName(); // "player.png"
ResourcePath path3("textures\\windows\\file.txt");
Containers::String name3 = path3.GetFileName(); // "file.txt"
```
## 相关文档
- [ResourcePath 总览](resourcepath.md) - 返回类总览