1 | /**
|
---|
2 | *
|
---|
3 | * Distributed under the UTC Heudiascy Pacpus License, Version 1.0.
|
---|
4 | * Copyright (c) UTC Heudiasyc 2010 - 2013. All rights reserved.
|
---|
5 | *
|
---|
6 | * See the LICENSE file for more information or a copy at:
|
---|
7 | * http://www.hds.utc.fr/~kurdejma/LICENSE_1_0.txt
|
---|
8 | *
|
---|
9 | */
|
---|
10 |
|
---|
11 | #ifndef DEF_HDFILE_HEADER_T_H
|
---|
12 | #define DEF_HDFILE_HEADER_T_H
|
---|
13 |
|
---|
14 | #include <Pacpus/kernel/cstdint.h>
|
---|
15 | #include <Pacpus/kernel/road_time.h>
|
---|
16 |
|
---|
17 | #define HEADER_SIGNATURE_LENGTH 4
|
---|
18 | #define VERSION_NUMBER 2
|
---|
19 |
|
---|
20 | #pragma pack(push,4)
|
---|
21 | /// @todo Documentation
|
---|
22 | struct hdfile_header_t
|
---|
23 | {
|
---|
24 | /// @todo Documentation
|
---|
25 | typedef int8_t SignatureT;
|
---|
26 | /// @todo Documentation
|
---|
27 | typedef int32_t DataTypeT;
|
---|
28 | /// @todo Documentation
|
---|
29 | typedef int32_t VersionT;
|
---|
30 | /// @todo Documentation
|
---|
31 | typedef int32_t DataSizeT;
|
---|
32 | /// @todo Documentation
|
---|
33 | typedef int32_t DataOffsetT;
|
---|
34 | /// @todo Documentation
|
---|
35 | /// @todo FIXME: file size should be 64-bit long to support large (>2GB) files
|
---|
36 | typedef int32_t FileSizeT;
|
---|
37 | /// @todo Documentation
|
---|
38 | typedef int32_t RecordCountT;
|
---|
39 |
|
---|
40 | /// @todo Documentation
|
---|
41 | static const DataSizeT kVariableRecordSize = -1;
|
---|
42 |
|
---|
43 | /// @todo Documentation
|
---|
44 | SignatureT Signature[HEADER_SIGNATURE_LENGTH];
|
---|
45 | /// Record data type
|
---|
46 | /// Should default to @link FILE_DBT_UNKNOWN
|
---|
47 | /// @see DbiteFileTypes.h for more
|
---|
48 | DataTypeT Type;
|
---|
49 | /// File format version
|
---|
50 | VersionT VersionNumber;
|
---|
51 | /// Offset indicating the start of the data [bytes]
|
---|
52 | DataOffsetT DataOffset;
|
---|
53 | /// Current size of the data, without header [bytes]
|
---|
54 | DataSizeT DataSize;
|
---|
55 | /// Current size of the file [bytes]
|
---|
56 | FileSizeT FileSize;
|
---|
57 | /// @todo Documentation
|
---|
58 | road_time_t TimeMin;
|
---|
59 | /// @todo Documentation
|
---|
60 | road_time_t TimeMax;
|
---|
61 | /// Number of records already in the file
|
---|
62 | RecordCountT NbRecords;
|
---|
63 | };
|
---|
64 | #pragma pack(pop)
|
---|
65 |
|
---|
66 | #endif // DEF_HDFILE_HEADER_T_H
|
---|