libdisplaydevice latest
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
31 [[nodiscard]] bool store(const std::vector<std::uint8_t> &data) override;
32
38 [[nodiscard]] std::optional<std::vector<std::uint8_t>> load() const override;
39
44 [[nodiscard]] bool clear() override;
45
46 private:
47 std::filesystem::path m_filepath;
48 };
49} // 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
Definition file_settings_persistence.cpp:41
bool clear() override
Definition file_settings_persistence.cpp:67
bool store(const std::vector< std::uint8_t > &data) override
Definition file_settings_persistence.cpp:24
FileSettingsPersistence(std::filesystem::path filepath)
Definition file_settings_persistence.cpp:17
A class for storing and loading settings data from a persistent medium.
Definition settings_persistence_interface.h:16
Declarations for the SettingsPersistenceInterface.