Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
Doc Class Reference

#include <doc.h>

Collaboration diagram for Doc:

Public Types

enum  Sections {
  NoSection = -1 , Section1 = 1 , Section2 = 2 , Section3 = 3 ,
  Section4 = 4
}

Public Member Functions

 Doc ()=default
 Doc (const Location &start_loc, const Location &end_loc, const QString &source, const QSet< QString > &metaCommandSet, const QSet< QString > &topics)
 Parse the qdoc comment source.
 Doc (const Doc &doc)
 ~Doc ()
Docoperator= (const Doc &doc)
const Locationlocation () const
 Returns the starting location of a qdoc comment.
const LocationstartLocation () const
 Returns the starting location of a qdoc comment.
bool isEmpty () const
const QStringsource () const
const Textbody () const
const Texttitle () const
Text briefText (bool inclusive=false) const
Text trimmedBriefText (const QString &className) const
Text legaleseText () const
QSet< QStringparameterNames () const
QStringList enumItemNames () const
QStringList omitEnumItemNames () const
QSet< QStringmetaCommandsUsed () const
TopicList topicsUsed () const
 Returns a reference to the list of topic commands used in the current qdoc comment.
ArgList metaCommandArgs (const QString &metaCommand) const
QList< TextalsoList () const
bool hasTableOfContents () const
bool hasKeywords () const
bool hasTargets () const
bool isInternal () const
 Returns true if the set of metacommands used in the doc comment contains {internal}.
bool isMarkedReimp () const
 Returns true if the set of metacommands used in the doc comment contains {reimp}.
bool isAutoGenerated () const
 Returns true if this documentation was auto-generated by QDoc rather than written by an author.
void markAutoGenerated ()
 Marks this documentation as auto-generated by QDoc.
QList< ArgPairoverloadList () const
 Returns the list of arguments passed to the {\overload} command.
bool hasOverloadCommand () const
const QList< Atom * > & tableOfContents () const
const QList< int > & tableOfContentsLevels () const
const QList< Atom * > & keywords () const
const QList< Atom * > & targets () const
QStringMultiMapmetaTagMap () const
QMultiMap< ComparisonCategory, Text > * comparesWithMap () const
void constructExtra () const

Static Public Member Functions

static void initialize (FileResolver &file_resolver)
static void terminate ()
 All the heap allocated variables are deleted.
static void trimCStyleComment (Location &location, QString &str)
 Replaces any asterisks used as a left margin in the comment str with spaces then trims the comment syntax from the start and end of the string, leaving only the text content.
static void quoteFromFile (const Location &location, Quoter &quoter, ResolvedFile resolved_file, CodeMarker *marker=nullptr)

(Note that these are not member symbols.)

 ArgList
 A list of metacommand arguments that appear in a Doc.

Detailed Description

Definition at line 31 of file doc.h.

Member Enumeration Documentation

◆ Sections

Enumerator
NoSection 
Section1 
Section2 
Section3 
Section4 

Definition at line 35 of file doc.h.

Constructor & Destructor Documentation

◆ Doc() [1/3]

Doc::Doc ( )
default

◆ Doc() [2/3]

Doc::Doc ( const Location & start_loc,
const Location & end_loc,
const QString & source,
const QSet< QString > & metaCommandSet,
const QSet< QString > & topics )

Parse the qdoc comment source.

Build up a list of all the topic commands found including their arguments. This constructor is used when there can be more than one topic command in theqdoc comment. Normally, there is only one topic command in a qdoc comment, but in QML documentation, there is the case where the qdoc {qmlproperty} command can appear multiple times in a qdoc comment.

Definition at line 46 of file doc.cpp.

References body(), and Text::dump().

Here is the call graph for this function:

◆ Doc() [3/3]

Doc::Doc ( const Doc & doc)

Definition at line 63 of file doc.cpp.

References operator=().

Here is the call graph for this function:

◆ ~Doc()

Doc::~Doc ( )

Definition at line 68 of file doc.cpp.

References DocPrivate::deref().

Here is the call graph for this function:

Member Function Documentation

◆ alsoList()

QList< Text > Doc::alsoList ( ) const
nodiscard

Definition at line 280 of file doc.cpp.

◆ body()

const Text & Doc::body ( ) const
nodiscard

Definition at line 114 of file doc.cpp.

References DocPrivate::m_text.

Referenced by Doc(), WebXMLGenerator::append(), briefText(), NodeExtractor::extractMemberIR(), DocBookGenerator::generateBody(), Generator::generateBody(), and legaleseText().

