Vector BLF

Loading...
Searching...
No Matches
LogContainer.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 <vector>
10
11#include <Vector/BLF/AbstractFile.h>
12#include <Vector/BLF/ObjectHeaderBase.h>
13
14#include <Vector/BLF/vector_blf_export.h>
15
16 namespace Vector {
17 namespace BLF {
18
22 struct VECTOR_BLF_EXPORT LogContainer final : ObjectHeaderBase {
23 LogContainer();
24
25 void read(AbstractFile & is) override;
26 void write(AbstractFile & os) override;
27 uint32_t calculateObjectSize() const override;
28
35 uint16_t compressionMethod {};
36
40 uint16_t reservedLogContainer1 {};
41
45 uint32_t reservedLogContainer2 {};
46
50 uint32_t uncompressedFileSize {};
51
53 uint32_t reservedLogContainer3 {}; // @todo what is this? 0x0215, 0x9a, 0, 0x0c...
54
56 std::vector<uint8_t> compressedFile {};
57
58 /* following data is calculated */
59
61 std::vector<uint8_t> uncompressedFile {};
62
64 uint32_t compressedFileSize {};
65
67 std::streampos filePosition {};
68
76 uint16_t internalHeaderSize() const;
77
81 virtual void uncompress();
82
89 virtual void compress(const uint16_t compressionMethod, const int compressionLevel);
90};
91
92}
93}
Vector::BLF::AbstractFile
Definition AbstractFile.h:19
Vector::BLF::LogContainer::compressedFileSize
uint32_t compressedFileSize
Definition LogContainer.h:64
Vector::BLF::LogContainer::calculateObjectSize
uint32_t calculateObjectSize() const override
Definition LogContainer.cpp:49
Vector::BLF::LogContainer::uncompressedFile
std::vector< uint8_t > uncompressedFile
Definition LogContainer.h:61
Vector::BLF::LogContainer::read
void read(AbstractFile &is) override
Definition LogContainer.cpp:18
Vector::BLF::LogContainer::write
void write(AbstractFile &os) override
Definition LogContainer.cpp:33
Vector::BLF::LogContainer::compressionMethod
uint16_t compressionMethod
Definition LogContainer.h:35
Vector::BLF::LogContainer::reservedLogContainer3
uint32_t reservedLogContainer3
Definition LogContainer.h:53
Vector::BLF::LogContainer::uncompressedFileSize
uint32_t uncompressedFileSize
Definition LogContainer.h:50
Vector::BLF::LogContainer::reservedLogContainer1
uint16_t reservedLogContainer1
Definition LogContainer.h:40
Vector::BLF::LogContainer::compressedFile
std::vector< uint8_t > compressedFile
Definition LogContainer.h:56
Vector::BLF::LogContainer::filePosition
std::streampos filePosition
Definition LogContainer.h:67
Vector::BLF::LogContainer::reservedLogContainer2
uint32_t reservedLogContainer2
Definition LogContainer.h:45