![]() |
Pixie
|
Storage-backed byte-oriented file archive. More...
#include <file_archive.h>
Public Member Functions | |
| FileArchiveIndex (const FileArchiveIndex &)=default | |
| Owning archives are move-only; archive views are copyable. | |
| FileArchiveIndex & | operator= (const FileArchiveIndex &)=default |
| FileArchiveIndex (const FileArchiveIndex &)=delete | |
| FileArchiveIndex & | operator= (const FileArchiveIndex &)=delete |
| FileArchiveIndex (FileArchiveIndex &&) noexcept=default | |
| FileArchiveIndex & | operator= (FileArchiveIndex &&) noexcept=default |
| FileArchiveIndex (std::vector< FileArchiveSource > sources, WaveletTreeBuildType build_type=WaveletTreeBuildType::Huffman) | |
| Construct an archive from file and symlink sources. | |
| template<class ReadSource> requires (std::same_as<Storage, AlignedStorage>) | |
| FileArchiveIndex (std::vector< FileArchiveSourceMetadata > sources, ReadSource &&read_source, WaveletTreeBuildType build_type=WaveletTreeBuildType::Huffman) | |
| Construct from metadata and a replayable chunk reader. | |
| void | serialize_impl (BinaryWriter &writer) const |
| Serialize one native, framed Pixie file archive. | |
Public Member Functions inherited from pixie::FileArchiveBase< FileArchiveIndex< Storage > > | |
| std::size_t | size () const |
| Return the number of archived entries. | |
| bool | empty () const |
| Return whether the archive has no entries. | |
| std::size_t | logical_size_bytes () const |
| Return the number of logical content bytes, excluding framing. | |
| WaveletTreeBuildType | build_type () const |
| Return the wavelet-tree construction strategy. | |
| std::size_t | file_table_bytes () const |
| Return serialized fixed-record bytes. | |
| std::size_t | path_storage_bytes () const |
| Return serialized path-blob bytes. | |
| std::size_t | metadata_bytes () const |
| Return framing, file-table, path, and alignment bytes. | |
| std::optional< std::size_t > | find (std::string_view path) const |
| Find an exact archive-relative path. | |
| FileArchiveEntry | entry (std::size_t index) const |
| Return metadata for an entry. | |
| std::vector< std::byte > | extract (std::size_t index) const |
| Reconstruct the complete byte content of one entry. | |
| std::vector< std::byte > | extract_lines (std::size_t index, std::size_t left, std::size_t right) const |
Reconstruct zero-based half-open line range [left, right). | |
Public Member Functions inherited from pixie::SerializationBase< FileArchiveIndex< Storage > > | |
| void | serialize (BinaryWriter &writer) const |
| Serialize this value through its concrete implementation. | |
Static Public Member Functions | |
| static FileArchiveIndex | deserialize_impl (BinaryReader &reader, DeserializationValidation validation=DeserializationValidation::kQuick) |
| Deserialize one framed archive using this specialization's storage. | |
Static Public Member Functions inherited from pixie::FileArchiveBase< FileArchiveIndex< Storage > > | |
| static constexpr std::uint32_t | format_version () |
| Return the serialized file-archive format version. | |
Static Public Member Functions inherited from pixie::SerializationBase< FileArchiveIndex< Storage > > | |
| static FileArchiveIndex< Storage > | deserialize (BinaryReader &reader, Context &&... context) |
Restore exactly Derived and advance reader on success. | |
| static FileArchiveIndex< Storage > | deserialize (std::span< const std::byte > &data, Context &&... context) |
Restore exactly Derived and advance a mutable byte span. | |
Friends | |
| class | FileArchiveBase< FileArchiveIndex > |
| Permit the facade to use the documented extension points. | |
Storage-backed byte-oriented file archive.
| Storage | Owning aligned storage or a non-owning read-only view. |
|
default |
Owning archives are move-only; archive views are copyable.
Internal rank indexes retain views into their wavelet-node bit storage, so copying without rebuilding those indexes would leave views bound to the source archive.
|
inlineexplicit |
Construct an archive from file and symlink sources.
Sources are sorted by path. Paths must be non-empty, unique, valid UTF-8 strings. Content is preserved byte-for-byte.
|
inline |
Construct from metadata and a replayable chunk reader.
The reader is called twice per source in sorted path order. It receives (const FileArchiveSourceMetadata&, consumer) and must pass the same immutable content to consumer as byte spans on both calls. The first pass derives metadata and symbol counts; the second constructs the tree without retaining complete source contents.
| std::invalid_argument | for invalid metadata or changed content. |
|
inlinestatic |
Deserialize one framed archive using this specialization's storage.
Owners copy paths and all wavelet-tree storage. Views retain slices of the reader's backing bytes, which must outlive the result.