File indexing completed on 2024-05-05 17:57:59
0001 /* 0002 This file is part of the Okteta Core library, made within the KDE community. 0003 0004 SPDX-FileCopyrightText: 2004, 2011 Friedrich W. H. Kossebau <kossebau@kde.org> 0005 0006 SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL 0007 */ 0008 0009 #ifndef OKTETA_OCTALBYTECODEC_HPP 0010 #define OKTETA_OCTALBYTECODEC_HPP 0011 0012 // lib 0013 #include <valuecodec.hpp> 0014 0015 namespace Okteta { 0016 0017 class OctalByteCodec : public ValueCodec 0018 { 0019 public: 0020 OctalByteCodec() = default; 0021 OctalByteCodec(const OctalByteCodec&) = delete; 0022 OctalByteCodec& operator=(const OctalByteCodec&) = delete; 0023 0024 public: // ValueCodec API 0025 unsigned int encodingWidth() const override; 0026 Byte digitsFilledLimit() const override; 0027 0028 void encode(QString* digits, unsigned int pos, Byte byte) const override; 0029 void encodeShort(QString* digits, unsigned int pos, Byte byte) const override; 0030 bool appendDigit(Byte* byte, unsigned char digit) const override; 0031 void removeLastDigit(Byte* byte) const override; 0032 bool isValidDigit(unsigned char digit) const override; 0033 bool turnToValue(unsigned char* digit) const override; 0034 }; 0035 0036 } 0037 0038 #endif