CaptureMoment 0.1.0
Free and open-source non-destructive photo editor
Loading...
Searching...
No Matches
file_serializer_manager.h
Go to the documentation of this file.
1
9#pragma once
10
13
14#include <memory>
15#include <span>
16#include <string_view>
17#include <vector>
18
20
21namespace CaptureMoment::Core {
22
23namespace Serializer {
24
36public:
45 explicit FileSerializerManager(
46 std::unique_ptr<IFileSerializerWriter> writer,
47 std::unique_ptr<IFileSerializerReader> reader
48 );
49
51
52 // Disable copy/move for simplicity, assuming unique_ptr dependencies
57
68 [[nodiscard]] bool saveToFile(
69 std::string_view source_image_path,
70 std::span<const Operations::OperationDescriptor> operations
71 ) const;
72
82 [[nodiscard]] std::vector<Operations::OperationDescriptor> loadFromFile(std::string_view source_image_path) const;
83
84private:
88 std::unique_ptr<IFileSerializerWriter> m_writer;
89
93 std::unique_ptr<IFileSerializerReader> m_reader;
94};
95
96} // Serializer
97} // namespace CaptureMoment::Core
High-level manager orchestrating file-based serialization and deserialization of operation data.
FileSerializerManager & operator=(FileSerializerManager &&)=delete
FileSerializerManager & operator=(const FileSerializerManager &)=delete
std::vector< Operations::OperationDescriptor > loadFromFile(std::string_view source_image_path) const
Loads a list of operations from a file associated with the source image path.
FileSerializerManager(std::unique_ptr< IFileSerializerWriter > writer, std::unique_ptr< IFileSerializerReader > reader)
Constructs a FileSerializerManager.
FileSerializerManager(FileSerializerManager &&)=delete
bool saveToFile(std::string_view source_image_path, std::span< const Operations::OperationDescriptor > operations) const
Saves the provided list of operations to a file associated with the source image path.
FileSerializerManager(const FileSerializerManager &)=delete
Declaration of IFileSerializerReader interface.
Declaration of IFileSerializerWriter interface.
Manages the lifecycle of a single IWorkingImage instance.
Descriptor of an operation with its parameters and unique identifier.
CaptureMoment — footer