Vector BLF
FileStatistics.h
1 /*
2  * Copyright (C) 2013 Tobias Lorenz.
3  * Contact: tobias.lorenz@gmx.net
4  *
5  * This file is part of Tobias Lorenz's Toolkit.
6  *
7  * Commercial License Usage
8  * Licensees holding valid commercial licenses may use this file in
9  * accordance with the commercial license agreement provided with the
10  * Software or, alternatively, in accordance with the terms contained in
11  * a written agreement between you and Tobias Lorenz.
12  *
13  * GNU General Public License 3.0 Usage
14  * Alternatively, this file may be used under the terms of the GNU
15  * General Public License version 3.0 as published by the Free Software
16  * Foundation and appearing in the file LICENSE.GPL included in the
17  * packaging of this file. Please review the following information to
18  * ensure the GNU General Public License version 3.0 requirements will be
19  * met: http://www.gnu.org/copyleft/gpl.html.
20  */
21 
22 #pragma once
23 
24 #include <Vector/BLF/platform.h>
25 
26 #include <array>
27 
28 #include <Vector/BLF/AbstractFile.h>
29 #include <Vector/BLF/VectorTypes.h>
30 
31 #include <Vector/BLF/vector_blf_export.h>
32 
33 namespace Vector {
34 namespace BLF {
35 
39 const DWORD FileSignature = 0x47474F4C; /* LOGG */
40 
44 enum ApplicationId : BYTE {
46  Unknown = 0,
47 
49  Canalyzer = 1,
50 
52  Canoe = 2,
53 
55  Canstress = 3,
56 
58  Canlog = 4,
59 
61  Canape = 5,
62 
64  Cancasexllog = 6,
65 
67  Vlconfig = 7,
68 
70  Porschelogger = 200,
71 
73  Caeteclogger = 201,
74 };
75 
79 struct VECTOR_BLF_EXPORT FileStatistics final {
80  FileStatistics() = default;
81  virtual ~FileStatistics() noexcept = default;
82  FileStatistics(const FileStatistics &) = default;
83  FileStatistics & operator=(const FileStatistics &) = default;
84  FileStatistics(FileStatistics &&) = default;
85  FileStatistics & operator=(FileStatistics &&) = default;
86 
92  virtual void read(AbstractFile & is);
93 
99  virtual void write(AbstractFile & os);
100 
106  DWORD calculateStatisticsSize() const;
107 
109  DWORD signature {FileSignature};
110 
112  DWORD statisticsSize {calculateStatisticsSize()};
113 
115  BYTE applicationId {};
116 
118  BYTE applicationMajor {};
119 
121  BYTE applicationMinor {};
122 
124  BYTE applicationBuild {};
125 
127  BYTE apiMajor {4};
128 
130  BYTE apiMinor {7};
131 
133  BYTE apiBuild {1};
134 
136  BYTE apiPatch {0};
137 
139  ULONGLONG fileSize {};
140 
142  ULONGLONG uncompressedFileSize {};
143 
145  DWORD objectCount {};
146 
148  DWORD objectsRead {};
149 
151  SYSTEMTIME measurementStartTime {};
152 
154  SYSTEMTIME lastObjectTime {};
155 
157  ULONGLONG fileSizeWithoutUnknown115 {};
158 
160  std::array<DWORD, 16> reservedFileStatistics {};
161 };
162 
163 }
164 }
Definition: AbstractFile.h:36
Definition: FileStatistics.h:79
Definition: VectorTypes.h:66