Remove unneeded code to convert to ASCII/Latin1.
This isn't used, and isn't wanted with the upcoming utf8 switch. Change-Id: Ibec0fa7f36549df6a1c240353ffcd44beb2976f0 Reviewed-by: João Abecasis <joao.abecasis@nokia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
parent
13c7de63a1
commit
949127264d
@ -116,17 +116,4 @@ void QAbstractConcatenable::convertFromAscii(const char *a, int len, QChar *&out
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*! \internal */
|
|
||||||
void QAbstractConcatenable::convertToAscii(const QChar* a, int len, char*& out)
|
|
||||||
{
|
|
||||||
if (len == -1) {
|
|
||||||
while (a->unicode())
|
|
||||||
convertToLatin1(*a++, out);
|
|
||||||
} else {
|
|
||||||
for (int i = 0; i < len; ++i)
|
|
||||||
convertToLatin1(a[i], out);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
@ -62,21 +62,10 @@ struct Q_CORE_EXPORT QAbstractConcatenable
|
|||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
static void convertFromAscii(const char *a, int len, QChar *&out);
|
static void convertFromAscii(const char *a, int len, QChar *&out);
|
||||||
static void convertToAscii(const QChar *a, int len, char *&out);
|
|
||||||
static inline void convertFromAscii(char a, QChar *&out)
|
static inline void convertFromAscii(char a, QChar *&out)
|
||||||
{
|
{
|
||||||
*out++ = QLatin1Char(a);
|
*out++ = QLatin1Char(a);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void convertToAscii(QChar a, char *&out)
|
|
||||||
{
|
|
||||||
convertToLatin1(a, out);
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void convertToLatin1(QChar a, char *&out)
|
|
||||||
{
|
|
||||||
*out++ = a.unicode() > 0xff ? '?' : char(a.unicode());
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename T> struct QConcatenable {};
|
template <typename T> struct QConcatenable {};
|
||||||
@ -182,10 +171,6 @@ template <> struct QConcatenable<QChar> : private QAbstractConcatenable
|
|||||||
static int size(const QChar) { return 1; }
|
static int size(const QChar) { return 1; }
|
||||||
static inline void appendTo(const QChar c, QChar *&out)
|
static inline void appendTo(const QChar c, QChar *&out)
|
||||||
{ *out++ = c; }
|
{ *out++ = c; }
|
||||||
#ifndef QT_NO_CAST_TO_ASCII
|
|
||||||
static inline QT_ASCII_CAST_WARN void appendTo(const QChar c, char *&out)
|
|
||||||
{ convertToAscii(c, out); }
|
|
||||||
#endif
|
|
||||||
};
|
};
|
||||||
|
|
||||||
template <> struct QConcatenable<QCharRef> : private QAbstractConcatenable
|
template <> struct QConcatenable<QCharRef> : private QAbstractConcatenable
|
||||||
@ -196,10 +181,6 @@ template <> struct QConcatenable<QCharRef> : private QAbstractConcatenable
|
|||||||
static int size(const QCharRef &) { return 1; }
|
static int size(const QCharRef &) { return 1; }
|
||||||
static inline void appendTo(const QCharRef &c, QChar *&out)
|
static inline void appendTo(const QCharRef &c, QChar *&out)
|
||||||
{ *out++ = QChar(c); }
|
{ *out++ = QChar(c); }
|
||||||
#ifndef QT_NO_CAST_TO_ASCII
|
|
||||||
static inline QT_ASCII_CAST_WARN void appendTo(const QCharRef &c, char *&out)
|
|
||||||
{ convertToAscii(c, out); }
|
|
||||||
#endif
|
|
||||||
};
|
};
|
||||||
|
|
||||||
template <> struct QConcatenable<QLatin1String>
|
template <> struct QConcatenable<QLatin1String>
|
||||||
@ -232,10 +213,6 @@ template <> struct QConcatenable<QString> : private QAbstractConcatenable
|
|||||||
memcpy(out, reinterpret_cast<const char*>(a.constData()), sizeof(QChar) * n);
|
memcpy(out, reinterpret_cast<const char*>(a.constData()), sizeof(QChar) * n);
|
||||||
out += n;
|
out += n;
|
||||||
}
|
}
|
||||||
#ifndef QT_NO_CAST_TO_ASCII
|
|
||||||
static inline QT_ASCII_CAST_WARN void appendTo(const QString &a, char *&out)
|
|
||||||
{ convertToAscii(a.constData(), a.length(), out); }
|
|
||||||
#endif
|
|
||||||
};
|
};
|
||||||
|
|
||||||
template <int N> struct QConcatenable<QConstStringDataPtr<N> > : private QAbstractConcatenable
|
template <int N> struct QConcatenable<QConstStringDataPtr<N> > : private QAbstractConcatenable
|
||||||
@ -249,10 +226,6 @@ template <int N> struct QConcatenable<QConstStringDataPtr<N> > : private QAbstra
|
|||||||
memcpy(out, reinterpret_cast<const char*>(a.ptr->data), sizeof(QChar) * N);
|
memcpy(out, reinterpret_cast<const char*>(a.ptr->data), sizeof(QChar) * N);
|
||||||
out += N;
|
out += N;
|
||||||
}
|
}
|
||||||
#ifndef QT_NO_CAST_TO_ASCII
|
|
||||||
static inline QT_ASCII_CAST_WARN void appendTo(const type &a, char *&out)
|
|
||||||
{ convertToAscii(a.ptr->data, N, out); }
|
|
||||||
#endif
|
|
||||||
};
|
};
|
||||||
|
|
||||||
template <> struct QConcatenable<QStringRef> : private QAbstractConcatenable
|
template <> struct QConcatenable<QStringRef> : private QAbstractConcatenable
|
||||||
@ -267,11 +240,6 @@ template <> struct QConcatenable<QStringRef> : private QAbstractConcatenable
|
|||||||
memcpy(out, reinterpret_cast<const char*>(a.constData()), sizeof(QChar) * n);
|
memcpy(out, reinterpret_cast<const char*>(a.constData()), sizeof(QChar) * n);
|
||||||
out += n;
|
out += n;
|
||||||
}
|
}
|
||||||
#ifndef QT_NO_CAST_TO_ASCII
|
|
||||||
static inline QT_ASCII_CAST_WARN void appendTo(const QStringRef &a, char *&out)
|
|
||||||
{ convertToAscii(a.constData(), a.length(), out); }
|
|
||||||
#endif
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
template <int N> struct QConcatenable<char[N]> : private QAbstractConcatenable
|
template <int N> struct QConcatenable<char[N]> : private QAbstractConcatenable
|
||||||
|
Loading…
Reference in New Issue
Block a user