summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qstringbuilder.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/tools/qstringbuilder.h')
-rw-r--r--src/corelib/tools/qstringbuilder.h38
1 files changed, 2 insertions, 36 deletions
diff --git a/src/corelib/tools/qstringbuilder.h b/src/corelib/tools/qstringbuilder.h
index 594ab2f183..c86a51f8e3 100644
--- a/src/corelib/tools/qstringbuilder.h
+++ b/src/corelib/tools/qstringbuilder.h
@@ -59,22 +59,6 @@ QT_BEGIN_NAMESPACE
QT_MODULE(Core)
-// ### Qt 5: merge with QLatin1String
-class QLatin1Literal
-{
-public:
- int size() const { return m_size; }
- const char *data() const { return m_data; }
-
- template <int N>
- QLatin1Literal(const char (&str)[N])
- : m_size(N - 1), m_data(str) {}
-
-private:
- const int m_size;
- const char * const m_data;
-};
-
struct Q_CORE_EXPORT QAbstractConcatenable
{
protected:
@@ -234,31 +218,13 @@ template <> struct QConcatenable<QLatin1String>
typedef QLatin1String type;
typedef QString ConvertTo;
enum { ExactSize = true };
- static int size(const QLatin1String &a) { return qstrlen(a.latin1()); }
+ static int size(const QLatin1String &a) { return a.size(); }
static inline void appendTo(const QLatin1String &a, QChar *&out)
{
- for (const char *s = a.latin1(); *s; )
- *out++ = QLatin1Char(*s++);
- }
- static inline void appendTo(const QLatin1String &a, char *&out)
- {
- for (const char *s = a.latin1(); *s; )
- *out++ = *s++;
- }
-};
-
-template <> struct QConcatenable<QLatin1Literal>
-{
- typedef QLatin1Literal type;
- typedef QString ConvertTo;
- enum { ExactSize = true };
- static int size(const QLatin1Literal &a) { return a.size(); }
- static inline void appendTo(const QLatin1Literal &a, QChar *&out)
- {
for (const char *s = a.data(); *s; )
*out++ = QLatin1Char(*s++);
}
- static inline void appendTo(const QLatin1Literal &a, char *&out)
+ static inline void appendTo(const QLatin1String &a, char *&out)
{
for (const char *s = a.data(); *s; )
*out++ = *s++;