A storage.
More...
#include <storage.hpp>
|
using | value_map_type = std::unordered_map< std::string, std::variant< bool, std::uint32_t, std::string > > |
| The value map type.
|
|
|
virtual | ~storage () |
| Destroys the storage.
|
|
std::optional< bool > | get_bool (const std::filesystem::path &key) const |
| Returns the value in a boolean.
|
|
void | set_bool (const std::filesystem::path &key, bool value) |
| Sets a value in a boolean.
|
|
std::optional< std::uint32_t > | get_uint32 (const std::filesystem::path &key) const |
| Returns the value in an unsigned 32-bit integer.
|
|
void | set_uint32 (const std::filesystem::path &key, std::uint32_t value) |
| Sets a value in an unsigned 32-bit integer.
|
|
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.
|
|
void | save () const |
| Saves the values.
|
|
◆ storage()
Creates a storage.
- Parameters
-
◆ get_bool()
std::optional< bool > tetengo::property::storage::get_bool |
( |
const std::filesystem::path & |
key | ) |
const |
Returns the value in a boolean.
- Parameters
-
- Returns
- The value. Or std::nullopt when no such key.
◆ get_string()
std::optional< std::string > tetengo::property::storage::get_string |
( |
const std::filesystem::path & |
key | ) |
const |
Returns the value in a string.
- Parameters
-
- Returns
- The value. Or std::nullopt when no such key.
◆ get_uint32()
std::optional< std::uint32_t > tetengo::property::storage::get_uint32 |
( |
const std::filesystem::path & |
key | ) |
const |
Returns the value in an unsigned 32-bit integer.
- Parameters
-
- Returns
- The value. Or std::nullopt when no such key.
◆ set_bool()
void tetengo::property::storage::set_bool |
( |
const std::filesystem::path & |
key, |
|
|
bool |
value |
|
) |
| |
Sets a value in a boolean.
- Parameters
-
◆ set_string()
void tetengo::property::storage::set_string |
( |
const std::filesystem::path & |
key, |
|
|
const std::string & |
value |
|
) |
| |
Sets a value in a string.
- Parameters
-
◆ set_uint32()
void tetengo::property::storage::set_uint32 |
( |
const std::filesystem::path & |
key, |
|
|
std::uint32_t |
value |
|
) |
| |
Sets a value in an unsigned 32-bit integer.
- Parameters
-
◆ value_map()
const value_map_type & tetengo::property::storage::value_map |
( |
| ) |
const |
|
protected |
Returns the value map.
- Returns
- The value map.
The documentation for this class was generated from the following file:
- library/property/cpp/include/tetengo/property/storage.hpp