Monopoly — Portage moderne 0.1.0
Portage moderne C/C++23 du Monopoly de 1999
Loading...
Searching...
No Matches
monopoly::data::LegacyDataArchive Class Referencefinal

#include <LegacyDataArchive.hpp>

Public Member Functions

 LegacyDataArchive (const LegacyDataArchive &)=delete
 
LegacyDataArchive & operator= (const LegacyDataArchive &)=delete
 
 LegacyDataArchive (LegacyDataArchive &&)=delete
 
LegacyDataArchive & operator= (LegacyDataArchive &&)=delete
 
 ~LegacyDataArchive ()
 
void close () noexcept
 
bool isOpen () const noexcept
 
std::uint16_t group () const noexcept
 
const std::filesystem::path & path () const noexcept
 
ArchiveVersion version () const noexcept
 
std::uint32_t storedChecksum () const noexcept
 
std::size_t itemCount () const noexcept
 
std::expected< ArchiveItemMetadata, DataError > metadata (DataTag tag) const
 
std::expected< LegacyDataType, DataError > initialDataType (DataTag tag) const
 
std::expected< std::uint32_t, DataError > initialSize (DataTag tag) const
 
std::expected< std::uint32_t, DataError > loadedRawSize (DataTag tag)
 
std::expected< SharedDataBytes, DataError > load (DataTag tag)
 
std::expected< std::size_t, DataError > readRaw (DataTag tag, std::span< std::byte > destination, std::uint32_t startOffset=0)
 
std::expected< bool, DataError > isLoaded (DataTag tag) const
 
std::expected< bool, DataError > unload (DataTag tag)
 
void clearCache () noexcept
 
std::size_t cachedItemCount () const noexcept
 

Static Public Member Functions

static std::expected< std::shared_ptr< LegacyDataArchive >, DataError > open (const std::filesystem::path &path, std::uint16_t group, ArchiveOpenOptions options={})
 

Static Public Attributes

static constexpr std::size_t PhysicalHeaderSize = 28
 
static constexpr std::size_t PhysicalIndexRecordSize = 16
 
static constexpr std::uint16_t SupportedVersionMajor = 2
 
static constexpr std::uint16_t SupportedVersionMinor = 3
 
static constexpr std::size_t MaximumItemCount = 65'536
 

Detailed Description

Definition at line 169 of file LegacyDataArchive.hpp.

Constructor & Destructor Documentation

◆ LegacyDataArchive() [1/2]

monopoly::data::LegacyDataArchive::LegacyDataArchive ( const LegacyDataArchive &  )
delete

◆ LegacyDataArchive() [2/2]

monopoly::data::LegacyDataArchive::LegacyDataArchive ( LegacyDataArchive &&  )
delete

◆ ~LegacyDataArchive()

monopoly::data::LegacyDataArchive::~LegacyDataArchive ( )

Definition at line 349 of file LegacyDataArchive.cpp.

Member Function Documentation

◆ cachedItemCount()

std::size_t monopoly::data::LegacyDataArchive::cachedItemCount ( ) const
noexcept

Definition at line 1023 of file LegacyDataArchive.cpp.

◆ clearCache()

void monopoly::data::LegacyDataArchive::clearCache ( )
noexcept

Definition at line 1011 of file LegacyDataArchive.cpp.

◆ close()

void monopoly::data::LegacyDataArchive::close ( )
noexcept

Definition at line 598 of file LegacyDataArchive.cpp.

◆ group()

std::uint16_t monopoly::data::LegacyDataArchive::group ( ) const
noexcept

Definition at line 620 of file LegacyDataArchive.cpp.

◆ initialDataType()

std::expected< LegacyDataType, DataError > monopoly::data::LegacyDataArchive::initialDataType ( DataTag  tag) const

Definition at line 667 of file LegacyDataArchive.cpp.

◆ initialSize()

std::expected< std::uint32_t, DataError > monopoly::data::LegacyDataArchive::initialSize ( DataTag  tag) const

Definition at line 676 of file LegacyDataArchive.cpp.

