From f010eb474ea8d31b0dfd52df06ef00432d2a72c1 Mon Sep 17 00:00:00 2001 From: Georg Hagen Date: Mon, 14 Oct 2024 10:17:04 +0200 Subject: [PATCH] Improve url detection --- openVulkanoCpp/Host/WebResourceLoader.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/openVulkanoCpp/Host/WebResourceLoader.cpp b/openVulkanoCpp/Host/WebResourceLoader.cpp index d5ade2b..578f8d4 100644 --- a/openVulkanoCpp/Host/WebResourceLoader.cpp +++ b/openVulkanoCpp/Host/WebResourceLoader.cpp @@ -21,6 +21,7 @@ namespace OpenVulkano { +#ifdef HAS_CURL namespace { size_t CurlDownloader(void* contents, size_t size, size_t memBlockCount, void* userData) @@ -31,10 +32,11 @@ namespace OpenVulkano return totalSize; } } +#endif bool WebResourceLoader::IsUrl(const std::string& str) { - return str.find("http://") == 0 || str.find("https://") == 0 || str.find("ftp://") == 0; + return Utils::StartsWith(str, "http://") || Utils::StartsWith(str, "https://") || Utils::StartsWith(str, "ftp://"); } WebResourceLoader::WebResourceLoader()