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

621 B
Raw Blame History

ResourceFileSystem::ReadResource

Containers::Array<Core::uint8> ReadResource(const Containers::String& relativePath) const

读取资源文件内容。优先从归档包中读取,其次从目录中查找。

参数:

  • relativePath - 资源相对路径

返回: 文件内容的字节数组,读取失败返回空数组

复杂度: O(n)n 为文件大小

示例:

auto data = ResourceFileSystem::Get().ReadResource("textures/player.png");
if (!data.Empty()) {
    // 使用数据...
}

相关文档