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
16 namespace Vector {
17 namespace BLF {
18
22 const uint32_t FileSignature = 0x47474F4C; /* LOGG */
23
27 enum 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
194
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::reservedFileStatistics
std::array< uint32_t, 16 > reservedFileStatistics
Definition FileStatistics.h:206
Vector::BLF::FileStatistics::read
virtual void read(AbstractFile &is)
Definition FileStatistics.cpp:15
Vector::BLF::FileStatistics::measurementStartTime
SYSTEMTIME measurementStartTime
Definition FileStatistics.h:184
Vector::BLF::FileStatistics::restorePointsOffset
uint64_t restorePointsOffset
Definition FileStatistics.h:203
Vector::BLF::FileStatistics::write
virtual void write(AbstractFile &os)
Definition FileStatistics.cpp:35
Vector::BLF::FileStatistics::statisticsSize
uint32_t statisticsSize
Definition FileStatistics.h:137
Vector::BLF::FileStatistics::uncompressedFileSize
uint64_t uncompressedFileSize
Definition FileStatistics.h:171
Vector::BLF::FileStatistics::fileSize
uint64_t fileSize
Definition FileStatistics.h:168
Vector::BLF::FileStatistics::lastObjectTime
SYSTEMTIME lastObjectTime
Definition FileStatistics.h:187
Vector::BLF::FileStatistics::signature
uint32_t signature
Definition FileStatistics.h:134
Vector::BLF::FileStatistics::apiNumber
uint32_t apiNumber
Definition FileStatistics.h:146
Vector::BLF::FileStatistics::objectCount
uint32_t objectCount
Definition FileStatistics.h:174
Vector::BLF::FileStatistics::compressionLevel
uint8_t compressionLevel
Definition FileStatistics.h:159
Vector::BLF::FileStatistics::applicationBuild
uint32_t applicationBuild
Definition FileStatistics.h:181
Vector::BLF::FileStatistics::applicationMajor
uint8_t applicationMajor
Definition FileStatistics.h:162
Vector::BLF::FileStatistics::calculateStatisticsSize
uint32_t calculateStatisticsSize() const
Definition FileStatistics.cpp:53
Vector::BLF::FileStatistics::applicationId
uint8_t applicationId
Definition FileStatistics.h:149
Vector::BLF::FileStatistics::applicationMinor
uint8_t applicationMinor
Definition FileStatistics.h:165
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