A compiled DataArray file (.txt.bin, .ui.bin), the form DataArray::ReadFile loads.
More...
#include <datafile.h>
|
| std::vector< std::uint8_t > | serialize () const |
| | Write the file in compiled form, encrypted with the seed when there is one.
|
| std::int32_t | fileIndex (const std::string &name) |
| | Find the index of a source file name, adding the name when missing.
|
|
| static std::expected< DataFile, Error > | parse (std::span< const std::uint8_t > data) |
| | Parse a compiled file, plain or encrypted.
|
|
| static constexpr std::uint8_t | kVersion = 2 |
| | The version of the compiled format.
|
A compiled DataArray file (.txt.bin, .ui.bin), the form DataArray::ReadFile loads.
The file is a version byte, the table of source file names, and the root array. The European release and the P.O.D. demo encrypt everything after a leading 32-bit seed with the lagged Fibonacci generator of the game's Rand class.
◆ parse()
| std::expected< DataFile, Error > Tools::Ark::DataFile::parse |
( |
std::span< const std::uint8_t > | data | ) |
|
|
static |
Parse a compiled file, plain or encrypted.
- Parameters
-
- Returns
- The parsed file, or an ErrorCode::InvalidInput error when neither form parses to the end of the data.
◆ serialize()
| std::vector< std::uint8_t > Tools::Ark::DataFile::serialize |
( |
| ) |
const |
|
nodiscard |
Write the file in compiled form, encrypted with the seed when there is one.
- Returns
- The file.
◆ fileIndex()
| std::int32_t Tools::Ark::DataFile::fileIndex |
( |
const std::string & | name | ) |
|
Find the index of a source file name, adding the name when missing.
- Parameters
-
| name | The source file name. |
- Returns
- The index in files.
◆ kVersion
| std::uint8_t Tools::Ark::DataFile::kVersion = 2 |
|
staticconstexpr |
The version of the compiled format.
◆ seed
| std::optional<std::uint32_t> Tools::Ark::DataFile::seed |
The encryption seed, when the file is encrypted.
◆ files
| std::vector<std::string> Tools::Ark::DataFile::files |
The source file names that arrays refer to.
◆ root
The documentation for this class was generated from the following file: