Every file starts with this header, which may grow but not shrink!
More...
#include <FileFormat.h>
|
|
uint32_t | magicHeader1 {} |
| | magic value #1
|
| |
|
uint32_t | magicHeader2 {} |
| | magic value #2
|
| |
|
uint64_t | creationId {} |
| | A timestamp, hopefully unique, to match files (future).
|
| |
|
uint32_t | fileHeaderSize {} |
| | This header size, in bytes.
|
| |
|
uint32_t | recordHeaderSize {} |
| | Record headers' size, in bytes (same for all).
|
| |
|
int64_t | indexRecordOffset {} |
| | Index record offset in the whole file.
|
| |
|
int64_t | descriptionRecordOffset {} |
| | Description record offset in the whole file.
|
| |
| int64_t | firstUserRecordOffset {} |
| |
|
uint64_t | future2 {} |
| | For future use.
|
| |
|
uint64_t | future3 {} |
| | For future use.
|
| |
|
uint64_t | future4 {} |
| | For future use.
|
| |
|
uint32_t | magicHeader3 {} |
| | magic value #3
|
| |
|
uint32_t | fileFormatVersion {} |
| | file format version.
|
| |
Every file starts with this header, which may grow but not shrink!
◆ enableFrontIndexRecordSupport()
| void vrs::FileFormat::FileHeader::enableFrontIndexRecordSupport |
( |
| ) |
|
By default, the index record is written at the end of the file (original behavior), and the first user record is just after the description record. You can reserve space for the index record between the description record and the first user record, so that it is possible the read the file forward only, for streaming. But if you do that, the VRS file can only be read by a newer version of VRS, so you must bump the file version number by calling this method.
◆ getEndOfUserRecordsOffset()
| int64_t vrs::FileFormat::FileHeader::getEndOfUserRecordsOffset |
( |
int64_t |
fileSize | ) |
const |
Get a best guess as to where user records end. If the file has no index, this value may be inaccurate, but a sensible estimation will be returned (probably the end of the file). Only call this methods for file headers read from an actual VRS file.
- Parameters
-
| fileSize | the size of the VRS file, value returned if no better estimate can be made, or when the file's index is at the start of the file (in which case it is the right answer). |
- Returns
- The index of the first byte after the last user record.
◆ isFormatSupported()
| bool vrs::FileFormat::FileHeader::isFormatSupported |
( |
| ) |
const |
Check if the file format is supported. Might fail if the file was written by a recent version of VRS that changed the file format.
◆ looksLikeAVRSFile()
| bool vrs::FileFormat::FileHeader::looksLikeAVRSFile |
( |
| ) |
const |
Check the sanity of the file header.
- Returns
- True if the header looks valid for a VRS file, false otherwise.
◆ looksLikeOurFiles()
| bool vrs::FileFormat::FileHeader::looksLikeOurFiles |
( |
uint32_t |
magic1, |
|
|
uint32_t |
magic2, |
|
|
uint32_t |
magic3 |
|
) |
| const |
Check the sanity of the file header.
- Returns
- True if the header looks valid a header we might have created, false otherwise.
◆ setCreationIdOffset()
| void vrs::FileFormat::FileHeader::setCreationIdOffset |
( |
uint64_t |
offset | ) |
|
|
static |
For privacy with regard to creation time, allow for the injection of a (random) creation ID offset.
- Parameters
-
| offset | Offset in nanoseconds, added to the current wall-clock time. Defaults to zero. |
◆ firstUserRecordOffset
| int64_t vrs::FileFormat::FileHeader::firstUserRecordOffset {} |
Offset of the first user record in the file. If 0, the first record is just after the description record (original behavior)
The documentation for this struct was generated from the following files: