Vector BLF: FileStatistics.h Source File

Vector BLF

Loading...
Searching...
No Matches
FileStatistics.h
1// SPDX-FileCopyrightText: 2013-2021 Tobias Lorenz <tobias.lorenz@gmx.net>
2//
3// SPDX-License-Identifier: GPL-3.0-or-later
4
5#pragma once
6
7#include <Vector/BLF/platform.h>
8
9#include <array>
10
11#include <Vector/BLF/AbstractFile.h>
12
13#include <Vector/BLF/vector_blf_export.h>
14
15namespace Vector {
16namespace BLF {
17
21const uint32_t FileSignature = 0x47474F4C; /* LOGG */
22
26enum ApplicationId : uint8_t {
28 Unknown = 0,
29
31 Canalyzer = 1,
32
34 Canoe = 2,
35
37 Canstress = 3,
38
40 Canlog = 4,
41
43 Canape = 5,
44
46 Cancasexllog = 6,
47
49 Vlconfig = 7,
50
52 Porschelogger = 200,
53
55 Caeteclogger = 201,
56
58 Vectornetworksimulator = 202,
59
61 Ipetroniklogger=203,
62
64 RtPk=204,
65
67 Piketec=205,
68
70 Sparks=206
71};
72
74 struct SYSTEMTIME {
76 uint16_t year;
77
79 uint16_t month;
80
82 uint16_t dayOfWeek;
83
85 uint16_t day;
86
88 uint16_t hour;
89
91 uint16_t minute;
92
94 uint16_t second;
95
97 uint16_t milliseconds;
98};
99
103 struct VECTOR_BLF_EXPORT FileStatistics final {
104 FileStatistics() = default;
105 virtual ~FileStatistics() noexcept = default;
106 FileStatistics(const FileStatistics &) = default;
107 FileStatistics & operator=(const FileStatistics &) = default;
108 FileStatistics(FileStatistics &&) = default;
109 FileStatistics & operator=(FileStatistics &&) = default;
110
116 virtual void read(AbstractFile & is);
117
123 virtual void write(AbstractFile & os);
124
130 uint32_t calculateStatisticsSize() const;
131
133 uint32_t signature {FileSignature};
134
136 uint32_t statisticsSize {calculateStatisticsSize()};
137
145 uint32_t apiNumber { 4080200 }; // 4.8.2.0
146
148 uint8_t applicationId {};
149
158 uint8_t compressionLevel {1};
159
161 uint8_t applicationMajor {};
162
164 uint8_t applicationMinor {};
165
167 uint64_t fileSize {};
168
170 uint64_t uncompressedFileSize {};
171
173 uint32_t objectCount {};
174
180 uint32_t applicationBuild {};
181
183 SYSTEMTIME measurementStartTime {};
184
186 SYSTEMTIME lastObjectTime {};
187
202 uint64_t restorePointsOffset {};
203
205 std::array<uint32_t, 16> reservedFileStatistics {};
206};
207
208}
209}
Vector::BLF::AbstractFile
Definition: AbstractFile.h:19
Vector::BLF::FileStatistics
Definition: FileStatistics.h:103
Vector::BLF::SYSTEMTIME
Definition: FileStatistics.h:74
Vector::BLF::SYSTEMTIME::hour
uint16_t hour
Definition: FileStatistics.h:88
Vector::BLF::SYSTEMTIME::month
uint16_t month
Definition: FileStatistics.h:79
Vector::BLF::SYSTEMTIME::second
uint16_t second
Definition: FileStatistics.h:94
Vector::BLF::SYSTEMTIME::year
uint16_t year
Definition: FileStatistics.h:76
Vector::BLF::SYSTEMTIME::day
uint16_t day
Definition: FileStatistics.h:85
Vector::BLF::SYSTEMTIME::dayOfWeek
uint16_t dayOfWeek
Definition: FileStatistics.h:82
Vector::BLF::SYSTEMTIME::milliseconds
uint16_t milliseconds
Definition: FileStatistics.h:97
Vector::BLF::SYSTEMTIME::minute
uint16_t minute
Definition: FileStatistics.h:91