Builds a private sibling directory and publishes it at a previously absent destination. More...
#include <atomic_publisher.hpp>
Public Member Functions | |
| ~AtomicPublisher () | |
| AtomicPublisher (AtomicPublisher &&) noexcept | |
| AtomicPublisher & | operator= (AtomicPublisher &&) noexcept |
| AtomicPublisher (const AtomicPublisher &)=delete | |
| AtomicPublisher & | operator= (const AtomicPublisher &)=delete |
| const std::filesystem::path & | staging_directory () const noexcept |
| Returns the private root for a directory publication. | |
| const std::filesystem::path & | staging_file () const noexcept |
| Returns the pre-created private file slot for a file publication. | |
| runtime::Result< bool, PackageError > | write (std::string_view relative_utf8, std::span< const std::uint8_t > bytes) noexcept |
| Writes and durably fences one lexically safe relative file. | |
| runtime::Result< bool, PackageError > | write (std::string_view relative_utf8, std::string_view text) noexcept |
| Writes and durably fences one UTF-8 text file. | |
| runtime::Result< AtomicPublishOutcome, PackageError > | commit_file (const std::filesystem::path &staged_file) noexcept |
| Publishes the pre-created staging_file() at the destination. | |
| runtime::Result< AtomicPublishOutcome, PackageError > | commit_directory () noexcept |
| Publishes the complete staged tree without replacing an existing path. | |
| void | cancel () noexcept |
| Removes unpublished staging on a best-effort basis. | |
Static Public Member Functions | |
| static runtime::Result< AtomicPublisher, PackageError > | create (const std::filesystem::path &destination) noexcept |
| Creates a private staging sibling for a destination that must not exist. | |
| static runtime::Result< AtomicPublisher, PackageError > | create_file (const std::filesystem::path &destination) noexcept |
| Creates a private, pre-permissioned file slot for one external writer. | |
Builds a private sibling directory and publishes it at a previously absent destination.
Every staged file and directory entry is fenced before the destination name becomes visible. The private stage coordinates trusted writers; another process running as the same account must not rename or replace its entries behind the publisher.
| pulp::project_package::AtomicPublisher::~AtomicPublisher | ( | ) |
|
noexcept |
|
delete |
|
noexcept |
Removes unpublished staging on a best-effort basis.
|
noexcept |
Publishes the complete staged tree without replacing an existing path.
All file bytes and nested directory entries are durable before the destination name becomes visible. A post-publication finalization failure returns PublishedDurabilityUncertain, never NotPublished.
|
noexcept |
Publishes the pre-created staging_file() at the destination.
The destination must not exist. A post-publication finalization failure returns PublishedDurabilityUncertain, never NotPublished.
|
staticnoexcept |
Creates a private staging sibling for a destination that must not exist.
|
staticnoexcept |
Creates a private, pre-permissioned file slot for one external writer.
|
noexcept |
|
delete |
|
noexcept |
Returns the private root for a directory publication.
External writers must stop before commit_directory() or cancel() begins.
|
noexcept |
Returns the pre-created private file slot for a file publication.
The external writer may truncate and fill this file, but must stop before commit_file() or cancel() begins.
|
noexcept |
Writes and durably fences one lexically safe relative file.
|
noexcept |
Writes and durably fences one UTF-8 text file.