* [qt] Updating CMake project files for Qt6 * [qt] Updating non-test projects for Qt6 and msvc2019 * [qt] Test fixes for Qt6 and msvc2019 * [qt] Link whole test archive for Qt and msvc2019 * [qt] Fixing Qt6 headless backend renderer * [qt] Fixes for test failures * [qt] Expression and style parser test fixes * [qt] Backwards compatibility with Qt5 and Qt6 Minimum version is Qt 5.4 due to use of QOpenGLWidget * [qt] LLVM is no longer required for a Windows build * [msvc] msvc2019 fixes for maplibre * Update test/storage/offline_database.test.cpp Co-authored-by: Tadej Novak <tadej@tano.si> * Vector + const is not standard C++ Co-authored-by: Tadej Novak <tadej@tano.si>
133 lines
3.5 KiB
C++
133 lines
3.5 KiB
C++
#pragma once
|
|
|
|
#include <memory>
|
|
#include <string>
|
|
#include <mbgl/util/tile_server_options.hpp>
|
|
|
|
namespace mbgl {
|
|
|
|
/**
|
|
* @brief Holds values for resource options.
|
|
*/
|
|
class ResourceOptions final {
|
|
public:
|
|
/**
|
|
* @brief Constructs a ResourceOptions object with default values.
|
|
*/
|
|
ResourceOptions();
|
|
~ResourceOptions();
|
|
|
|
ResourceOptions(ResourceOptions&&) noexcept;
|
|
ResourceOptions& operator=(const ResourceOptions& options);
|
|
ResourceOptions& operator=(ResourceOptions&& options);
|
|
|
|
ResourceOptions clone() const;
|
|
|
|
/**
|
|
* @brief Sets the Mapbox access token - see https://docs.mapbox.com/help/how-mapbox-works/access-tokens/ for details.
|
|
*
|
|
* @param token Mapbox access token.
|
|
* @return ResourceOptions for chaining options together.
|
|
*/
|
|
ResourceOptions& withApiKey(std::string token);
|
|
|
|
/**
|
|
* @brief Gets the previously set (or default) Mapbox access token.
|
|
*
|
|
* @return const std::string& Mapbox access token.
|
|
*/
|
|
const std::string& apiKey() const;
|
|
|
|
/**
|
|
* @brief Sets the tile server options..
|
|
*
|
|
* @param tileServerOptions Tile server options.
|
|
* @return ResourceOptions for chaining options together.
|
|
*/
|
|
ResourceOptions& withTileServerOptions(TileServerOptions tileServerOptions);
|
|
|
|
/**
|
|
* @brief Gets the previously set (or default) TileServerOptions.
|
|
*
|
|
* @return const TileServerOptions tile server options.
|
|
*/
|
|
const TileServerOptions tileServerOptions() const;
|
|
|
|
/**
|
|
* @brief Sets the cache path.
|
|
*
|
|
* @param path Cache path.
|
|
* @return ResourceOptions for chaining options together.
|
|
*/
|
|
ResourceOptions& withCachePath(std::string path);
|
|
|
|
/**
|
|
* @brief Gets the previously set (or default) cache path.
|
|
*
|
|
* @return cache path
|
|
*/
|
|
const std::string& cachePath() const;
|
|
|
|
/**
|
|
* @brief Sets the asset path, which is the root directory from where
|
|
* the asset:// scheme gets resolved in a style.
|
|
*
|
|
* @param path Asset path.
|
|
* @return ResourceOptions for chaining options together.
|
|
*/
|
|
ResourceOptions& withAssetPath(std::string path);
|
|
|
|
/**
|
|
* @brief Gets the previously set (or default) asset path.
|
|
*
|
|
* @return asset path
|
|
*/
|
|
const std::string& assetPath() const;
|
|
|
|
/**
|
|
* @brief Sets the maximum cache size.
|
|
*
|
|
* @param size Cache maximum size in bytes.
|
|
* @return reference to ResourceOptions for chaining options together.
|
|
*/
|
|
ResourceOptions& withMaximumCacheSize(uint64_t size);
|
|
|
|
/**
|
|
* @brief Gets the previously set (or default) maximum allowed cache size.
|
|
*
|
|
* @return maximum allowed cache database size in bytes.
|
|
*/
|
|
uint64_t maximumCacheSize() const;
|
|
|
|
/**
|
|
* @brief Sets the platform context. A platform context is usually an object
|
|
* that assists the creation of a file source.
|
|
*
|
|
* @param context Platform context.
|
|
* @return reference to ResourceOptions for chaining options together.
|
|
*/
|
|
ResourceOptions& withPlatformContext(void* context);
|
|
|
|
/**
|
|
* @brief Gets the previously set (or default) platform context.
|
|
*
|
|
* @return Platform context.
|
|
*/
|
|
void* platformContext() const;
|
|
|
|
/**
|
|
* @brief Returns default resource options.
|
|
*
|
|
* @return Resource options.
|
|
*/
|
|
static ResourceOptions Default();
|
|
|
|
private:
|
|
ResourceOptions(const ResourceOptions&);
|
|
|
|
class Impl;
|
|
std::unique_ptr<Impl> impl_;
|
|
};
|
|
|
|
} // namespace mbgl
|