WebResourceLoader class
IMPORTANT: The class cannot download from https:// sources because OpenSSL is turned off in curl CMakeLists.txt
This commit is contained in:
28
openVulkanoCpp/Host/WebResourceLoader.hpp
Normal file
28
openVulkanoCpp/Host/WebResourceLoader.hpp
Normal 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;
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user