Here is the caller graph for this function:

◆ briefText()

Text Doc::briefText ( bool inclusive = false) const
nodiscard

Definition at line 126 of file doc.cpp.

References body(), Atom::BriefLeft, Atom::BriefRight, and Text::subText().

Referenced by NodeExtractor::extractMemberIR(), and trimmedBriefText().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ comparesWithMap()

QMultiMap< ComparisonCategory, Text > * Doc::comparesWithMap ( ) const
nodiscard

Definition at line 345 of file doc.cpp.

References DocPrivate::extra.

◆ constructExtra()

void Doc::constructExtra ( ) const

Definition at line 350 of file doc.cpp.

References DocPrivate::constructExtra().

Here is the call graph for this function:

◆ enumItemNames()

QStringList Doc::enumItemNames ( ) const
nodiscard

Definition at line 205 of file doc.cpp.

◆ hasKeywords()

bool Doc::hasKeywords ( ) const
nodiscard

Definition at line 290 of file doc.cpp.

References DocPrivate::extra.

◆ hasOverloadCommand()

bool Doc::hasOverloadCommand ( ) const
inlinenodiscard

Definition at line 75 of file doc.h.

◆ hasTableOfContents()

bool Doc::hasTableOfContents ( ) const
nodiscard

Definition at line 285 of file doc.cpp.

References DocPrivate::extra.

◆ hasTargets()

bool Doc::hasTargets ( ) const
nodiscard

Definition at line 295 of file doc.cpp.

References DocPrivate::extra.

◆ initialize()

void Doc::initialize ( FileResolver & file_resolver)
static

Definition at line 356 of file doc.cpp.

References DocParser::initialize().

Referenced by processQdocconfFile().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isAutoGenerated()

bool Doc::isAutoGenerated ( ) const
nodiscard

Returns true if this documentation was auto-generated by QDoc rather than written by an author.

Definition at line 242 of file doc.cpp.

References DocPrivate::m_autoGenerated.

Referenced by Node< _Tp >::createContext(), CodeParser::isWorthWarningAbout(), Node< _Tp >::setDoc(), and warnAboutDocumentedChildInUndocumentedParent().

Here is the caller graph for this function:

◆ isEmpty()

bool Doc::isEmpty ( ) const
nodiscard

Definition at line 109 of file doc.cpp.

Referenced by Node< _Tp >::hasDoc(), and Node< _Tp >::setDoc().

Here is the caller graph for this function:

◆ isInternal()

bool Doc::isInternal ( ) const
nodiscard

Returns true if the set of metacommands used in the doc comment contains {internal}.

Definition at line 224 of file doc.cpp.

◆ isMarkedReimp()

bool Doc::isMarkedReimp ( ) const
nodiscard

Returns true if the set of metacommands used in the doc comment contains {reimp}.

Definition at line 233 of file doc.cpp.

Referenced by Node< _Tp >::setDoc().

Here is the caller graph for this function:

◆ keywords()

const QList< Atom * > & Doc::keywords ( ) const
nodiscard

Definition at line 320 of file doc.cpp.

References DocPrivate::constructExtra(), and DocPrivate::extra.

Here is the call graph for this function:

◆ legaleseText()

Text Doc::legaleseText ( ) const
nodiscard

Definition at line 192 of file doc.cpp.

References Text::Text(), body(), Atom::LegaleseLeft, Atom::LegaleseRight, DocPrivate::m_hasLegalese, and Text::subText().

Here is the call graph for this function:

◆ location()

◆ markAutoGenerated()

void Doc::markAutoGenerated ( )

Marks this documentation as auto-generated by QDoc.

Definition at line 250 of file doc.cpp.

References DocPrivate::m_autoGenerated.

Referenced by autoGenerateSmfDoc().

Here is the caller graph for this function:

◆ metaCommandArgs()

ArgList Doc::metaCommandArgs ( const QString & metaCommand) const
nodiscard

Definition at line 275 of file doc.cpp.

References DocPrivate::m_metaCommandMap.

◆ metaCommandsUsed()

QSet< QString > Doc::metaCommandsUsed ( ) const
nodiscard

Definition at line 215 of file doc.cpp.

◆ metaTagMap()

QStringMultiMap * Doc::metaTagMap ( ) const
nodiscard

Definition at line 340 of file doc.cpp.

References DocPrivate::extra, and DocPrivateExtra::m_metaMap.

