summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Smith <martin.smith@qt.io>2019-01-24 17:26:33 +0100
committerTopi Reiniƶ <topi.reinio@qt.io>2019-02-04 14:47:14 +0000
commitfe82c963b7a5de26a36942c1c2b8a7c34c3fd4da (patch)
tree706fca9a03b997f125be59dd437cc9bc81b7b90e
parent69b9ad609a1c89760e1e3f3c409ab1e743b4310d (diff)
downloadqttools-fe82c963b7a5de26a36942c1c2b8a7c34c3fd4da.tar.gz
Document CodeChunk in its .cpp file, rather than its .h
Add documentation for two methods and fix a typo in the class comment. Change-Id: I3ba6d0d0307f3c1e581d68b1fb3e1c43a1566525 Reviewed-by: Martin Smith <martin.smith@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io> (cherry picked from commit 2832cc2dbc55122fe217e4c309f437fd237c1ba6)
-rw-r--r--src/qdoc/codechunk.cpp36
-rw-r--r--src/qdoc/codechunk.h22
2 files changed, 36 insertions, 22 deletions
diff --git a/src/qdoc/codechunk.cpp b/src/qdoc/codechunk.cpp
index 277622962..54d7f3131 100644
--- a/src/qdoc/codechunk.cpp
+++ b/src/qdoc/codechunk.cpp
@@ -89,6 +89,37 @@ static int category( QChar ch )
return charCategory[static_cast<int>(ch.toLatin1())];
}
+/*!
+ \class CodeChunk
+
+ \brief The CodeChunk class represents a tiny piece of C++ code.
+
+ \note I think this class should be eliminated (mws 11/12/2018
+
+ The class provides conversion between a list of lexemes and a string. It adds
+ spaces at the right place for consistent style. The tiny pieces of code it
+ represents are data types, enum values, and default parameter values.
+
+ Apart from the piece of code itself, there are two bits of metainformation
+ stored in CodeChunk: the base and the hotspot. The base is the part of the
+ piece that may be a hypertext link. The base of
+
+ QMap<QString, QString>
+
+ is QMap.
+
+ The hotspot is the place the variable name should be inserted in the case of a
+ variable (or parameter) declaration. The hotspot of
+
+ char * []
+
+ is between '*' and '[]'.
+*/
+
+/*!
+ Appends \a lexeme to the current string contents, inserting
+ a space if appropriate.
+ */
void CodeChunk::append( const QString& lexeme )
{
if ( !s.isEmpty() && !lexeme.isEmpty() ) {
@@ -104,6 +135,11 @@ void CodeChunk::append( const QString& lexeme )
s += lexeme;
}
+/*!
+ Converts the string with a regular expression that I think
+ removes the angle brackets parts and then splits it on "::".
+ The result is returned as a string list.
+ */
QStringList CodeChunk::toPath() const
{
QString t = s;
diff --git a/src/qdoc/codechunk.h b/src/qdoc/codechunk.h
index 3889d2854..0e1d3d2b4 100644
--- a/src/qdoc/codechunk.h
+++ b/src/qdoc/codechunk.h
@@ -39,28 +39,6 @@ QT_BEGIN_NAMESPACE
// ### get rid of that class
-/*
- The CodeChunk class represents a tiny piece of C++ code.
-
- The class provides conversion between a list of lexemes and a string. It adds
- spaces at the right place for consistent style. The tiny pieces of code it
- represents are data types, enum values, and default parameter values.
-
- Apart from the piece of code itself, there are two bits of metainformation
- stored in CodeChunk: the base and the hotspot. The base is the part of the
- piece that may be a hypertext link. The base of
-
- QMap<QString, QString>
-
- is QMap.
-
- The hotspot is the place the variable name should be inserted in the case of a
- variable (or parameter) declaration. The base of
-
- char * []
-
- is between '*' and '[]'.
-*/
class CodeChunk
{
public: