29 lines
741 B
C++
29 lines
741 B
C++
/*
|
|
* 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);
|
|
|
|
public:
|
|
static bool IsUrl(const std::string& str);
|
|
|
|
WebResourceLoader();
|
|
~WebResourceLoader();
|
|
Array<char> GetResource(const std::string& resourceName, std::string& resourcePath) override;
|
|
};
|
|
} |