#include <RemoteResourcesManager.h>
Public Member Functions | |
RemoteResourcesManager () | |
std::string | resolve_path (const std::string &uri) |
~RemoteResourcesManager ()=default | |
Static Public Member Functions | |
static std::string | cache_directory () |
static bool | is_remote (const std::string &uri) |
static std::tuple< bool, std::string, std::string > | zip_uri_split (const std::string &uri) |
Private Member Functions | |
std::string | handle_local_zip_package (const std::string &localZipFil, const std::string &internalURI) |
std::string | handle_remote_uri (const std::string &uri) |
Keeps a local directory with cached archives and packages from remote servers. The cache directory is $HOME/.cache/mvsim-storage/
in non-Windows systems.
See resolve_path() for the possible formats of URI addresses.
Definition at line 27 of file RemoteResourcesManager.h.
RemoteResourcesManager::RemoteResourcesManager | ( | ) |
Definition at line 18 of file RemoteResourcesManager.cpp.
|
default |
|
static |
Definition at line 45 of file RemoteResourcesManager.cpp.
|
private |
Returns the local file that internalURI refers to, possibly decompressing the ZIP package first if it is the first time.
Definition at line 148 of file RemoteResourcesManager.cpp.
|
private |
Definition at line 73 of file RemoteResourcesManager.cpp.
|
static |
Returns true if the URI starts with "http[s]://"
Definition at line 23 of file RemoteResourcesManager.cpp.
std::string RemoteResourcesManager::resolve_path | ( | const std::string & | uri | ) |
Processes an URI with the format described next, and returns a local machine URI for that file.
Possible formats for uri
:
/plain/path/to/file
: Then this returns the same string.file://<ACTUAL_LOCAL_PATH>
: This returns the local path.https://server.org/path/file.dae
: It downloads the file and returns a local path to it.https://server.org/path/package.zip/file.dae
: Downloads the ZIP package, extracts Definition at line 29 of file RemoteResourcesManager.cpp.
|
static |
Returns {true, zip_uri, internal_uri} if the URI refers to a ZIP file, or {false, uri, ""} otherwise.
Definition at line 61 of file RemoteResourcesManager.cpp.