MapLibre Native Core
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
resource_options.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include <memory>
4 #include <string>
6 
7 namespace mbgl {
8 
12 class ResourceOptions final {
13 public:
19 
21  ResourceOptions& operator=(const ResourceOptions& options);
22  ResourceOptions& operator=(ResourceOptions&& options);
23 
25 
32  ResourceOptions& withApiKey(std::string token);
33 
39  const std::string& apiKey() const;
40 
48 
55 
63 
69  const std::string& cachePath() const;
70 
79 
85  const std::string& assetPath() const;
86 
94 
100  uint64_t maximumCacheSize() const;
101 
110 
116  void* platformContext() const;
117 
124 
125 private:
127 
128  class Impl;
129  std::unique_ptr<Impl> impl_;
130 };
131 
132 } // namespace mbgl
Holds values for resource options.
ResourceOptions(ResourceOptions &&) noexcept
ResourceOptions & withApiKey(std::string token)
Sets the Mapbox access token - see https://docs.mapbox.com/help/how-mapbox-works/access-tokens/ for d...
const std::string & apiKey() const
Gets the previously set (or default) Mapbox access token.
uint64_t maximumCacheSize() const
Gets the previously set (or default) maximum allowed cache size.
const std::string & assetPath() const
Gets the previously set (or default) asset path.
void * platformContext() const
Gets the previously set (or default) platform context.
ResourceOptions clone() const
const std::string & cachePath() const
Gets the previously set (or default) cache path.
ResourceOptions & withAssetPath(std::string path)
Sets the asset path, which is the root directory from where the asset:// scheme gets resolved in a st...
ResourceOptions & withTileServerOptions(TileServerOptions tileServerOptions)
Sets the tile server options..
static ResourceOptions Default()
Returns default resource options.
const TileServerOptions tileServerOptions() const
Gets the previously set (or default) TileServerOptions.
ResourceOptions & withPlatformContext(void *context)
Sets the platform context. A platform context is usually an object that assists the creation of a fil...
ResourceOptions & withMaximumCacheSize(uint64_t size)
Sets the maximum cache size.
ResourceOptions()
Constructs a ResourceOptions object with default values.
ResourceOptions & withCachePath(std::string path)
Sets the cache path.
Holds values for tile server options.
Definition: actor.hpp:15
Definition: tile_id.hpp:256