diff options
author | hjk <qtc-committer@nokia.com> | 2009-09-29 09:49:53 (GMT) |
---|---|---|
committer | hjk <qtc-committer@nokia.com> | 2009-09-30 08:07:23 (GMT) |
commit | 0c695b73f5bbc9122c8d3c61b883fa3f7fec7900 (patch) | |
tree | a74e81efdeddc1dc8fb788197a3dae707ba70eac /src/corelib/tools | |
parent | d4b82aa9fdad032b2c61bea9cb5e601e03aa0243 (diff) | |
download | Qt-0c695b73f5bbc9122c8d3c61b883fa3f7fec7900.zip Qt-0c695b73f5bbc9122c8d3c61b883fa3f7fec7900.tar.gz Qt-0c695b73f5bbc9122c8d3c61b883fa3f7fec7900.tar.bz2 |
fix string builder for QT_NO_CAST_FROM_ASCII on Windows
Reviewed-by: thiago
Diffstat (limited to 'src/corelib/tools')
-rw-r--r-- | src/corelib/tools/qstringbuilder.h | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/corelib/tools/qstringbuilder.h b/src/corelib/tools/qstringbuilder.h index e1a0e06..efa39b5 100644 --- a/src/corelib/tools/qstringbuilder.h +++ b/src/corelib/tools/qstringbuilder.h @@ -198,6 +198,17 @@ template <int N> struct QConcatenable<char[N]> } }; +template <int N> struct QConcatenable<const char[N]> +{ + typedef const char type[N]; + static int size(const char[N]) { return N - 1; } + static inline void appendTo(const char a[N], QChar *&out) + { + for (int i = 0; i < N - 1; ++i) + *out++ = QLatin1Char(a[i]); + } +}; + template <> struct QConcatenable<const char *> { typedef char const *type; @@ -241,7 +252,7 @@ template <typename A, typename B> QStringBuilder<typename QConcatenable<A>::type, typename QConcatenable<B>::type> operator%(const A &a, const B &b) { - return QStringBuilder<A, B>(a, b); + return QStringBuilder<typename QConcatenable<A>::type, typename QConcatenable<B>::type>(a, b); } #ifdef QT_USE_FAST_OPERATOR_PLUS @@ -249,7 +260,7 @@ template <typename A, typename B> QStringBuilder<typename QConcatenable<A>::type, typename QConcatenable<B>::type> operator+(const A &a, const B &b) { - return QStringBuilder<A, B>(a, b); + return QStringBuilder<typename QConcatenable<A>::type, typename QConcatenable<B>::type>(a, b); } #endif |