fix: improve doc link navigation and tree display
- Fix link resolution with proper relative/absolute path handling - Improve link styling with underline decoration - Hide leaf nodes from tree, only show directories - Fix log file path for packaged app
This commit is contained in:
42
docs/api/resources/iloader/load.md
Normal file
42
docs/api/resources/iloader/load.md
Normal file
@@ -0,0 +1,42 @@
|
||||
# IResourceLoader::Load
|
||||
|
||||
```cpp
|
||||
LoadResult Load(const Containers::String& path, const ImportSettings* settings = nullptr)
|
||||
```
|
||||
|
||||
同步加载资源。纯虚方法,由具体加载器实现。从指定路径读取文件数据,解析为对应类型的资源对象。
|
||||
|
||||
**参数:**
|
||||
- `path` - 资源文件路径
|
||||
- `settings` - 可选的导入设置,用于自定义加载行为
|
||||
|
||||
**返回:** `LoadResult`,包含加载结果(资源指针、是否成功、错误信息等)
|
||||
|
||||
**复杂度:** O(n),取决于文件大小
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
LoadResult TextureLoader::Load(const Containers::String& path,
|
||||
const ImportSettings* settings) {
|
||||
LoadResult result;
|
||||
auto data = ReadFileData(path);
|
||||
if (data.Empty()) {
|
||||
result.errorMessage = "Failed to read file: " + path;
|
||||
return result;
|
||||
}
|
||||
Texture* tex = new Texture();
|
||||
if (!tex->LoadFromData(data.Data(), data.Size(), settings)) {
|
||||
delete tex;
|
||||
result.errorMessage = "Failed to parse texture data";
|
||||
return result;
|
||||
}
|
||||
result.resource = tex;
|
||||
result.success = true;
|
||||
return result;
|
||||
}
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [IResourceLoader 总览](iloader.md) - 返回类总览
|
||||
Reference in New Issue
Block a user