Files
XCSDD/docs/api/resources/filesystem/readresource.md
ssdfasd 58a83f445a 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
2026-03-19 12:44:08 +08:00

28 lines
621 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# ResourceFileSystem::ReadResource
```cpp
Containers::Array<Core::uint8> ReadResource(const Containers::String& relativePath) const
```
读取资源文件内容。优先从归档包中读取,其次从目录中查找。
**参数:**
- `relativePath` - 资源相对路径
**返回:** 文件内容的字节数组,读取失败返回空数组
**复杂度:** O(n)n 为文件大小
**示例:**
```cpp
auto data = ResourceFileSystem::Get().ReadResource("textures/player.png");
if (!data.Empty()) {
// 使用数据...
}
```
## 相关文档
- [ResourceFileSystem 总览](filesystem.md) - 返回类总览