7#if !defined(TETENGO_PROPERTY_PROPERTYSET_HPP)
8#define TETENGO_PROPERTY_PROPERTYSET_HPP
16#include <boost/core/noncopyable.hpp>
38 property_set(std::unique_ptr<storage_loader>&& p_storage_loader,
const std::filesystem::path& path);
55 [[nodiscard]] std::optional<bool>
get_bool(
const std::filesystem::path& key)
const;
63 void set_bool(
const std::filesystem::path& key,
bool value);
72 [[nodiscard]] std::optional<std::uint32_t>
get_uint32(
const std::filesystem::path& key)
const;
80 void set_uint32(
const std::filesystem::path& key, std::uint32_t value);
89 [[nodiscard]] std::optional<std::string>
get_string(
const std::filesystem::path& key)
const;
97 void set_string(
const std::filesystem::path& key,
const std::string& value);
118 const std::unique_ptr<impl> m_p_impl;
A property set.
Definition property_set.hpp:28
property_set(std::unique_ptr< storage_loader > &&p_storage_loader, const std::filesystem::path &path)
Creates a property set.
std::optional< std::uint32_t > get_uint32(const std::filesystem::path &key) const
Returns the value in an unsigned 32-bit integer.
void set_bool(const std::filesystem::path &key, bool value)
Sets a value in a boolean.
void update()
Updates the property values to the latest state in the storage.
std::optional< std::string > get_string(const std::filesystem::path &key) const
Returns the value in a string.
void set_string(const std::filesystem::path &key, const std::string &value)
Sets a value in a string.
virtual ~property_set()
Destroys the property set.
void commit() const
Commits the property value changes to the storage.
void set_uint32(const std::filesystem::path &key, std::uint32_t value)
Sets a value in an unsigned 32-bit integer.
std::optional< bool > get_bool(const std::filesystem::path &key) const
Returns the value in a boolean.