API Documentation
|
This class resolves resources data identified by a string. The data absolute path is then passed on to an on_finished function. More...
#include <ResourceResolver.h>
Static Public Member Functions | |
static void | AddResolver (ResourceResolver *resolver) |
static bool | CheckAndUnzipResource (const String &resource, const std::function< void(bool, const String &)> &on_finished=nullptr) |
Same as ResolveResource(xx,xx, true) | |
static bool | ResolveResource (const String &resource, const std::function< void(bool, const String &)> &on_finished=nullptr, bool ensure_unzipped=false) |
Attempts to resolved a resource. Resource could be in an online or offline database, inside a resource or rcc file, or in a local file. Funciton is ascynchronous and resource may not be resolved on return. on_finished is used as a callback for when the resource is resolved, or fails to resolve. | |
Protected Member Functions | |
virtual bool | resolveResource (const String &resource, const std::function< void(bool, const String &)> &on_finished=nullptr, bool ensure_unzipped=false)=0 |
Static Protected Attributes | |
static Buffer< ResourceResolver * > | s_resolvers |
This class resolves resources data identified by a string. The data absolute path is then passed on to an on_finished function.
Resources may be online, in a packed file, or in a spot not easily accessable. static Class stores any number of resolvers who take in a resource, and try to find it.
Author: Tyler Parke
Date: 2024-11-15
|
static |
|
static |
Same as ResolveResource(xx,xx, true)
[in] | resource | - The resource to be resolved. |
[in] | on_finished | - The callback which will be called, likely asyncronously, when the resource is resolved. The first parameter is a bool representing success, the second is a string with the absolute resource location. |
|
static |
Attempts to resolved a resource. Resource could be in an online or offline database, inside a resource or rcc file, or in a local file. Funciton is ascynchronous and resource may not be resolved on return. on_finished is used as a callback for when the resource is resolved, or fails to resolve.
Parameters:
[in] | resource | - The resource to be resolved. |
[in] | on_finished | - The callback which will be called, likely asyncronously, when the resource is resolved. The first parameter is a bool representing success, the second is a string with the absolute resource location. |
[in] | ensure_unzipped | - If true, the resource will be unzipped and placed in a path where it can be instantly accessed. If true, the second parameter will be a file path. |
|
protectedpure virtual |
|
staticprotected |