summaryrefslogtreecommitdiff
path: root/include/mbgl/storage/file_source_options.hpp
blob: 6e9d8d6081fe72e16b3322a1cbcbd80d073ddb33 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#pragma once

#include <cstdint>
#include <memory>
#include <string>

namespace mbgl {

/**
 * @brief Holds values for FileSource options.
 */

class FileSourceOptions {
public:
    /**
     * @brief Constructs a FileSourceOptions object with default values.
     */
    FileSourceOptions();
    ~FileSourceOptions();

    /**
     * @brief Sets the Mapbox API access token.
     * Details: https://docs.mapbox.com/help/glossary/access-token/ 
     * 
     * @param accessToken Mapbox API access token, as string.
     * @return reference to FileSourceOptions for chaining options together.
     */
    FileSourceOptions& withAccessToken(std::string accessToken);

    /**
     * @brief Gets the previously set Mapbox API access token.
     * Details: https://docs.mapbox.com/help/glossary/access-token/ 
     *
     * @return Mapbox API access token, as string.
     */
    const std::string& accessToken() const;

    /**
     * @brief Sets the cache path.
     *
     * @param path Cache path.
     * @return reference to FileSourceOptions for chaining options together.
     */
    FileSourceOptions& 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 reference to FileSourceOptions for chaining options together.
     */
    FileSourceOptions& withAssetRoot(std::string path);

    /**
     * @brief Gets the previously set (or default) asset path.
     *
     * @return asset path
     */
    const std::string& assetRoot() const;

    /**
     * @brief Sets the maximum cache size.
     *
     * @param size Cache maximum size in bytes.
     * @return reference to FileSourceOptions for chaining options together.
     */
    FileSourceOptions& 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;

private:
    class Impl;
    std::shared_ptr<Impl> impl_;
};

} // namespace mbgl