docs: update resources API docs
This commit is contained in:
29
docs/api/resources/iresource/getpath.md
Normal file
29
docs/api/resources/iresource/getpath.md
Normal file
@@ -0,0 +1,29 @@
|
||||
# IResource::GetPath
|
||||
|
||||
```cpp
|
||||
virtual const Containers::String& GetPath() const = 0
|
||||
```
|
||||
|
||||
获取资源路径。纯虚方法,由具体资源类实现,返回资源在文件系统中的相对路径。
|
||||
|
||||
**参数:** 无
|
||||
|
||||
**返回:** `const Containers::String&` - 资源路径的常量引用
|
||||
|
||||
**异常:** 无
|
||||
|
||||
**线程安全:** ✅
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
ResourceHandle<Texture> tex = ResourceManager::Get().Load<Texture>("textures/player.png");
|
||||
const Containers::String& path = tex->GetPath();
|
||||
// path == "textures/player.png"
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [IResource 总览](iresource.md) - 返回类总览
|
||||
Reference in New Issue
Block a user