Pixie
Loading...
Searching...
No Matches
file_archive.h File Reference

Self-contained byte-oriented file archives with line extraction. More...

#include <pixie/detail/serialization.h>
#include <pixie/storage/read_only_view.h>
#include <pixie/wavelet_tree/implementations.h>
#include <algorithm>
#include <array>
#include <cstddef>
#include <cstdint>
#include <limits>
#include <optional>
#include <span>
#include <stdexcept>
#include <string>
#include <string_view>
#include <utility>
#include <vector>

Go to the source code of this file.

Classes

struct  pixie::FileArchiveSource
 Source entry used to construct an owning file archive. More...
 
struct  pixie::FileArchiveSourceMetadata
 Metadata for one replayable archive-construction source. More...
 
struct  pixie::FileArchiveEntry
 Public metadata for one archive entry. More...
 
struct  pixie::file_archive_detail::FileRecord
 
class  pixie::file_archive_detail::Utf8Validator
 Incrementally validate a byte stream as UTF-8. More...
 
class  pixie::FileArchiveBase< Impl >
 CRTP facade for file-archive lookup and extraction. More...
 
class  pixie::FileArchiveIndex< Storage >
 Storage-backed byte-oriented file archive. More...
 

Typedefs

using pixie::FileArchive = FileArchiveIndex<AlignedStorage>
 Owning aligned-storage file archive.
 
using pixie::FileArchiveView = FileArchiveIndex<ReadOnlyStorageView>
 Read-only file archive retaining serialized storage views.
 

Enumerations

enum class  pixie::FileArchiveEntryType : std::uint8_t { kRegular = 0 , kSymlink = 1 }
 Kind of filesystem entry stored in a file archive.
 

Functions

bool pixie::file_archive_detail::IsUtf8 (std::span< const std::byte > bytes, bool reject_nul)
 
bool pixie::file_archive_detail::IsUtf8 (std::string_view value, bool reject_nul)
 
std::size_t pixie::file_archive_detail::CheckedSize (std::uint64_t value)
 
void pixie::file_archive_detail::RequireZeroBytes (std::span< const std::byte > bytes, std::size_t offset)
 

Variables

constexpr std::array< std::uint8_t, 8 > pixie::file_archive_detail::kMagic
 
constexpr std::uint32_t pixie::file_archive_detail::kVersion = 5
 
constexpr std::size_t pixie::file_archive_detail::kHeaderBytes = 3 * sizeof(std::uint64_t)
 
constexpr std::size_t pixie::file_archive_detail::kMetadataHeaderBytes
 
constexpr std::size_t pixie::file_archive_detail::kRecordBytes
 
constexpr std::size_t pixie::file_archive_detail::kByteAlphabetSize = 256
 

Detailed Description

Self-contained byte-oriented file archives with line extraction.

Variable Documentation

◆ kMagic

std::array<std::uint8_t, 8> pixie::file_archive_detail::kMagic
inlineconstexpr
Initial value:
= {'P', 'I', 'X', 'A',
'R', 'C', 'H', '1'}

◆ kMetadataHeaderBytes

std::size_t pixie::file_archive_detail::kMetadataHeaderBytes
inlineconstexpr
Initial value:
=
kHeaderBytes + 2 * sizeof(std::uint32_t) + 5 * sizeof(std::uint64_t)

◆ kRecordBytes

std::size_t pixie::file_archive_detail::kRecordBytes
inlineconstexpr
Initial value:
=
6 * sizeof(std::uint64_t) + sizeof(std::uint32_t) + 4