summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorMartin Smith <msmith@trolltech.com>2009-06-17 08:30:30 (GMT)
committerMartin Smith <msmith@trolltech.com>2009-06-17 08:34:35 (GMT)
commitcf521799d71861c067a07d30418cf3b3504fbfe9 (patch)
tree18489169852fe4f37abf94981febe0e141e3fe0a /src/corelib
parent99c5b68d4af7b099f201a7b89c86209df9e9349b (diff)
downloadQt-cf521799d71861c067a07d30418cf3b3504fbfe9.zip
Qt-cf521799d71861c067a07d30418cf3b3504fbfe9.tar.gz
Qt-cf521799d71861c067a07d30418cf3b3504fbfe9.tar.bz2
doc: Fixed several qdoc warnings.
All the qdoc errors are fixed in QStringBuilder, but because the class is a template class and uses strange templates, qdoc gets very confused, and the resulting documentation for QStringBuilder is not complete and accurate. To fix this correctly will require changes to the qdoc program.
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/tools/qstringbuilder.cpp54
-rw-r--r--src/corelib/tools/qstringbuilder.h9
2 files changed, 36 insertions, 27 deletions
diff --git a/src/corelib/tools/qstringbuilder.cpp b/src/corelib/tools/qstringbuilder.cpp
index a01b58c..17e2cec 100644
--- a/src/corelib/tools/qstringbuilder.cpp
+++ b/src/corelib/tools/qstringbuilder.cpp
@@ -70,49 +70,43 @@
NULL char.
*/
-/*! \fn QLatin1Literal::QLatin1Literal(const char(&string)[N])
+/*! \fn QLatin1Literal::QLatin1Literal(const char str)
- Constructs a new literal from the given \a string.
+ Constructs a new literal from the string \a str.
*/
-/*! \fn char *QLatin1Literal::data() const
+/*! \fn const char *QLatin1Literal::data() const
Returns a pointer to the first character of the string literal.
The string literal is terminated by a NUL character.
*/
-/*! \fn QLatin1Literal::operator QString() const
-
- Converts the \c QLatin1Literal into a \c QString object.
-*/
-
-
-
/*!
\class QStringBuilder
\reentrant
\since 4.6
- \brief The QStringBuilder class is a template class that provides a facility to build
- up QStrings from smaller chunks.
+ \brief The QStringBuilder class is a template class that provides a facility to build up QStrings from smaller chunks.
\ingroup tools
\ingroup shared
\ingroup text
\mainclass
- When creating strings from smaller chunks, typically \c QString::operator+()
- is used, resulting in \e{n - 1} reallocations when operating on \e{n} chunks.
+ To build a QString by multiple concatenations, QString::operator+()
+ is typically used. This causes \e{n - 1} reallocations when building
+ a string from \e{n} chunks.
- QStringBuilder uses expression templates to collect the individual parts,
- compute the total size, allocate memory for the resulting QString object,
- and copy the contents of the chunks into the result.
+ QStringBuilder uses expression templates to collect the individual
+ chunks, compute the total size, allocate the required amount of
+ memory for the final QString object, and copy the chunks into the
+ allocated memory.
- The QStringBuilder class is not to be used explicitly in user code.
- Instances of the class are created as return values of the operator%()
- function, acting on objects of type \c QString, \c QLatin1String,
- \c QLatin1Literal, \c \QStringRef, \c QChar, \c QCharRef,
- \c QLatin1Char, and \c char.
+ The QStringBuilder class is not to be used explicitly in user
+ code. Instances of the class are created as return values of the
+ operator%() function, acting on objects of type QString,
+ QLatin1String, QLatin1Literal, QStringRef, QChar, QCharRef,
+ QLatin1Char, and \c char.
Concatenating strings with operator%() generally yields better
performance then using \c QString::operator+() on the same chunks
@@ -122,7 +116,11 @@
\sa QLatin1Literal, QString
*/
-/* \fn template <class A, class B> QStringBuilder<A, B> operator%(const A &a, const B &b)
+/*! \fn QStringBuilder::QStringBuilder(const A &a, const B &b)
+ Constructs a QStringBuilder from \a a and \a b.
+ */
+
+/* \fn QStringBuilder::operator%(const A &a, const B &b)
Returns a \c QStringBuilder object that is converted to a QString object
when assigned to a variable of QString type or passed to a function that
@@ -133,3 +131,13 @@
\c QChar, \c QCharRef, \c QLatin1Char, and \c char.
*/
+/*! \fn QByteArray QStringBuilder::toLatin1() const
+ Returns a Latin-1 representation of the string as a QByteArray. The
+ returned byte array is undefined if the string contains non-Latin1
+ characters.
+ */
+
+/*! \fn QStringBuilder::operator QString() const
+
+ Converts the \c QLatin1Literal into a \c QString object.
+*/
diff --git a/src/corelib/tools/qstringbuilder.h b/src/corelib/tools/qstringbuilder.h
index c63dc7b..19f14b4 100644
--- a/src/corelib/tools/qstringbuilder.h
+++ b/src/corelib/tools/qstringbuilder.h
@@ -56,11 +56,12 @@ QT_MODULE(Core)
class QLatin1Literal
{
public:
- template <int N>
- QLatin1Literal(const char (&str)[N]) : m_size(N - 1), m_data(str) {}
+ int size() const { return m_size; }
+ const char *data() const { return m_data; }
- inline int size() const { return m_size; }
- inline 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;