Referenced by Node< _Tp >::nodeSortKeyOrNameLessThan().

Here is the caller graph for this function:

◆ omitEnumItemNames()

QStringList Doc::omitEnumItemNames ( ) const
nodiscard

Definition at line 210 of file doc.cpp.

◆ operator=()

Doc & Doc::operator= ( const Doc & doc)

Definition at line 74 of file doc.cpp.

References DocPrivate::deref(), and DocPrivate::ref().

Referenced by Doc(), and Node< _Tp >::setDoc().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ overloadList()

QList< ArgPair > Doc::overloadList ( ) const
nodiscard

Returns the list of arguments passed to the {\overload} command.

Definition at line 260 of file doc.cpp.

◆ parameterNames()

QSet< QString > Doc::parameterNames ( ) const
nodiscard

Definition at line 200 of file doc.cpp.

◆ quoteFromFile()

void Doc::quoteFromFile ( const Location & location,
Quoter & quoter,
ResolvedFile resolved_file,
CodeMarker * marker = nullptr )
static

Definition at line 461 of file doc.cpp.

Referenced by DocBookGenerator::generateExampleFilePage(), HtmlGenerator::generateExampleFilePage(), and WebXMLGenerator::generateExampleFilePage().

Here is the caller graph for this function:

◆ source()

const QString & Doc::source ( ) const
nodiscard

Definition at line 103 of file doc.cpp.

◆ startLocation()

const Location & Doc::startLocation ( ) const
nodiscard

Returns the starting location of a qdoc comment.

Definition at line 98 of file doc.cpp.

References location().

Referenced by CppCodeParser::processQmlProperties(), and CppCodeParser::processTopicCommand().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ tableOfContents()

const QList< Atom * > & Doc::tableOfContents ( ) const
nodiscard

Definition at line 300 of file doc.cpp.

References DocPrivate::constructExtra(), and DocPrivate::extra.

Here is the call graph for this function:

◆ tableOfContentsLevels()

const QList< int > & Doc::tableOfContentsLevels ( ) const
nodiscard

Definition at line 310 of file doc.cpp.

References DocPrivate::constructExtra(), and DocPrivate::extra.

Here is the call graph for this function:

◆ targets()

const QList< Atom * > & Doc::targets ( ) const
nodiscard

Definition at line 330 of file doc.cpp.

References DocPrivate::constructExtra(), and DocPrivate::extra.

Here is the call graph for this function:

◆ terminate()

void Doc::terminate ( )
static

All the heap allocated variables are deleted.

Definition at line 409 of file doc.cpp.

References DocUtilities::cmdHash, and DocUtilities::macroHash.

Referenced by processQdocconfFile().

Here is the caller graph for this function:

◆ title()

const Text & Doc::title ( ) const
nodiscard

Definition at line 120 of file doc.cpp.

References DocPrivate::m_title.

Referenced by CppCodeParser::processMetaCommands().

Here is the caller graph for this function:

◆ topicsUsed()

TopicList Doc::topicsUsed ( ) const
nodiscard

Returns a reference to the list of topic commands used in the current qdoc comment.

Normally there is only one, but there can be multiple {qmlproperty} commands, for example.

Definition at line 270 of file doc.cpp.

References DocPrivate::m_topics.

Referenced by ClangCodeParser::parse_cpp_file(), and CppCodeParser::processQmlProperties().

Here is the caller graph for this function:

◆ trimCStyleComment()

void Doc::trimCStyleComment ( Location & location,
QString & str )
static

Replaces any asterisks used as a left margin in the comment str with spaces then trims the comment syntax from the start and end of the string, leaving only the text content.

Updates the location to refer to the location of the content in the original file.

Definition at line 421 of file doc.cpp.

References Location::columnNo().

Here is the call graph for this function:

◆ trimmedBriefText()

Text Doc::trimmedBriefText ( const QString & className) const
nodiscard

Definition at line 131 of file doc.cpp.

References Atom::AutoLink, briefText(), Atom::C, Text::firstAtom(), Atom::next(), Atom::String, and Atom::type().

Here is the call graph for this function:

◆ ArgList()

ArgList
related

A list of metacommand arguments that appear in a Doc.

Each entry in the list is a <QString, QString> pair (ArgPair):

\list

  • {ArgPair.first} - arguments passed to the command.
  • {ArgPair.second} - optional argument string passed within brackets immediately following the command. \endlist

Definition at line 28 of file doc.h.


The documentation for this class was generated from the following files: