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#include <cstdint>
11
12#include <Vector/BLF/AbstractFile.h>
13
14#include <Vector/BLF/vector_blf_export.h>
15
16namespace Vector {
17namespace BLF {
18
22const uint32_t FileSignature = 0x47474F4C; /* LOGG */
23
27enum ApplicationId : uint8_t {
29 Unknown = 0,
30
32 Canalyzer = 1,
33
35 Canoe = 2,
36
38 Canstress = 3,
39
41 Canlog = 4,
42
44 Canape = 5,
45
47 Cancasexllog = 6,
48
50 Vlconfig = 7,
51
53 Porschelogger = 200,
54
56 Caeteclogger = 201,
57
59 Vectornetworksimulator = 202,
60
62 Ipetroniklogger=203,
63
65 RtPk=204,
66
68 Piketec=205,
69
71 Sparks=206
72};
73
75 struct SYSTEMTIME {
77 uint16_t year;
78
80 uint16_t month;
81
83 uint16_t dayOfWeek;
84
86 uint16_t day;
87
89 uint16_t hour;
90
92 uint16_t minute;
93
95 uint16_t second;
96
98 uint16_t milliseconds;
99};
100
104 struct VECTOR_BLF_EXPORT FileStatistics final {
105 FileStatistics() = default;
106 virtual ~FileStatistics() noexcept = default;
107 FileStatistics(const FileStatistics &) = default;
108 FileStatistics & operator=(const FileStatistics &) = default;
109 FileStatistics(FileStatistics &&) = default;
110 FileStatistics & operator=(FileStatistics &&) = default;
111
117 virtual void read(AbstractFile & is);
118
124 virtual void write(AbstractFile & os);
125
131 uint32_t calculateStatisticsSize() const;
132
134 uint32_t signature {FileSignature};
135
137 uint32_t statisticsSize {calculateStatisticsSize()};
138
146 uint32_t apiNumber { 4080200 }; // 4.8.2.0
147
149 uint8_t applicationId {};
150
159 uint8_t compressionLevel {1};
160
162 uint8_t applicationMajor {};
163
165 uint8_t applicationMinor {};
166
168 uint64_t fileSize {};
169
171 uint64_t uncompressedFileSize {};
172
174 uint32_t objectCount {};
175
181 uint32_t applicationBuild {};
182
184 SYSTEMTIME measurementStartTime {};
185
187 SYSTEMTIME lastObjectTime {};
188
203 uint64_t restorePointsOffset {};
204
206 std::array<uint32_t, 16> reservedFileStatistics {};
207};
208
209}
210}
Vector::BLF::AbstractFile
Definition AbstractFile.h:19
Vector::BLF::FileStatistics
Definition FileStatistics.h:104
Vector::BLF::SYSTEMTIME
Definition FileStatistics.h:75
Vector::BLF::SYSTEMTIME::hour
uint16_t hour
Definition FileStatistics.h:89
Vector::BLF::SYSTEMTIME::month
uint16_t month
Definition FileStatistics.h:80
Vector::BLF::SYSTEMTIME::second
uint16_t second
Definition FileStatistics.h:95
Vector::BLF::SYSTEMTIME::year
uint16_t year
Definition FileStatistics.h:77
Vector::BLF::SYSTEMTIME::day
uint16_t day
Definition FileStatistics.h:86
Vector::BLF::SYSTEMTIME::dayOfWeek
uint16_t dayOfWeek
Definition FileStatistics.h:83
Vector::BLF::SYSTEMTIME::milliseconds
uint16_t milliseconds
Definition FileStatistics.h:98
Vector::BLF::SYSTEMTIME::minute
uint16_t minute
Definition FileStatistics.h:92