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#include "quazip_config.h"
30
31#ifdef QUAZIP_CAN_USE_QTEXTCODEC
32#include <QTextCodec>
33typedef QTextCodec QuazipTextCodec;
34#else
35#include <QStringConverter>
36#endif
37
38#ifndef QUAZIP_CAN_USE_QTEXTCODEC
39class QUAZIP_EXPORT QuazipTextCodec
40{
41 public:
42 explicit QuazipTextCodec();
43
44 QByteArray fromUnicode(const QString &str) const;
45 QString toUnicode(const QByteArray &a) const;
46
47 static QuazipTextCodec *codecForName(const QByteArray &name);
48 static QuazipTextCodec *codecForLocale();
49 protected:
50 static void setup();
51 QStringConverter::Encoding mEncoding;
52};
53#endif // QUAZIP_CAN_USE_QTEXTCODEC
54
55#endif // QUAZIPTEXTCODEC_H
Definition quazip_textcodec.h:40