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: 2015 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_JISX0201CHARCODEC_HPP
0010 #define OKTETA_JISX0201CHARCODEC_HPP
0011 
0012 // lib
0013 #include <charcodec.hpp>
0014 
0015 namespace Okteta {
0016 
0017 //
0018 class JISX0201CharCodec : public CharCodec
0019 {
0020 public:
0021     JISX0201CharCodec(const JISX0201CharCodec&) = delete;
0022     JISX0201CharCodec& operator=(const JISX0201CharCodec&) = delete;
0023 
0024 protected:
0025     JISX0201CharCodec();
0026 
0027 public: // CharCodec API
0028     Character decode(Byte byte) const override;
0029     bool encode(Byte* byte, const QChar& _char) const override;
0030     bool canEncode(const QChar& _char) const override;
0031     const QString& name() const override;
0032 
0033 public:
0034     static JISX0201CharCodec* create();
0035     static const QString& codecName();
0036 };
0037 
0038 inline JISX0201CharCodec::JISX0201CharCodec() = default;
0039 
0040 inline JISX0201CharCodec* JISX0201CharCodec::create() { return new JISX0201CharCodec(); }
0041 
0042 }
0043 
0044 #endif