42 #ifndef QSTRINGBUILDER_H
43 #define QSTRINGBUILDER_H
48 #if defined(Q_CC_GNU) && !defined(Q_CC_INTEL)
49 # if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ == 0)
66 int size()
const {
return m_size; }
67 const char *
data()
const {
return m_data; }
71 : m_size(N - 1), m_data(str) {}
75 const char *
const m_data;
81 static void convertFromAscii(
const char *
a,
int len,
QChar *&out);
82 static void convertToAscii(
const QChar *a,
int len,
char *&out);
85 #ifndef QT_NO_TEXTCODEC
86 if (QString::codecForCStrings)
95 #ifndef QT_NO_TEXTCODEC
96 if (QString::codecForCStrings)
100 convertToLatin1(a, out);
111 template <
typename A,
typename B>
119 template <
typename T> T convertTo()
const
124 typename T::iterator d =
s.data();
125 typename T::const_iterator
const start = d;
139 operator ConvertTo()
const {
return convertTo<ConvertTo>(); }
180 enum { ExactSize =
true };
181 static int size(
const char) {
return 1; }
182 #ifndef QT_NO_CAST_FROM_ASCII
196 enum { ExactSize =
true };
208 enum { ExactSize =
true };
212 #ifndef QT_NO_CAST_TO_ASCII
214 { convertToAscii(c, out); }
222 enum { ExactSize =
true };
225 { *out++ =
QChar(c); }
226 #ifndef QT_NO_CAST_TO_ASCII
228 { convertToAscii(c, out); }
236 enum { ExactSize =
true };
240 for (
const char *
s = a.
latin1(); *
s; )
245 for (
const char *
s = a.
latin1(); *
s; )
254 enum { ExactSize =
true };
255 static int size(
const QLatin1Literal &
a) {
return a.
size(); }
258 for (
const char *
s = a.
data(); *
s; )
261 static inline void appendTo(
const QLatin1Literal &
a,
char *&out)
263 for (
const char *
s = a.
data(); *
s; )
272 enum { ExactSize =
true };
276 const int n = a.
size();
277 memcpy(out, reinterpret_cast<const char*>(a.
constData()),
sizeof(
QChar) *
n);
280 #ifndef QT_NO_CAST_TO_ASCII
290 enum { ExactSize =
true };
294 const int n = a.
size();
295 memcpy(out, reinterpret_cast<const char*>(a.
constData()),
sizeof(
QChar) *
n);
298 #ifndef QT_NO_CAST_TO_ASCII
309 enum { ExactSize =
false };
310 static int size(
const char[N]) {
return N - 1; }
311 #ifndef QT_NO_CAST_FROM_ASCII
317 static inline void appendTo(
const char a[N],
char *&out)
328 enum { ExactSize =
false };
329 static int size(
const char[N]) {
return N - 1; }
330 #ifndef QT_NO_CAST_FROM_ASCII
336 static inline void appendTo(
const char a[N],
char *&out)
347 enum { ExactSize =
false };
349 #ifndef QT_NO_CAST_FROM_ASCII
366 enum { ExactSize =
false };
368 #ifndef QT_NO_CAST_FROM_ASCII
378 const char *
const end = ba.
end();
391 template <
typename A,
typename B>
401 template<
typename T>
static inline void appendTo(
const type &
p, T *&out)
408 template <
typename A,
typename B>
417 #if defined(QT_USE_FAST_OPERATOR_PLUS) || defined(QT_USE_QSTRINGBUILDER)
418 template <
typename A,
typename B>
426 template <
typename A,
typename B>
429 #ifndef QT_NO_CAST_TO_ASCII
443 template <
typename A,
typename B>
459 #endif // QSTRINGBUILDER_H
static int size(const QByteArray &ba)
QStringBuilder(const QString &a_, const QString &b_)
QStringBuilder(const A &a_, const B &b_)
GLuint GLuint GLsizei GLenum type
GLdouble GLdouble GLdouble r
static QT_ASCII_CAST_WARN void appendTo(const char c, QChar *&out)
const QChar * constData() const
const QChar * constData() const
static void convertFromAscii(char a, QChar *&out)
QtStringBuilder::ConvertToTypeHelper< typename QConcatenable< A >::ConvertTo, typename QConcatenable< B >::ConvertTo >::ConvertTo ConvertTo
static void appendTo(const QStringRef &a, QChar *&out)
static void appendTo(const QLatin1String &a, char *&out)
static int size(const QChar)
const char * data() const
QByteArray & operator+=(QByteArray &a, const QStringBuilder< A, B > &b)
static void QT_ASCII_CAST_WARN appendTo(const char a[N], QChar *&out)
static void appendTo(const char *a, char *&out)
static void convertToAscii(QChar a, char *&out)
const char * latin1() const
static void appendTo(const QLatin1Literal &a, QChar *&out)
static QT_ASCII_CAST_WARN void appendTo(const QString &a, char *&out)
static void appendTo(const QLatin1Literal &a, char *&out)
static QChar fromAscii(char c)
static void appendTo(const QChar c, QChar *&out)
static int size(const QString &a)
static int size(const char[N])
static int size(const type &p)
static void appendTo(const QCharRef &c, QChar *&out)
const char * constData() const
static void appendTo(const QLatin1Char c, char *&out)
static QT_ASCII_CAST_WARN void appendTo(const QStringRef &a, char *&out)
static void appendTo(const type &p, T *&out)
static QT_ASCII_CAST_WARN void appendTo(const QCharRef &c, char *&out)
#define QT_BEGIN_NAMESPACE
static int size(const QLatin1String &a)
static void appendTo(const QString &a, QChar *&out)
static int size(const QLatin1Literal &a)
static void appendTo(const char a[N], char *&out)
QLatin1Literal(const char(&str)[N])
static void appendTo(const char c, char *&out)
static int size(const QLatin1Char)
static void appendTo(const QLatin1Char c, QChar *&out)
const QByteArray operator+(const QByteArray &a1, const QByteArray &a2)
QStringBuilder< typename QConcatenable< A >::type, typename QConcatenable< B >::type > operator%(const A &a, const B &b)
QStringBuilder< A, B > type
static int size(const char)
QByteArray toLatin1() const
uint qstrlen(const char *str)
static void convertToLatin1(QChar a, char *&out)
static void appendTo(const QLatin1String &a, QChar *&out)
static int size(const char *a)
GLubyte GLubyte GLubyte a
static int size(const QCharRef &)
static int size(const char[N])
QStringBuilder(const QByteArray &a_, const QByteArray &b_)
static void appendTo(const QByteArray &ba, char *&out)
static void convertFromAscii(const char *a, int len, QChar *&out)
static QT_ASCII_CAST_WARN void appendTo(const QChar c, char *&out)
static void QT_ASCII_CAST_WARN appendTo(const char a[N], QChar *&out)
static void appendTo(const char a[N], char *&out)
static void QT_ASCII_CAST_WARN appendTo(const char *a, QChar *&out)
static void appendTo(const QByteArray &ba, QChar *&out)
static int size(const QStringRef &a)
QByteArray toLatin1() const