From fe82c963b7a5de26a36942c1c2b8a7c34c3fd4da Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Thu, 24 Jan 2019 17:26:33 +0100 Subject: 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 Reviewed-by: Paul Wicking (cherry picked from commit 2832cc2dbc55122fe217e4c309f437fd237c1ba6) --- src/qdoc/codechunk.cpp | 36 ++++++++++++++++++++++++++++++++++++ src/qdoc/codechunk.h | 22 ---------------------- 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(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 + + 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 - - 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: -- cgit v1.2.1