Pack reader instance handle. More...
#include <reader.hpp>
Public Member Functions | |
| Reader ()=default | |
| Creates a new file pack reader without stream. | |
| Reader (const Reader &)=delete | |
| Reader (Reader &&r) noexcept | |
| Reader & | operator= (Reader &)=delete |
| Reader & | operator= (Reader &&r) noexcept |
| Reader (const filesystem::path &filePath, uint32_t dataVersion=0, bool isResourcesDirectory=true, uint32_t threadCount=thread::hardware_concurrency()) | |
| Creates a new file pack reader instance. | |
| ~Reader () | |
| Destroys pack reader stream. | |
| void | open (const filesystem::path &filePath, uint32_t dataVersion=0, bool isResourcesDirectory=true, uint32_t threadCount=thread::hardware_concurrency()) |
| Opens a new Pack reader stream. | |
| void | close () noexcept |
| Closes the current Pack reader stream. | |
| bool | isOpen () const noexcept |
| Returns true if Pack reader stream is open. | |
| uint64_t | getItemCount () const noexcept |
| Returns total Pack item count. (MT-Safe) | |
| bool | getItemIndex (const filesystem::path &path, uint64_t &index) const noexcept |
| Returns Pack item index if it is found. (MT-Safe) | |
| uint64_t | getItemIndex (const filesystem::path &path) const |
| Returns Pack item index. (MT-Safe) | |
| uint32_t | getItemDataSize (uint64_t index) const noexcept |
| Returns Pack item uncompressed data size in bytes. (MT-Safe) | |
| uint32_t | getItemZipSize (uint64_t index) const noexcept |
| Returns Pack item compressed data size in bytes. (MT-Safe) | |
| void | readItemData (uint64_t itemIndex, uint8_t *buffer, uint32_t threadIndex=0) const |
| Reads Pack item binary data. (MT-Safe) | |
| void | readItemData (uint64_t itemIndex, vector< uint8_t > &buffer, uint32_t threadIndex=0) const |
| Reads Pack item binary data. (MT-Safe) | |
| void | readItemData (const filesystem::path &path, vector< uint8_t > &buffer, uint32_t threadIndex=0) const |
| Reads Pack item binary data. (MT-Safe) | |
| uint64_t | getItemFileOffset (uint64_t index) const noexcept |
| Returns Pack item data offset in the archive file. (MT-Safe) | |
| bool | isItemReference (uint64_t index) const noexcept |
| Returns true if pack item is a reference to a duplicate item. (MT-Safe) | |
| string_view | getItemPath (uint64_t index) const noexcept |
| Returns Pack item path string. (MT-Safe) | |
| void **const | getZstdContexts () const |
| Returns Pack ZSTD context array. (MT-Safe) | |
Static Public Member Functions | |
| static void | unpack (const filesystem::path &filePath, bool printProgress=false) |
| Unpacks files from the pack. (MT-Safe) | |
Pack reader instance handle.
See the reader.h
|
inline |
Creates a new file pack reader instance.
See the createFilePackReader().
| [in] | filePath | target Pack file path string |
| dataVersion | target packed file data version (0 = ignore data version) | |
| isResourcesDirectory | read from the resources directory (Android/iOS/macOS only) | |
| threadCount | max concurrent read thread count |
| Error | with a PackResult string on failure. |
|
inline |
Destroys pack reader stream.
See the destroyPackReader().
|
inline |
Opens a new Pack reader stream.
See the createFilePackReader().
| [in] | filePath | target Pack file path string |
| dataVersion | target packed file data version (0 = ignore data version) | |
| isResourcesDirectory | read from the resources directory (Android/iOS/macOS only) | |
| threadCount | max concurrent read thread count |
| Error | with a PackResult string on failure. |
|
inlinenoexcept |
Closes the current Pack reader stream.
See the destroyPackReader().
|
inlinenoexcept |
Returns true if Pack reader stream is open.
See the createFilePackReader().
|
inlinenoexcept |
Returns total Pack item count. (MT-Safe)
See the getPackItemCount().
|
inlinenoexcept |
Returns Pack item index if it is found. (MT-Safe)
See the getPackItemIndex().
| [in] | path | item path string used to pack the file |
| [out] | index | reference to the uint64_t item index |
|
inline |
Returns Pack item index. (MT-Safe)
See the getPackItemIndex().
| [in] | path | item path string used to pack the file |
| Error | if item does not exist. |
Returns Pack item uncompressed data size in bytes. (MT-Safe)
See the getPackItemDataSize().
| index | uint64_t item index |
Returns Pack item compressed data size in bytes. (MT-Safe)
See the getPackItemZipSize().
| index | uint64_t item index |
Reads Pack item binary data. (MT-Safe)
See the readPackItemData().
| itemIndex | uint64_t item index | |
| [out] | buffer | pointer to the buffer where to read item data |
| threadIndex | current thread index or 0 |
| Error | with a PackResult string on failure. |
|
inline |
Reads Pack item binary data. (MT-Safe)
See the readPackItemData().
| itemIndex | uint64_t item index | |
| [out] | buffer | reference to the buffer where to read item data |
| threadIndex | current thread index or 0 |
| Error | with a PackResult string on failure. |
|
inline |
Reads Pack item binary data. (MT-Safe)
See the readPackItemData().
| [in] | path | item path string used to pack the file |
| [out] | buffer | reference to the buffer where to read item data |
| threadIndex | current thread index or 0 |
| Error | with a PackResult string on failure. |
Returns Pack item data offset in the archive file. (MT-Safe)
See the getPackItemFileOffset().
| index | uint64_t item index |
|
inlinenoexcept |
Returns true if pack item is a reference to a duplicate item. (MT-Safe)
See the isPackItemReference().
| index | uint64_t item index |
|
inlinenoexcept |
Returns Pack item path string. (MT-Safe)
See the getPackItemPath().
| index | uint64_t item index |
|
inline |
Returns Pack ZSTD context array. (MT-Safe)
See the getPackZstdContexts().
|
inlinestatic |
Unpacks files from the pack. (MT-Safe)
See the unpackFiles().
| [in] | filePath | target Pack file path string |
| printProgress | output unpacking progress to the stdout |
| Error | with a PackResult string on failure. |