1 /*
2     This file is part of the Okteta Kasten module, made within the KDE community.
3 
4     SPDX-FileCopyrightText: 2010 Friedrich W. H. Kossebau <kossebau@kde.org>
5 
6     SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
7 */
8 
9 #ifndef KASTEN_BYTEARRAYBASE85STREAMENCODER_HPP
10 #define KASTEN_BYTEARRAYBASE85STREAMENCODER_HPP
11 
12 // lib
13 #include "abstractbytearraystreamencoder.hpp"
14 // Okteta core
15 #include <Okteta/OktetaCore>
16 // Qt
17 #include <QString>
18 
19 namespace Kasten {
20 
21 class ByteArrayBase85StreamEncoder : public AbstractByteArrayStreamEncoder
22 {
23     Q_OBJECT
24 
25 public:
26     static constexpr int inputGroupLength = 4;
27 
28     static constexpr int outputLineLength = 72;
29     static constexpr int maxOutputBytesPerLine = outputLineLength;
30 
31     enum class InputByteIndex
32     {
33         First = 0,
34         Second,
35         Third,
36         Fourth
37     };
38 
39 public:
40     ByteArrayBase85StreamEncoder();
41     ~ByteArrayBase85StreamEncoder() override;
42 
43 protected: // AbstractByteArrayStreamEncoder API
44     bool encodeDataToStream(QIODevice* device,
45                             const ByteArrayView* byteArrayView,
46                             const Okteta::AbstractByteArrayModel* byteArrayModel,
47                             const Okteta::AddressRange& range) override;
48 };
49 
50 }
51 
52 #endif
53