Porytiles
Loading...
Searching...
No Matches
tileset_artifact_writer.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <any>
4
10
11namespace porytiles2 {
12
26 public:
27 virtual ~TilesetArtifactWriter() = default;
28
38 [[nodiscard]] virtual Result<void> begin_transaction() = 0;
39
50 [[nodiscard]] virtual ChainableResult<void> commit() = 0;
51
62 [[nodiscard]] virtual Result<void> rollback() = 0;
63
84 [[nodiscard]] virtual ChainableResult<void>
85 write(const ArtifactKey &dest_key, const TilesetArtifact &artifact, const Tileset &src) = 0;
86};
87
88} // namespace porytiles2
A type-safe wrapper for artifact keys.
A result type that maintains a chainable sequence of errors for debugging and error reporting.
Abstract interface for writing tileset artifacts from a Tileset object to a backing store.
virtual Result< void > rollback()=0
Rolls back all buffered write operations in the current transaction.
virtual ChainableResult< void > write(const ArtifactKey &dest_key, const TilesetArtifact &artifact, const Tileset &src)=0
Writes an artifact from a Tileset to the backing store.
virtual ChainableResult< void > commit()=0
Commits all buffered write operations in the current transaction.
virtual ~TilesetArtifactWriter()=default
virtual Result< void > begin_transaction()=0
Begins a new transaction for atomic write operations.
Represents a Pokémon Generation III decomp tileset artifact with type and optional metadata.
A complete tileset containing both Porytiles and Porymap components.
Definition tileset.hpp:14
std::expected< T, E > Result
A result with some type T on success, otherwise an error of type E.
Definition result.hpp:25