summaryrefslogtreecommitdiffstats
path: root/src/corelib/text/qstringconverter_p.h
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2020-04-23 11:34:01 +0200
committerLars Knoll <lars.knoll@qt.io>2020-05-14 07:47:53 +0200
commitd8997ad797f8843e2632257586a5611e8dde300a (patch)
treeb6a2a9bdc335839d11961bb9219601872435a736 /src/corelib/text/qstringconverter_p.h
parent5dcfd0ac2f3aa5c9f24022968827cc93d9839b45 (diff)
Clean up QUtf16::convertTo/FromUnicode
Clean up the method, and refactor it so we can avoid one copy of the data when using QStringConverter. Make the conversion to unicode more by avoiding conditions in the inner loop and doing a memcpy if endianness matches. Change-Id: I869daf861f886d69b67a1b223ac2238498b609ac Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/text/qstringconverter_p.h')
-rw-r--r--src/corelib/text/qstringconverter_p.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/corelib/text/qstringconverter_p.h b/src/corelib/text/qstringconverter_p.h
index ba1db5b52c..4768677a25 100644
--- a/src/corelib/text/qstringconverter_p.h
+++ b/src/corelib/text/qstringconverter_p.h
@@ -305,7 +305,9 @@ struct QUtf8
struct QUtf16
{
static QString convertToUnicode(const char *, qsizetype, QStringConverter::State *, DataEndianness = DetectEndianness);
+ static QChar *convertToUnicode(QChar *out, const char *chars, qsizetype len, QStringConverter::State *state, DataEndianness endian);
static QByteArray convertFromUnicode(const QChar *, qsizetype, QStringConverter::State *, DataEndianness = DetectEndianness);
+ static char *convertFromUnicode(char *out, QStringView in, QStringConverter::State *state, DataEndianness endian);
};
struct QUtf32