Pixie
Loading...
Searching...
No Matches
pixie::FileArchiveBase< Impl > Class Template Reference

CRTP facade for file-archive lookup and extraction. More...

#include <file_archive.h>

Public Member Functions

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).
 

Static Public Member Functions

static constexpr std::uint32_t format_version ()
 Return the serialized file-archive format version.
 

Detailed Description

template<class Impl>
class pixie::FileArchiveBase< Impl >

CRTP facade for file-archive lookup and extraction.

Impl must provide stable record and path views, a queryable byte wavelet tree whose symbols cover all logical content, the logical content size, construction type, and path-storage size. Views returned by an implementation must remain valid for the facade object's lifetime. Owning implementations own this state; read-only implementations may retain non-owning views whose backing storage must outlive the facade.

Template Parameters
ImplOwning or read-only concrete archive implementation.

Member Function Documentation

◆ entry()

template<class Impl>
FileArchiveEntry pixie::FileArchiveBase< Impl >::entry ( std::size_t index) const
inline

Return metadata for an entry.

Exceptions
std::out_of_rangeif index is not an archived entry.

◆ extract()

template<class Impl>
std::vector< std::byte > pixie::FileArchiveBase< Impl >::extract ( std::size_t index) const
inline

Reconstruct the complete byte content of one entry.

Exceptions
std::out_of_rangeif index is not an archived entry.

◆ extract_lines()

template<class Impl>
std::vector< std::byte > pixie::FileArchiveBase< Impl >::extract_lines ( std::size_t index,
std::size_t left,
std::size_t right ) const
inline

Reconstruct zero-based half-open line range [left, right).

LF terminators are retained. Empty intervals are allowed. A trailing LF does not create an additional line.

Exceptions
std::out_of_rangeif index or [left, right) is out of range.
std::invalid_argumentif the entry is not a regular text file.

◆ find()

template<class Impl>
std::optional< std::size_t > pixie::FileArchiveBase< Impl >::find ( std::string_view path) const
inline

Find an exact archive-relative path.

Returns
Its zero-based entry index, or std::nullopt when absent.

The documentation for this class was generated from the following file: