summaryrefslogtreecommitdiffstats
path: root/src/corelib/codecs/qtextcodec_p.h
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2020-04-25 11:11:23 +0200
committerLars Knoll <lars.knoll@qt.io>2020-05-14 07:48:20 +0200
commit1cab047d088a397b00f5adc8febeac467fc4831d (patch)
treeb278b9b2e0a96e2ffcaefc44aabf6273271f57ef /src/corelib/codecs/qtextcodec_p.h
parent940665eff5570323f4c00b61a4fc839b14cd823e (diff)
Remove QTextCodec dependency from QCoreGobalData
As we want to move text codecs out of Qt Core, disentangle the dependency, but moving the global codec data into qtextcodec.*. Change-Id: Id7498423c7c4f9f42fd00c450947305d2af8c4be Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Diffstat (limited to 'src/corelib/codecs/qtextcodec_p.h')
-rw-r--r--src/corelib/codecs/qtextcodec_p.h20
1 files changed, 18 insertions, 2 deletions
diff --git a/src/corelib/codecs/qtextcodec_p.h b/src/corelib/codecs/qtextcodec_p.h
index ef5758619d..d4b22c4754 100644
--- a/src/corelib/codecs/qtextcodec_p.h
+++ b/src/corelib/codecs/qtextcodec_p.h
@@ -53,19 +53,35 @@
#include <QtCore/private/qglobal_p.h>
#include <string.h>
+#include <qhash.h>
+#if QT_CONFIG(textcodec)
+#include "qtextcodec.h"
+#endif
QT_BEGIN_NAMESPACE
#if QT_CONFIG(textcodec)
-#include "qtextcodec.h"
-
#if defined(Q_OS_MAC) || defined(Q_OS_ANDROID) || defined(Q_OS_QNX) || defined(Q_OS_WASM)
#define QT_LOCALE_IS_UTF8
#endif
typedef void (*QTextCodecStateFreeFunction)(QTextCodec::ConverterState*);
+typedef QHash<QByteArray, QTextCodec *> QTextCodecCache;
+
+struct QTextCodecData
+{
+ QTextCodecData();
+ ~QTextCodecData();
+
+ QList<QTextCodec*> allCodecs;
+ QAtomicPointer<QTextCodec> codecForLocale;
+ QTextCodecCache codecCache;
+
+ static QTextCodecData *instance();
+};
+
bool qTextCodecNameMatch(const char *a, const char *b);
#else // without textcodec: