MapLibre Native Core
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
mbgl::ResourceOptions Class Referencefinal

Holds values for resource options. More...

#include <resource_options.hpp>

Public Member Functions

 ResourceOptions ()
 Constructs a ResourceOptions object with default values. More...
 
 ~ResourceOptions ()
 
 ResourceOptions (ResourceOptions &&) noexcept
 
ResourceOptionsoperator= (const ResourceOptions &options)
 
ResourceOptionsoperator= (ResourceOptions &&options)
 
ResourceOptions clone () const
 
ResourceOptionswithApiKey (std::string token)
 Sets the Mapbox access token - see https://docs.mapbox.com/help/how-mapbox-works/access-tokens/ for details. More...
 
const std::string & apiKey () const
 Gets the previously set (or default) Mapbox access token. More...
 
ResourceOptionswithTileServerOptions (TileServerOptions tileServerOptions)
 Sets the tile server options.. More...
 
const TileServerOptions tileServerOptions () const
 Gets the previously set (or default) TileServerOptions. More...
 
ResourceOptionswithCachePath (std::string path)
 Sets the cache path. More...
 
const std::string & cachePath () const
 Gets the previously set (or default) cache path. More...
 
ResourceOptionswithAssetPath (std::string path)
 Sets the asset path, which is the root directory from where the asset:// scheme gets resolved in a style. More...
 
const std::string & assetPath () const
 Gets the previously set (or default) asset path. More...
 
ResourceOptionswithMaximumCacheSize (uint64_t size)
 Sets the maximum cache size. More...
 
uint64_t maximumCacheSize () const
 Gets the previously set (or default) maximum allowed cache size. More...
 
ResourceOptionswithPlatformContext (void *context)
 Sets the platform context. A platform context is usually an object that assists the creation of a file source. More...
 
void * platformContext () const
 Gets the previously set (or default) platform context. More...
 

Static Public Member Functions

static ResourceOptions Default ()
 Returns default resource options. More...
 

Detailed Description

Holds values for resource options.

Definition at line 12 of file resource_options.hpp.

Constructor & Destructor Documentation

◆ ResourceOptions() [1/2]

mbgl::ResourceOptions::ResourceOptions ( )

Constructs a ResourceOptions object with default values.

◆ ~ResourceOptions()

mbgl::ResourceOptions::~ResourceOptions ( )

◆ ResourceOptions() [2/2]

mbgl::ResourceOptions::ResourceOptions ( ResourceOptions &&  )
noexcept

Member Function Documentation

◆ apiKey()

const std::string& mbgl::ResourceOptions::apiKey ( ) const

Gets the previously set (or default) Mapbox access token.

Returns
const std::string& Mapbox access token.

◆ assetPath()

const std::string& mbgl::ResourceOptions::assetPath ( ) const

Gets the previously set (or default) asset path.

Returns
asset path

◆ cachePath()

const std::string& mbgl::ResourceOptions::cachePath ( ) const

Gets the previously set (or default) cache path.

Returns
cache path

◆ clone()

ResourceOptions mbgl::ResourceOptions::clone ( ) const

◆ Default()

static ResourceOptions mbgl::ResourceOptions::Default ( )
static

Returns default resource options.

Returns
Resource options.

◆ maximumCacheSize()

uint64_t mbgl::ResourceOptions::maximumCacheSize ( ) const

Gets the previously set (or default) maximum allowed cache size.

Returns
maximum allowed cache database size in bytes.

◆ operator=() [1/2]

ResourceOptions& mbgl::ResourceOptions::operator= ( const ResourceOptions options)

◆ operator=() [2/2]

ResourceOptions& mbgl::ResourceOptions::operator= ( ResourceOptions &&  options)

◆ platformContext()

void* mbgl::ResourceOptions::platformContext ( ) const

Gets the previously set (or default) platform context.

Returns
Platform context.

◆ tileServerOptions()

const TileServerOptions mbgl::ResourceOptions::tileServerOptions ( ) const

Gets the previously set (or default) TileServerOptions.

Returns
const TileServerOptions tile server options.

◆ withApiKey()

ResourceOptions& mbgl::ResourceOptions::withApiKey ( std::string  token)

Sets the Mapbox access token - see https://docs.mapbox.com/help/how-mapbox-works/access-tokens/ for details.

Parameters
tokenMapbox access token.
Returns
ResourceOptions for chaining options together.

◆ withAssetPath()

ResourceOptions& mbgl::ResourceOptions::withAssetPath ( std::string  path)

Sets the asset path, which is the root directory from where the asset:// scheme gets resolved in a style.

Parameters
pathAsset path.
Returns
ResourceOptions for chaining options together.

◆ withCachePath()

ResourceOptions& mbgl::ResourceOptions::withCachePath ( std::string  path)

Sets the cache path.

Parameters
pathCache path.
Returns
ResourceOptions for chaining options together.

◆ withMaximumCacheSize()

ResourceOptions& mbgl::ResourceOptions::withMaximumCacheSize ( uint64_t  size)

Sets the maximum cache size.

Parameters
sizeCache maximum size in bytes.
Returns
reference to ResourceOptions for chaining options together.

◆ withPlatformContext()

ResourceOptions& mbgl::ResourceOptions::withPlatformContext ( void *  context)

Sets the platform context. A platform context is usually an object that assists the creation of a file source.

Parameters
contextPlatform context.
Returns
reference to ResourceOptions for chaining options together.

◆ withTileServerOptions()

ResourceOptions& mbgl::ResourceOptions::withTileServerOptions ( TileServerOptions  tileServerOptions)

Sets the tile server options..

Parameters
tileServerOptionsTile server options.
Returns
ResourceOptions for chaining options together.

The documentation for this class was generated from the following file: