libdisplaydevice master
C++ library to modify display devices.
file_settings_persistence.h
Go to the documentation of this file.
1
5#pragma once
6
7// system includes
8#include <filesystem>
9
10// local includes
12
13namespace display_device {
19 public:
24 explicit FileSettingsPersistence(std::filesystem::path filepath);
25
30 [[nodiscard]] bool store(const std::vector<std::uint8_t> &data) override;
31
37 [[nodiscard]] std::optional<std::vector<std::uint8_t>> load() const override;
38
42 [[nodiscard]] bool clear() override;
43
44 private:
45 std::filesystem::path m_filepath;
46 };
47} // namespace display_device
Implementation of the SettingsPersistenceInterface, that saves/loads the persistent settings to/from ...
Definition file_settings_persistence.h:18
std::optional< std::vector< std::uint8_t > > load() const override
Load saved settings data.
Definition file_settings_persistence.cpp:42
bool clear() override
Clear the persistent settings data.
Definition file_settings_persistence.cpp:80
bool store(const std::vector< std::uint8_t > &data) override
Store the provided data.
Definition file_settings_persistence.cpp:25
FileSettingsPersistence(std::filesystem::path filepath)
Definition file_settings_persistence.cpp:18
A class for storing and loading settings data from a persistent medium.
Definition settings_persistence_interface.h:16
Declarations for the SettingsPersistenceInterface.