libER 0.1.4.2
ELDEN RING API library
|
Asynchronous resource loading using the resource capsule system. More...
#include <file.hpp>
Public Member Functions | |
resource_request (CS::CSResourceRepository repository, const std::wstring &resource, const std::filesystem::path &source=std::filesystem::path{}) | |
Construct a new resource request. | |
resource_request (CS::CSResourceRepository repository, std::wstring &&resource, const std::filesystem::path &source=std::filesystem::path{}) | |
Construct a new resource request (string move constructor). | |
resource_request (const resource_request &)=delete | |
resource_request (resource_request &&) noexcept=delete | |
resource_request & | operator= (const resource_request &)=delete |
resource_request & | operator= (resource_request &&) noexcept=delete |
bool | ready () const noexcept |
Check if the resource request is ready. | |
liber::optref< FD4::FD4ResCap > | get () const noexcept |
Block until the resource request is ready and get the result. | |
liber::optref< FD4::FD4ResCap > | check () const noexcept |
Get the request result whether it had finished or not. | |
Asynchronous resource loading using the resource capsule system.
Request a resource to be loaded/unloaded/reloaded from a specified resource repository and a file (if provided). The operation is executed asynchronously and the result may be acquired from the request whenever it is ready.
|
inline |
Construct a new resource request.
repository | the repository to search for the resource |
resource | the name of the resource |
source | a file path passed to from::file_request (optional) |
|
inline |
Construct a new resource request (string move constructor).
repository | the repository to search for the resource |
resource | the name of the resource |
source | a file path passed to from::file_request (optional) |
|
inlinenoexcept |
Get the request result whether it had finished or not.
The absense of a value does not indicate that the request is still not ready, as it simply may have failed to find the resource. Use from::resource_request::ready for that purpose instead.
|
inlinenoexcept |
Block until the resource request is ready and get the result.
A resource request finishing does not mean it contains a value; it's possible the file was not found.
|
inlinenoexcept |
Check if the resource request is ready.
Does not block.