Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
staging.hpp File Reference

Extract privately, publish atomically, never replace. More...

#include <pulp/authoring_capsule/archive.hpp>
#include <pulp/authoring_capsule/manifest.hpp>
#include <pulp/authoring_capsule/status.hpp>
#include <pulp/runtime/result.hpp>
#include <cstdint>
#include <filesystem>
#include <functional>
#include <memory>
#include <string>
#include <vector>

Go to the source code of this file.

Classes

class  pulp::authoring_capsule::StagingArea
 A private directory that is removed when it goes out of scope unless it was published. More...

Namespaces

namespace  pulp
namespace  pulp::authoring_capsule

Typedefs

using pulp::authoring_capsule::ExtractionProgress = std::function<bool(std::size_t member_index, std::size_t member_count)>
 Progress and cancellation.

Functions

runtime::Result< void, CapsuleError > pulp::authoring_capsule::extract_declared (const CapsuleArchive &archive, const Manifest &manifest, const StagingArea &staging, const ExtractionProgress &progress={})
 Extract only the members the manifest declares, verifying each digest as it lands.
runtime::Result< std::vector< std::uint8_t >, CapsuleError > pulp::authoring_capsule::read_staged_member (const StagingArea &staging, const FileEntry &entry)
 Read one member back out of a staged tree.
runtime::Result< std::vector< std::uint8_t >, CapsuleError > pulp::authoring_capsule::read_staged_member (const std::filesystem::path &staging_root, const FileEntry &entry)
 Reads a declared member from a staging root the caller does not own.

Detailed Description

Extract privately, publish atomically, never replace.

Import writes into a directory only its owner can see, then makes the result visible under a name that was previously absent. A matching incoming project identity therefore cannot silently overwrite a project the user already has, and a failure at any point leaves the last good state exactly as it was.