◆ isLoaded()

std::expected< bool, DataError > monopoly::data::LegacyDataArchive::isLoaded ( DataTag  tag) const

Definition at line 954 of file LegacyDataArchive.cpp.

◆ isOpen()

bool monopoly::data::LegacyDataArchive::isOpen ( ) const
noexcept

Definition at line 613 of file LegacyDataArchive.cpp.

◆ itemCount()

std::size_t monopoly::data::LegacyDataArchive::itemCount ( ) const
noexcept

Definition at line 644 of file LegacyDataArchive.cpp.

◆ load()

std::expected< SharedDataBytes, DataError > monopoly::data::LegacyDataArchive::load ( DataTag  tag)

Definition at line 704 of file LegacyDataArchive.cpp.

◆ loadedRawSize()

std::expected< std::uint32_t, DataError > monopoly::data::LegacyDataArchive::loadedRawSize ( DataTag  tag)

Definition at line 685 of file LegacyDataArchive.cpp.

◆ metadata()

std::expected< ArchiveItemMetadata, DataError > monopoly::data::LegacyDataArchive::metadata ( DataTag  tag) const

Definition at line 651 of file LegacyDataArchive.cpp.

◆ open()

std::expected< std::shared_ptr< LegacyDataArchive >, DataError > monopoly::data::LegacyDataArchive::open ( const std::filesystem::path &  path,
std::uint16_t  group,
ArchiveOpenOptions  options = {} 
)
static

Definition at line 356 of file LegacyDataArchive.cpp.

◆ operator=() [1/2]

LegacyDataArchive & monopoly::data::LegacyDataArchive::operator= ( const LegacyDataArchive &  )
delete

◆ operator=() [2/2]

LegacyDataArchive & monopoly::data::LegacyDataArchive::operator= ( LegacyDataArchive &&  )
delete

◆ path()

const std::filesystem::path & monopoly::data::LegacyDataArchive::path ( ) const
noexcept

Definition at line 626 of file LegacyDataArchive.cpp.

◆ readRaw()

std::expected< std::size_t, DataError > monopoly::data::LegacyDataArchive::readRaw ( DataTag  tag,
std::span< std::byte >  destination,
std::uint32_t  startOffset = 0 
)

Definition at line 800 of file LegacyDataArchive.cpp.

◆ storedChecksum()

std::uint32_t monopoly::data::LegacyDataArchive::storedChecksum ( ) const
noexcept

Definition at line 638 of file LegacyDataArchive.cpp.

◆ unload()

std::expected< bool, DataError > monopoly::data::LegacyDataArchive::unload ( DataTag  tag)

Definition at line 983 of file LegacyDataArchive.cpp.

◆ version()

ArchiveVersion monopoly::data::LegacyDataArchive::version ( ) const
noexcept

Definition at line 632 of file LegacyDataArchive.cpp.

Member Data Documentation

◆ MaximumItemCount

constexpr std::size_t monopoly::data::LegacyDataArchive::MaximumItemCount = 65'536
staticconstexpr

Definition at line 176 of file LegacyDataArchive.hpp.

◆ PhysicalHeaderSize

constexpr std::size_t monopoly::data::LegacyDataArchive::PhysicalHeaderSize = 28
staticconstexpr

Definition at line 172 of file LegacyDataArchive.hpp.

◆ PhysicalIndexRecordSize

constexpr std::size_t monopoly::data::LegacyDataArchive::PhysicalIndexRecordSize = 16
staticconstexpr

Definition at line 173 of file LegacyDataArchive.hpp.

◆ SupportedVersionMajor

constexpr std::uint16_t monopoly::data::LegacyDataArchive::SupportedVersionMajor = 2
staticconstexpr

Definition at line 174 of file LegacyDataArchive.hpp.

◆ SupportedVersionMinor

constexpr std::uint16_t monopoly::data::LegacyDataArchive::SupportedVersionMinor = 3
staticconstexpr

Definition at line 175 of file LegacyDataArchive.hpp.


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