Cogs.Core
HTTPRasterSource.h
1#pragma once
2#include "BaseRasterSource.h"
3
4#include "Desktop/HTTP/HTTPDataFetcher.h"
5
6namespace Cogs::Core::TerrainProvider
7{
8
10 {
11 virtual ~HTTPConfig() = default;
12 StringRef baseUrl = NoString;
13 StringRef username = NoString;
14 StringRef password = NoString;
15 };
16
18 {
19 public:
20 HTTPRasterSource(Context* context);
21 bool init(const HTTPConfig& conf, std::unique_ptr<ICache>&& icache);
22 void getConfig(HTTPConfig& conf) const;
23
24 protected:
25 StringRef baseUrl = NoString;
26 StringRef username = NoString;
27 StringRef password = NoString;
28
29 Cogs::Desktop::HTTPDataFetcher httpDataFetcher;
30
31 void requestTile(Request* req) final;
32 virtual bool createFetchTileUrl(std::string& url, TileId id) = 0;
33 };
34
35}
A Context instance contains all the services, systems and runtime components needed to use Cogs.
Definition: Context.h:83