WebResourceLoader class

IMPORTANT: The class cannot download from https:// sources because OpenSSL is turned off in curl CMakeLists.txt
This commit is contained in:
Vladyslav Baranovskyi
2024-06-16 18:48:05 +03:00
parent 285396f9ce
commit 48607813a5
2 changed files with 118 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
/*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
#pragma once
#include "ResourceLoader.hpp"
#include <string>
#include <filesystem>
namespace OpenVulkano
{
class WebResourceLoader : public ResourceLoader
{
std::filesystem::path m_cacheDirectory;
std::filesystem::path GetCacheFilePath(const std::string& url);
Array<char> DownloadResource(const std::string& url);
bool IsUrl(const std::string& str);
public:
WebResourceLoader();
~WebResourceLoader();
Array<char> GetResource(const std::string& resourceName) override;
};
}