Files
MapLibreParticleLab/include/mbgl/util/client_options.hpp
Tadej Novak 1341f33ba4 Add ClientOptions to be able to pass around client name and version (#365)
* ClientOptions and Qt user agent

* Update CHANGELOG.md

Co-authored-by: Oliver Wipfli <oliver.wipfli@leichteralsluft.ch>

Co-authored-by: Oliver Wipfli <oliver.wipfli@leichteralsluft.ch>
2022-08-13 15:36:50 +02:00

63 lines
1.3 KiB
C++

#pragma once
#include <memory>
#include <string>
namespace mbgl {
/**
* @brief Holds values for client options.
*/
class ClientOptions final {
public:
/**
* @brief Constructs a ClientOptions object with default values.
*/
ClientOptions();
~ClientOptions();
ClientOptions(ClientOptions&&) noexcept;
ClientOptions& operator=(const ClientOptions& options);
ClientOptions& operator=(ClientOptions&& options);
ClientOptions clone() const;
/**
* @brief Sets the client name.
*
* @param name Client name.
* @return ClientOptions for chaining options together.
*/
ClientOptions& withName(std::string name);
/**
* @brief Gets the previously set (or default) client name.
*
* @return client name
*/
const std::string& name() const;
/**
* @brief Sets the client version.
*
* @param version Client version.
* @return ClientOptions for chaining options together.
*/
ClientOptions& withVersion(std::string version);
/**
* @brief Gets the previously set (or default) client version.
*
* @return client version
*/
const std::string& version() const;
private:
ClientOptions(const ClientOptions&);
class Impl;
std::unique_ptr<Impl> impl_;
};
} // namespace mbgl