27#include <CesiumAsync/Future.h>
28#include <CesiumAsync/IAssetAccessor.h>
29#include <CesiumAsync/IAssetRequest.h>
30#include <CesiumCurl/Library.h>
47 std::string
userAgent{
"Mozilla/5.0 Cesium Native CurlAssetAccessor"};
90 :
public std::enable_shared_from_this<CurlAssetAccessor>,
109 const std::string& url,
110 const std::vector<CesiumAsync::IAssetAccessor::THeader>& headers)
116 const std::string& verb,
117 const std::string& url,
118 const std::vector<CesiumAsync::IAssetAccessor::THeader>& headers,
119 const std::span<const std::byte>& contentPayload)
override;
128 std::unique_ptr<CurlCache> _pCurlCache;
A system for managing asynchronous requests and tasks.
A value that will be available in the future, as produced by AsyncSystem.
Provides asynchronous access to assets, usually files downloaded via HTTP.
An implementation of IAssetAccessor that can make network and local requests to a variety of servers ...
CurlAssetAccessor(const CurlAssetAccessorOptions &options={})
Constructs a new instance.
void tick() noexcept override
CesiumAsync::Future< std::shared_ptr< CesiumAsync::IAssetRequest > > get(const CesiumAsync::AsyncSystem &asyncSystem, const std::string &url, const std::vector< CesiumAsync::IAssetAccessor::THeader > &headers) override
CesiumAsync::Future< std::shared_ptr< CesiumAsync::IAssetRequest > > request(const CesiumAsync::AsyncSystem &asyncSystem, const std::string &verb, const std::string &url, const std::vector< CesiumAsync::IAssetAccessor::THeader > &headers, const std::span< const std::byte > &contentPayload) override
const CurlAssetAccessorOptions & getOptions() const
Gets the options that were used to construct this accessor.
Provides the ability to access HTTP and other network resources using libcurl.
Options for constructing a CurlAssetAccessor.
bool allowDirectoryCreation
Whether a PUT or POST to a file: URL is allowed to create file system directories to hold the target ...
std::string certificatePath
The path to TLS certificates. If non-empty, this will be provided to libcurl as CURLOPT_CAPATH.
std::string userAgent
The User-Agent header to include with each request.
bool doGlobalInit
Whether to call curl_global_init(CURL_GLOBAL_ALL) at construction time and curl_global_cleanup() at d...
std::string certificateFile
A file containing TLS certificates. If non-empty, this will be provided to libcurl as CURLOPT_CAINFO.
std::vector< CesiumAsync::IAssetAccessor::THeader > requestHeaders
Request headers to automatically include in each request.