QuaZip quazip-1-6
quazip_textcodec.h
1#ifndef QUAZIPTEXTCODEC_H
2#define QUAZIPTEXTCODEC_H
3
4/*
5Copyright (C) 2024 Gregory EUSTACHE, cen1
6
7QuazipTextCodec is a wrapper/abstraction around QTextCodec
8
9This file is part of QuaZip.
10
11QuaZip is free software: you can redistribute it and/or modify
12it under the terms of the GNU Lesser General Public License as published by
13the Free Software Foundation, either version 2.1 of the License, or
14(at your option) any later version.
15
16QuaZip is distributed in the hope that it will be useful,
17but WITHOUT ANY WARRANTY; without even the implied warranty of
18MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19GNU Lesser General Public License for more details.
20
21You should have received a copy of the GNU Lesser General Public License
22along with QuaZip. If not, see <http://www.gnu.org/licenses/>.
23
24See COPYING file for the full LGPL text.
25*/
26
27#include <QByteArray>
28#include "quazip_global.h"
29
30#ifdef QUAZIP_CAN_USE_QTEXTCODEC
31#include <QTextCodec>
32typedef QTextCodec QuazipTextCodec;
33#else
34#include <QStringConverter>
35#endif
36
37#ifndef QUAZIP_CAN_USE_QTEXTCODEC
38class QUAZIP_EXPORT QuazipTextCodec
39{
40 public:
41 explicit QuazipTextCodec();
42
43 QByteArray fromUnicode(const QString &str) const;
44 QString toUnicode(const QByteArray &a) const;
45
46 static QuazipTextCodec *codecForName(const QByteArray &name);
47 static QuazipTextCodec *codecForLocale();
48 protected:
49 static void setup();
50 QStringConverter::Encoding mEncoding;
51};
52#endif // QUAZIP_CAN_USE_QTEXTCODEC
53
54#endif // QUAZIPTEXTCODEC_H
Definition quazip_textcodec.h:39