Reads project resources through the filesystem capability. 更多...
#include <ResourceReader.h>
Public 成员函数 | |
| ResourceReader (eve::service::IFileSystem &filesystem) noexcept | |
| Borrow a filesystem capability for synchronous resource reads. | |
| Result< std::vector< std::uint8_t > > | read (const ResourceUri &uri) const |
| Read a supported project resource by typed URI. | |
| Result< std::vector< std::uint8_t > > | read (std::string_view legacyPathOrUri) const |
| Compatibility read facade for a legacy path or resource URI. | |
详细描述
Reads project resources through the filesystem capability.
The typed overload is the source of truth. The string overload is a compatibility facade for existing project-relative path callers: a legacy path is explicitly converted to project://..., while URI-looking input is parsed as a URI and is never silently treated as a path. The referenced IFileSystem must outlive this reader; reads are synchronous and execute with the provider's thread-affinity contract.
在文件 ResourceReader.h 第 29 行定义.
构造及析构函数说明
◆ ResourceReader()
|
inlineexplicitnoexcept |
Borrow a filesystem capability for synchronous resource reads.
- 参数
-
filesystem Provider that owns and performs the actual read.
- 备注
- The reader does not own or retain the provider beyond its lifetime.
在文件 ResourceReader.h 第 36 行定义.
成员函数说明
◆ read() [1/2]
| Result< std::vector< std::uint8_t > > eve::filesystem::ResourceReader::read | ( | const ResourceUri & | uri | ) | const |
Read a supported project resource by typed URI.
- 参数
-
uri Resource locator. Only project://is resolved by this filesystem consumer; other namespaces return Unsupported.
- 返回
- Owning bytes on success, or a checked diagnostic result. The returned bytes do not borrow provider storage.
在文件 ResourceReader.cpp 第 27 行定义.
引用了 bytes, eve::Project, eve::service::IFileSystem::readFile() , 以及 uri.
被这些函数引用 read().
◆ read() [2/2]
| Result< std::vector< std::uint8_t > > eve::filesystem::ResourceReader::read | ( | std::string_view | legacyPathOrUri | ) | const |
Compatibility read facade for a legacy path or resource URI.
- 参数
-
legacyPathOrUri Old project-relative path, or one of the strict resource URIs accepted by ResourceUri::parse.
- 返回
- The same checked result as the typed overload. Bare paths are explicitly converted to project URIs; malformed URI-looking input is rejected.
在文件 ResourceReader.cpp 第 35 行定义.
引用了 eve::ResourceUri::fromLegacyProjectPath(), eve::ResourceUri::parse() , 以及 read().
该类的文档由以下文件生成:
- src/modules/filesystem/ResourceReader.h
- src/modules/filesystem/ResourceReader.cpp