3#include <Foundation/Containers/DynamicArray.h>
4#include <Foundation/Containers/HashTable.h>
5#include <Foundation/Strings/HashedString.h>
10enum class plArchiveCompressionMode : plUInt8
21 plUInt64 m_uiDataStartOffset = 0;
22 plUInt64 m_uiUncompressedDataSize = 0;
23 plUInt64 m_uiStoredDataSize = 0;
24 plUInt32 m_uiPathStringOffset = 0;
25 plArchiveCompressionMode m_CompressionMode = plArchiveCompressionMode::Uncompressed;
40 PL_DECLARE_POD_TYPE();
46 , m_uiSrcStringOffset(uiSrcStringOffset)
50 plUInt32 m_uiLowerCaseHash;
51 plUInt32 m_uiSrcStringOffset;
65 PL_DECLARE_POD_TYPE();
70 , m_ArchiveAllPathStrings(archiveAllPathStrings)
74 plUInt32 m_uiLowerCaseHash;
83 PL_ALWAYS_INLINE
static plUInt32 Hash(
const plArchiveStoredString& hs) {
return hs.m_uiLowerCaseHash; }
84 PL_ALWAYS_INLINE
static plUInt32 Hash(
const plArchiveLookupString& hs) {
return hs.m_uiLowerCaseHash; }
92 return b.m_sString.
IsEqual_NoCase(
reinterpret_cast<const char*
>(&b.m_ArchiveAllPathStrings[a.m_uiSrcStringOffset]));
112 void RebuildPathToEntryHashes();
114 plStringView GetEntryPathString(plUInt32 uiEntryIdx)
const;
Data for a single file entry in an plArchive file.
Definition Archive.h:19
Helper class for looking up path strings in plArchiveTOC::FindEntry()
Definition Archive.h:61
Helper class to store a hashed string for quick lookup in the archive TOC.
Definition Archive.h:38
Table-of-contents for an plArchive file.
Definition Archive.h:98
plHashTable< plArchiveStoredString, plUInt32 > m_PathToEntryIndex
allows to map a hashed string to the index of the file entry for the file path
Definition Archive.h:103
plDynamicArray< plArchiveEntry > m_Entries
all files stored in the plArchive
Definition Archive.h:101
plDynamicArray< plUInt8 > m_AllPathStrings
one large array holding all path strings for the file entries, to reduce allocations
Definition Archive.h:105
Definition DynamicArray.h:81
Definition HashTable.h:333
static constexpr plUInt32 StringHashTo32(plUInt64 uiHash)
Truncates a 64 bit string hash to 32 bit.
Definition HashingUtils_inl.h:138
Maps a raw chunk of memory to the plStreamReader interface.
Definition MemoryStream.h:358
Interface for binary in (read) streams.
Definition Stream.h:22
Interface for binary out (write) streams.
Definition Stream.h:107
plStringView represent a read-only sub-string of a larger string, as it can store a dedicated string ...
Definition StringView.h:34
bool IsEqual_NoCase(plStringView sOther) const
Compares this string view with the other string view for equality.
Definition StringView_inl.h:95
Helper struct to calculate the Hash of different types.
Definition HashingUtils.h:75
Default enum for returning failure or success, instead of using a bool.
Definition Types.h:54