7#include <QtCore/qstring.h>
8#include <QtCore/qloggingcategory.h>
12Q_DECLARE_LOGGING_CATEGORY(lcQdoc)
13Q_DECLARE_LOGGING_CATEGORY(lcQdocClang)
16void startDebugging(
const QString &message);
17void stopDebugging(
const QString &message);
20QString
separator(qsizetype wordPosition, qsizetype numberOfWords);
21QString
comma(qsizetype wordPosition, qsizetype numberOfWords);
22QString asAsciiPrintable(
const QString &name);
23QStringList getInternalIncludePaths(
const QString &compiler);
int main(int argc, char *argv[])
[2]
std::optional< PCHFile > buildPCH(QDocDatabase *qdb, QString module_header, const std::set< Config::HeaderFilePath > &all_headers, const std::vector< QByteArray > &include_paths, const QList< QByteArray > &defines)
Building the PCH must be possible when there are no .cpp files, so it is moved here to its own member...
struct CXTranslationUnitImpl * CXTranslationUnit
The Atom class is the fundamental unit for representing documents internally.
AtomType type() const
Return the type of this atom.
virtual Node::Genus genus()
void setNext(Atom *newNext)
AtomType
\value AnnotatedList \value AutoLink \value BaseName \value BriefLeft \value BriefRight \value C \val...
virtual bool isLinkAtom() const
const QString & string() const
Returns the string parameter that together with the type characterizes this atom.
QString linkText() const
For a link atom, returns the string representing the link text if one exist in the list of atoms.
Atom * next()
Return the next atom in the atom list.
const Atom * next() const
Return the next atom in the atom list.
void chopString()
\also string()
const QString & string(int i) const
const Atom * next(AtomType t) const
Return the next Atom in the list if it is of AtomType t.
const Atom * find(AtomType t) const
Starting from this Atom, searches the linked list for the atom of specified type t and returns it.
const QStringList & strings() const
QString typeString() const
Return the type of this atom as a string.
void appendChar(QChar ch)
Appends ch to the string parameter of this atom.
virtual void resolveSquareBracketParams()
ParsedCppFileIR parse_cpp_file(const QString &filePath)
Get ready to parse the C++ cpp file identified by filePath and add its parsed contents to the databas...
ClangCodeParser(QDocDatabase *qdb, Config &, const std::vector< QByteArray > &include_paths, const QList< QByteArray > &defines, std::optional< std::reference_wrapper< const PCHFile > > pch)
The ClassNode represents a C++ class.
virtual QString markedUpQmlItem(const Node *, bool)
static QString extraSynopsis(const Node *node, Section::Style style)
Returns the 'extra' synopsis string for node with status information, using a specified section style...
virtual QString markedUpSynopsis(const Node *, const Node *, Section::Style)
CodeMarker()
When a code marker constructs itself, it puts itself into the static list of code markers.
virtual void initializeMarker()
A code market performs no initialization by default.
static void initialize()
All the code markers in the static list are initialized here, after the qdoc configuration file has b...
QString taggedQmlNode(const Node *node)
virtual ~CodeMarker()
When a code marker destroys itself, it removes itself from the static list of code markers.
virtual void terminateMarker()
Terminating a code marker is trivial.
static void terminate()
All the code markers in the static list are terminated here.
virtual Atom::AtomType atomType() const
static QString stringForNode(const Node *node)
virtual QString markedUpName(const Node *)
QString taggedNode(const Node *node)
static const QSet< QString > common_meta_commands
virtual void initializeParser()=0
virtual void terminateParser()
Terminating a code parser is trivial.
CodeParser()
The constructor adds this code parser to the static list of code parsers.
static void setLink(Node *node, Node::LinkType linkType, const QString &arg)
virtual QString language()=0
virtual void parseSourceFile(const Location &location, const QString &filePath, CppCodeParser &cpp_code_parser)=0
static CodeParser * parserForLanguage(const QString &language)
static CodeParser * parserForSourceFile(const QString &filePath)
static bool isWorthWarningAbout(const Doc &doc)
Test for whether a doc comment warrants warnings.
virtual QStringList sourceFileNameFilter()=0
virtual ~CodeParser()
The destructor removes this code parser from the static list of code parsers.
static void extractPageLinkAndDesc(QStringView arg, QString *link, QString *desc)
static void initialize()
All the code parsers in the static list are initialized here, after the qdoc configuration variables ...
static void terminate()
All the code parsers in the static list are terminated here.
A class for holding the members of a collection of doc pages.
contains all the information for a single config variable in a .qdocconf file.
const Location & location() const
QStringList asStringList() const
Returns this config variable as a string list.
int asInt() const
Returns this configuration variable as an integer; iterates through the string list,...
bool asBool() const
Returns this config variable as a boolean.
QSet< QString > asStringSet() const
Returns this config variable as a string set.
The Config class contains the configuration variables for controlling how qdoc produces documentation...
QStringList & includePaths()
static QString installDir
std::set< HeaderFilePath > getHeaderFiles()
static bool generateExamples
const QString & programName() const
QStringList & indexDirs()
void reset()
Resets the Config instance - used by load()
bool getAtomsDump() const
void clear()
Clears the location and internal maps for config variables.
void showHelp(int exitCode=0)
QString currentDir() const
PathFlags
Flags used for retrieving canonicalized paths from Config.
const Location & location() const
const ExcludedPaths & getExcludedPaths()
QSet< QString > getOutputFormats() const
Function to return the correct outputformats.
static void popWorkingDir()
Pop the top entry from the stack of working directories.
static QSet< QString > overrideOutputFormats
static QString overrideOutputDir
QStringList & dependModules()
void setQDocPass(const QDocPass &pass)
bool showInternal() const
QStringList getExampleImageFiles(const QSet< QString > &excludedDirs, const QSet< QString > &excludedFiles)
QStringList qdocFiles() const
QString previousCurrentDir() const
QStringList getExampleQdocFiles(const QSet< QString > &excludedDirs, const QSet< QString > &excludedFiles)
QString markedUpQmlItem(const Node *node, bool summary) override
QString markedUpName(const Node *node) override
Atom::AtomType atomType() const override
Returns the type of atom used to represent C++ code in the documentation.
QString markedUpSynopsis(const Node *node, const Node *relative, Section::Style style) override
~CppCodeMarker() override=default
CppCodeParser(FnCommandParser &&parser)
void processMetaCommands(const Doc &doc, Node *node)
The topic command has been processed, and now doc and node are passed to this function to get the met...
void generatePageNode(PageNode *pn)
Generate the DocBook page for an entity that doesn't map to any underlying parsable C++ or QML elemen...
void generateQmlTypePage(QmlTypeNode *qcn)
Generate the DocBook page for a QML type.
void generateAlsoList(const Node *node) override
void generateQmlRequisites(const QmlTypeNode *qcn)
Lists the required imports and includes.
void generateSortedQmlNames(const Node *base, const NodeList &subs)
void initializeGenerator() override
Initializes the DocBook output generator's data structures from the configuration (Config).
void generateExampleFilePage(const Node *en, ResolvedFile resolved_file, CodeMarker *=nullptr) override
Generate a file with the contents of a C++ or QML source file.
bool generateText(const Text &text, const Node *relative) override
Generate the documentation for relative.
void generateCppReferencePage(Node *node)
Generate a reference page for the C++ class, namespace, or header file documented in node.
DocBookGenerator(FileResolver &file_resolver)
bool generateThreadSafeness(const Node *node)
Generates text that explains how threadsafe and/or reentrant node is.
void generateCollectionNode(CollectionNode *cn)
Generate the HTML page for a group, module, or QML module.
QString format() override
void generateDocBookSynopsis(const Node *node)
Generate the metadata for the given node in DocBook.
void generateGenericCollectionPage(CollectionNode *cn)
Generate the HTML page for a generic collection.
void generateBody(const Node *node)
Generate the body of the documentation from the qdoc comment found with the entity represented by the...
qsizetype generateAtom(const Atom *atom, const Node *relative, CodeMarker *) override
Generate DocBook from an instance of Atom.
void generateProxyPage(Aggregate *aggregate)
bool generateStatus(const Node *node)
void generateRequisites(const Aggregate *inner)
Lists the required imports and includes.
void generateSortedNames(const ClassNode *cn, const QList< RelatedClass > &rc)
void generateDocumentation(Node *node) override
Recursive writing of DocBook files from the root node.
void generateGroupReferenceText(const Node *node)
Return a string representing a text that exposes information about the groups that the node is part o...
void generateAddendum(const Node *node, Generator::Addendum type, CodeMarker *marker, bool generateNote) override
Generates an addendum note of type type for node.
QString fileExtension() const override
Returns "xml" for this subclass of Generator.
bool generateSince(const Node *node)
QSet< QString > parameterNames() const
Text legaleseText() const
QList< Text > alsoList() const
const Location & location() const
Returns the starting location of a qdoc comment.
Doc & operator=(const Doc &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.
const QList< Atom * > & tableOfContents() const
static void quoteFromFile(const Location &location, Quoter "er, ResolvedFile resolved_file)
bool isInternal() const
Returns true if the set of metacommands used in the doc comment contains {internal}...
bool hasTableOfContents() const
const QList< Atom * > & keywords() const
const Text & body() const
static void initialize(FileResolver &file_resolver)
QStringList omitEnumItemNames() const
const QList< Atom * > & targets() const
QMultiMap< ComparisonCategory, Text > * comparesWithMap() const
const QList< int > & tableOfContentsLevels() const
Text trimmedBriefText(const QString &className) const
ArgList metaCommandArgs(const QString &metaCommand) const
Text briefText(bool inclusive=false) const
const Location & startLocation() const
Returns the starting location of a qdoc comment.
bool isMarkedReimp() const
Returns true if the set of metacommands used in the doc comment contains {reimp}.
static void trimCStyleComment(Location &location, QString &str)
Trims the deadwood out of str.
static void terminate()
All the heap allocated variables are deleted.
TopicList topicsUsed() const
Returns a reference to the list of topic commands used in the current qdoc comment.
QStringMultiMap * metaTagMap() const
QSet< QString > metaCommandsUsed() const
void constructExtra() const
const QString & source() const
QStringList enumItemNames() const
Encapsulate the logic that QDoc uses to find files whose path is provided by the user and that are re...
std::optional< ResolvedFile > resolve(QString filename) const
Returns a ResolvedFile if query can be resolved or std::nullopt otherwise.
FileResolver(std::vector< DirectoryPath > &&search_directories)
Constructs an instance of FileResolver with the directories in search_directories as root directories...
const std::vector< DirectoryPath > & get_search_directories() const
Returns a const-reference to a collection of root search directories that this instance will use duri...
This node is used to represent any kind of function being documented.
static QString outputSuffix(const Node *node)
void signatureList(const NodeList &nodes, const Node *relative, CodeMarker *marker)
Generate a bullet list of function signatures.
void appendSignature(Text &text, const Node *node)
Append the signature for the function named in node to text, so that is a link to the documentation f...
virtual void generateCollectionNode(CollectionNode *, CodeMarker *)
virtual void generateProxyPage(Aggregate *, CodeMarker *)
virtual void generateCppReferencePage(Aggregate *, CodeMarker *)
bool generateComparisonCategory(const Node *node, CodeMarker *marker=nullptr)
QMap< QString, QString > & formattingRightMap()
virtual void generateAddendum(const Node *node, Addendum type, CodeMarker *marker, bool generateNote)
Generates an addendum note of type type for node, using marker as the code marker.
virtual QString typeString(const Node *node)
virtual void generateExampleFilePage(const Node *, ResolvedFile, CodeMarker *=nullptr)
static bool hasExceptions(const Node *node, NodeList &reentrant, NodeList &threadsafe, NodeList &nonreentrant)
void generateEnumValuesForQmlProperty(const Node *node, CodeMarker *marker)
FileResolver & file_resolver
static void setQmlTypeContext(QmlTypeNode *t)
virtual bool generateText(const Text &text, const Node *relative)
static const QString & outputDir()
virtual void generateAlsoList(const Node *node)
static QString getOverloadedSignalCode(const Node *node)
Returns the string containing an example code of the input node, if it is an overloaded signal.
virtual void initializeFormat()
Reads format-specific variables from config, sets output (sub)directories, creates them on the filesy...
static QString formatSince(const Node *node)
virtual void generateDocumentation(Node *node)
Recursive writing of HTML files from the root node.
static QString defaultModuleName()
static QString trimmedTrailing(const QString &string, const QString &prefix, const QString &suffix)
Trims trailing whitespace off the string and returns the trimmed string.
virtual bool canHandleFormat(const QString &format)
const Atom * generateAtomList(const Atom *atom, const Node *relative, CodeMarker *marker, bool generate, int &numGeneratedAtoms)
virtual QString format()=0
void generateStatus(const Node *node, CodeMarker *marker)
virtual void generateAlsoList(const Node *node, CodeMarker *marker)
void appendFullName(Text &text, const Node *apparentNode, const Node *relative, const Node *actualNode=nullptr)
virtual void generateFileList(const ExampleNode *en, CodeMarker *marker, bool images)
This function is called when the documentation for an example is being formatted.
void generateThreadSafeness(const Node *node, CodeMarker *marker)
Generates text that explains how threadsafe and/or reentrant node is.
Generator(FileResolver &file_resolver)
Constructs the generator base class.
QString linkForExampleFile(const QString &path, const QString &fileExt=QString())
Constructs an href link from an example file name, which is a path to the example file.
void beginSubPage(const Node *node, const QString &fileName)
Creates the file named fileName in the output directory.
bool generateComparisonList(const Node *node)
Generates a list of types that compare to node with the comparison category that applies for the rela...
static std::optional< std::pair< QString, QString > > cmakeRequisite(const CollectionNode *cn)
Generate the CMake requisite for the node cn, i.e.
static bool useOutputSubdirs()
static bool noLinkErrors()
void generateNoexceptNote(const Node *node, CodeMarker *marker)
void unknownAtom(const Atom *atom)
static QString plainCode(const QString &markedCode)
virtual bool generateText(const Text &text, const Node *relative, CodeMarker *marker)
Generate the documentation for relative.
static QString cleanRef(const QString &ref, bool xmlCompliant=false)
Clean the given ref to be used as an HTML anchor or an xml:id.
void generateLinkToExample(const ExampleNode *en, CodeMarker *marker, const QString &exampleUrl)
Generates an external link to the project folder for example node.
virtual void terminateGenerator()
QStack< QTextStream * > outStreamStack
static bool matchAhead(const Atom *atom, Atom::AtomType expectedAtomType)
static bool comparePaths(const QString &a, const QString &b)
QString fullDocumentLocation(const Node *node)
Returns the full document location.
static QmlTypeNode * qmlTypeContext()
void addImageToCopy(const ExampleNode *en, const ResolvedFile &resolved_file)
virtual void generateDocs()
Traverses the database recursively to generate all the documentation.
int appendSortedQmlNames(Text &text, const Node *base, const NodeList &subs)
void generateOverloadedSignal(const Node *node, CodeMarker *marker)
If the node is an overloaded signal, add a node with an example on how to connect to it.
static Generator * generatorForFormat(const QString &format)
static bool appendTrademark(const Atom *atom)
Returns true if a trademark symbol should be appended to the output as determined by atom.
virtual int skipAtoms(const Atom *atom, Atom::AtomType type) const
bool m_threeColumnEnumValueTable
virtual void generateQmlTypePage(QmlTypeNode *, CodeMarker *)
void appendFullName(Text &text, const Node *apparentNode, const QString &fullName, const Node *actualNode)
static const QStringList & outputFileNames()
virtual void generateBody(const Node *node, CodeMarker *marker)
Generate the body of the documentation from the qdoc comment found with the entity represented by the...
static QFile * openSubPageFile(const PageNode *node, const QString &fileName)
Creates the file named fileName in the output directory and returns a QFile pointing to this file.
virtual void generatePageNode(PageNode *, CodeMarker *)
virtual ~Generator()
Destroys the generator after removing it from the list of output generators.
void generateSince(const Node *node, CodeMarker *marker)
QMap< QString, QString > & formattingLeftMap()
int appendSortedNames(Text &text, const ClassNode *classe, const QList< RelatedClass > &classes)
static QString exampleFileTitle(const ExampleNode *relative, const QString &fileName)
Helper function to construct a title for a file or image page included in an example.
void endSubPage()
Flush the text stream associated with the subpage, and then pop it off the text stream stack and dele...
virtual void generateAddendum(const Node *node, Addendum type, CodeMarker *marker)
QString indent(int level, const QString &markedCode)
QString fileName(const Node *node, const QString &extension=QString()) const
If the node has a URL, return the URL as the file name.
static void resetUseOutputSubdirs()
static QString outputPrefix(const Node *node)
static bool autolinkErrors()
static const QString & outputSubdir()
bool parseArg(const QString &src, const QString &tag, int *pos, int n, QStringView *contents, QStringView *par1=nullptr)
virtual void generateGenericCollectionPage(CollectionNode *, CodeMarker *)
virtual QString fileBase(const Node *node) const
static void supplementAlsoList(const Node *node, QList< Text > &alsoList)
virtual void initializeGenerator()
Updates the generator's m_showInternal from the Config.
virtual QString fileExtension() const =0
void initializeTextOutput()
Resets the variables used during text output.
static Qt::SortOrder sortOrder(const QString &str)
void generateRequiredLinks(const Node *node, CodeMarker *marker)
Generates either a link to the project folder for example node, or a list of links files/images if 'u...
static Generator * currentGenerator()
virtual qsizetype generateAtom(const Atom *, const Node *, CodeMarker *)
HtmlGenerator(FileResolver &file_resolver)
~LinkAtom() override=default
QString m_squareBracketParams
Node::Genus genus() override
LinkAtom(const LinkAtom &t)
Standard copy constructor of LinkAtom t.
LinkAtom(Atom *previous, const LinkAtom &t)
Special copy constructor of LinkAtom t, where where the new LinkAtom will not be the first one in the...
void resolveSquareBracketParams() override
This function resolves the parameters that were enclosed in square brackets.
bool isLinkAtom() const override
The Location class provides a way to mark a location in a file.
QString fileName() const
Returns the file name part of the file path, ie the current file.
void fatal(const QString &message, const QString &details=QString()) const
Writes message and details to stderr as a formatted error message and then exits the program.
QString fileSuffix() const
Returns the suffix of the file name.
const QString & filePath() const
Returns the current path and file name.
Location(const Location &other)
The copy constructor copies the contents of other into this Location using the assignment operator.
void error(const QString &message, const QString &details=QString()) const
Writes message and details to stderr as a formatted error message.
int lineNo() const
Returns the current line number.
static int exitCode()
Returns the error code QDoc should exit with; EXIT_SUCCESS or the number of documentation warnings if...
void report(const QString &message, const QString &details=QString()) const
Writes message and details to stderr as a formatted report message.
QString toString() const
Converts the location to a string to be prepended to error messages.
int columnNo() const
Returns the current column number.
static void initialize()
Gets several parameters from the config, including tab size, program name, and a regular expression t...
Location()
Constructs an empty location.
static void information(const QString &message)
Prints message to stdout followed by a {' '}.
void push(const QString &filePath)
Pushes filePath onto the file position stack.
static void internalError(const QString &hint)
Report a program bug, including the hint.
void start()
If the file position on top of the stack has a line number less than 1, set its line number to 1 and ...
void warning(const QString &message, const QString &details=QString()) const
Writes message and details to stderr as a formatted warning message.
void advance(QChar ch)
Advance the current file position, using ch to decide how to do that.
Location & operator=(const Location &other)
The assignment operator does a deep copy of the entire state of other into this Location.
bool isEmpty() const
Returns true if there is no file name set yet; returns false otherwise.
static void terminate()
Apparently, all this does is delete the regular expression used for intercepting certain error messag...
void pop()
Pops the top of the internal stack.
Location(const QString &filePath)
Constructs a location with (fileName, 1, 1) on its file position stack.
This class represents a C++ namespace.
Tree * tree() const override
Returns a pointer to the Tree that contains this NamespaceNode.
void markInternal()
Sets the node's access to Private and its status to Internal.
virtual void setLogicalModuleInfo(const QStringList &)
If this node is a CollectionNode, this function splits arg on the blank character to get a logical mo...
bool isGenericCollection() const
Returns true if the node type is Collection.
bool isExternalPage() const
Returns true if the node type is ExternalPage.
bool isDontDocument() const
Returns true if this node's status is DontDocument.
QString plainName() const
Returns this node's name member.
const Doc & doc() const
Returns a reference to the node's Doc data member.
virtual bool setTitle(const QString &)
Sets the node's title, which is used for the title of the documentation page, if one is generated for...
bool isQmlNode() const
Returns true if this node's Genus value is QML.
virtual void appendGroupName(const QString &)
virtual bool isStatic() const
Returns true if the FunctionNode represents a static function.
virtual QString logicalModuleIdentifier() const
If this is a CollectionNode, this function returns the logical module identifier.
void setUrl(const QString &url)
Sets the node's URL to url, which is the url to the page that the node represents.
virtual bool hasClasses() const
Returns true if this is a CollectionNode and its members list contains class nodes.
virtual bool hasNamespaces() const
Returns true if this is a CollectionNode and its members list contains namespace nodes.
bool isGroup() const
Returns true if the node type is Group.
const QString & reconstitutedBrief() const
virtual bool docMustBeGenerated() const
This function is called to perform a test to decide if the node must have documentation generated.
virtual bool isWrapper() const
Returns true if the node is a class node or a QML type node that is marked as being a wrapper class o...
bool isPrivate() const
Returns true if this node's access is Private.
virtual QString signature(Node::SignatureOptions) const
void Node::setGenus(Genus t) Sets this node's Genus to t.
bool isActive() const
Returns true if this node's status is Active.
void setAccess(Access t)
Sets the node's access type to t.
const Location & defLocation() const
Returns the Location where this node's dedefinition was seen.
void setIndexNodeFlag(bool isIndexNode=true)
Sets a flag in this Node that indicates the node was created for something in an index file.
QString fullName(const Node *relative=nullptr) const
Constructs and returns this node's full name.
virtual void setQmlModule(CollectionNode *)
If this is a QmlTypeNode, this function sets the QML type's QML module pointer to the CollectionNode ...
virtual QString qmlTypeName() const
If this is a QmlPropertyNode or a FunctionNode representing a QML method, this function returns the q...
virtual bool isAbstract() const
Returns true if the ClassNode or QmlTypeNode is marked abstract.
NodeType
An unsigned char value that identifies an object as a particular subclass of Node.
SharedCommentNode * sharedCommentNode()
bool isNamespace() const
Returns true if the node type is Namespace.
bool isTypedef() const
Returns true if the node type is Typedef.
bool isQmlBasicType() const
Returns true if the node type is QmlBasicType.
virtual QString logicalModuleVersion() const
If this is a CollectionNode, this function returns the logical module version number.
QString nodeTypeString() const
Returns this node's type as a string for use as an attribute value in XML or HTML.
ComparisonCategory comparisonCategory() const
virtual void addMember(Node *)
In a CollectionNode, this function adds node to the collection node's members list.
bool hasFileNameBase() const
Returns true if the node's file name base has been set.
bool isPage() const
Returns true if the node type is Page.
virtual QString qmlFullBaseName() const
If this is a QmlTypeNode, this function returns the QML full base name.
bool isFunction(Genus g=DontCare) const
Returns true if this is a FunctionNode and its Genus is set to g.
bool isQmlType() const
Returns true if the node type is QmlType or QmlValueType.
bool isSharedCommentNode() const
Returns true if the node type is SharedComment.
QString physicalModuleName() const
virtual void setCMakePackage(const QString &)
virtual void setDataType(const QString &)
If this node is a PropertyNode or a QmlPropertyNode, its data type data member is set to dataType.
virtual bool isInternal() const
Returns true if the node's status is Internal, or if its parent is a class with Internal status.
bool isHeader() const
Returns true if the node type is HeaderFile.
virtual bool isPageNode() const
Returns true if this node represents something that generates a documentation page.
void setFileNameBase(const QString &t)
Sets the node's file name base to t.
virtual bool isMacro() const
returns true if either FunctionNode::isMacroWithParams() or FunctionNode::isMacroWithoutParams() retu...
virtual bool isDefault() const
Returns true if the QML property node is marked as default.
bool isEnumType() const
Returns true if the node type is Enum.
bool isStruct() const
Returns true if the node type is Struct.
virtual bool isTextPageNode() const
Returns true if the node is a PageNode but not an Aggregate.
virtual bool isAttached() const
Returns true if the QML property or QML method node is marked as attached.
Aggregate * parent() const
Returns the node's parent pointer.
static bool fromFlagValue(FlagValue fv, bool defaultValue)
Converts the enum fv back to a boolean value.
bool isPublic() const
Returns true if this node's access is Public.
bool isVariable() const
Returns true if the node type is Variable.
void setLocation(const Location &t)
Sets the node's declaration location, its definition location, or both, depending on the suffix of th...
virtual void setClassNode(ClassNode *)
If this is a QmlTypeNode, this function sets the C++ class node to cn.
virtual ~Node()=default
The default destructor is virtual so any subclass of Node can be deleted by deleting a pointer to Nod...
QString plainFullName(const Node *relative=nullptr) const
Constructs and returns the node's fully qualified name by recursively ascending the parent links and ...
virtual bool isDeprecated() const
Returns true if this node's status is Deprecated.
virtual bool isAggregate() const
Returns true if this node is an aggregate, which means it inherits Aggregate and can therefore have c...
NodeType nodeType() const
Returns this node's type.
FlagValue
A value used in PropertyNode and QmlPropertyNode that can be -1, 0, or +1.
QString qualifyQmlName()
Returns the QML node's qualified name by prepending the logical module name.
void setSharedCommentNode(SharedCommentNode *t)
void setTemplateDecl(std::optional< RelaxedTemplateDeclaration > t)
virtual void setRelatedNonmember(bool b)
Sets a flag in the node indicating whether this node is a related nonmember of something.
virtual Node * clone(Aggregate *)
When reimplemented in a subclass, this function creates a clone of this node on the heap and makes th...
virtual void markReadOnly(bool)
If this node is a QmlPropertyNode, then the property's read-only flag is set to flag.
void setComparisonCategory(const ComparisonCategory &category)
static bool nodeNameLessThan(const Node *first, const Node *second)
Returns true if the node n1 is less than node n2.
QString qualifyCppName()
Returns the CPP node's qualified name by prepending the namespaces name + "::" if there isw a namespa...
ThreadSafeness inheritedThreadSafeness() const
If this node has a parent, the parent's thread safeness value is returned.
const Location & location() const
If this node's definition location is empty, this function returns this node's declaration location.
bool isProxyNode() const
Returns true if the node type is Proxy.
virtual bool wasSeen() const
Returns the seen flag data member of this node if it is a NamespaceNode or a CollectionNode.
const std::optional< RelaxedTemplateDeclaration > & templateDecl() const
Access access() const
Returns the node's Access setting, which can be Public, Protected, or Private.
virtual void setWrapper()
If this node is a ClassNode or a QmlTypeNode, the node's wrapper flag data member is set to true.
virtual QString cmakeComponent() const
virtual void markDefault()
If this node is a QmlPropertyNode, it is marked as the default property.
ThreadSafeness threadSafeness() const
Returns the thread safeness value for whatever this node represents.
virtual QString qtVariable() const
If this node is a CollectionNode, its QT variable is returned.
Genus
An unsigned char value that specifies whether the Node represents a C++ element, a QML element,...
virtual QString logicalModuleName() const
If this is a CollectionNode, this function returns the logical module name.
virtual bool isFirstClassAggregate() const
Returns true if this Node is an Aggregate but not a ProxyNode.
virtual bool isMarkedReimp() const
Returns true if the FunctionNode is marked as a reimplemented function.
bool isProperty() const
Returns true if the node type is Property.
virtual QString cmakePackage() const
QString fullDocumentName() const
Construct the full document name for this node and return it.
QString url() const
Returns the node's URL, which is the url of the documentation page created for the node or the url of...
bool isTypeAlias() const
Returns true if the node type is Typedef.
virtual Tree * tree() const
Returns a pointer to the Tree this node is in.
const Location & declLocation() const
Returns the Location where this node's declaration was seen.
void setDoc(const Doc &doc, bool replace=false)
Sets this Node's Doc to doc.
virtual QString title() const
Returns a string that can be used to print a title in the documentation for whatever this Node is.
virtual void setCMakeComponent(const QString &)
virtual bool setSubtitle(const QString &)
Sets the node's subtitle, which is used for the subtitle of the documentation page,...
bool isModule() const
Returns true if the node type is Module.
virtual bool isAlias() const
Returns true if this QML property is marked as an alias.
virtual QString element() const
If this node is a QmlPropertyNode or a FunctionNode, this function returns the name of the parent nod...
virtual QString subtitle() const
Returns a string that can be used to print a subtitle in the documentation for whatever this Node is.
Node(NodeType type, Aggregate *parent, QString name)
Construct a node with the given type and having the given parent and name.
virtual ClassNode * classNode()
If this is a QmlTypeNode, this function returns the pointer to the C++ ClassNode that this QML type r...
bool isClass() const
Returns true if the node type is Class.
const QString & fileNameBase() const
Returns the node's file name base string, which is built once, when Generator::fileBase() is called a...
virtual bool isPropertyGroup() const
Returns true if the node is a SharedCommentNode for documenting multiple C++ properties or multiple Q...
Genus genus() const
Returns this node's Genus.
ThreadSafeness
An unsigned char that specifies the degree of thread-safeness of the element.
virtual QString fullTitle() const
Returns a string that can be used as the full title for the documentation of this node.
static QString nodeTypeString(NodeType t)
Returns the node type t as a string for use as an attribute value in XML or HTML.
bool isSharingComment() const
This function returns true if the node is sharing a comment with other nodes.
virtual void setCMakeTargetItem(const QString &)
virtual CollectionNode * logicalModule() const
If this is a QmlTypeNode, a pointer to its QML module is returned, which is a pointer to a Collection...
QString since() const
Returns the node's since string, which can be empty.
virtual void setAbstract(bool)
If this node is a ClassNode or a QmlTypeNode, the node's abstract flag data member is set to b.
bool hasDoc() const
Returns true if this node is documented, or it represents a documented node read from the index ('had...
void setParent(Aggregate *n)
Sets the node's parent pointer to n.
bool isPreliminary() const
Returns true if this node's status is Preliminary.
static FlagValue toFlagValue(bool b)
Converts the boolean value b to an enum representation of the boolean type, which includes an enum va...
void setReconstitutedBrief(const QString &t)
When reading an index file, this function is called with the reconstituted brief clause t to set the ...
LinkType
An unsigned char value that probably should be moved out of the Node base class.
virtual bool hasTag(const QString &) const
If this node is a FunctionNode, the function returns true if the function has the tag t.
virtual QString cmakeTargetItem() const
bool isRelatedNonmember() const
Returns true if this is a related nonmember of something.
void setSince(const QString &since)
Sets the information about the project and version a node was introduced in, unless the version is lo...
virtual bool isClassNode() const
Returns true if this is an instance of ClassNode.
bool isCppNode() const
Returns true if this node's Genus value is CPP.
void setStatus(Status t)
Sets the node's status to t.
QString extractClassName(const QString &string) const
Extract a class name from the type string and return it.
void setDeprecated(const QString &sinceVersion)
Sets the Node status to Node::Deprecated, unless sinceVersion represents a future version.
virtual bool isRelatableType() const
Returns true if this node is something you can relate things to with the relates command.
virtual bool isCollectionNode() const
Returns true if this is an instance of CollectionNode.
static bool nodeSortKeyOrNameLessThan(const Node *n1, const Node *n2)
Returns true if node n1 is less than node n2 when comparing the sort keys, defined with.
void setThreadSafeness(ThreadSafeness t)
Sets the node's thread safeness to t.
void setPhysicalModuleName(const QString &name)
Sets the node's physical module name.
Status
An unsigned char that specifies the status of the documentation element in the documentation set.
bool isQmlModule() const
Returns true if the node type is QmlModule.
@ SignatureTemplateParams
bool isProtected() const
Returns true if this node's access is Protected.
bool isExample() const
Returns true if the node type is Example.
QString qualifyWithParentName()
Return the name of this node qualified with the parent name and "::" if there is a parent name.
bool isIndexNode() const
Returns true if this node was created from something in an index file.
QString plainSignature() const
Constructs and returns the node's fully qualified signature by recursively ascending the parent links...
Status status() const
Returns the node's status value.
bool isUnion() const
Returns true if the node type is Union.
const QString & deprecatedSince() const
bool isQmlProperty() const
Returns true if the node type is QmlProperty.
virtual void setQtVariable(const QString &)
If this node is a CollectionNode, its QT variable is set to v.
const QString & name() const
Returns the node's name data member.
static Genus getGenus(NodeType t)
Determines the appropriate Genus value for the NodeType value t and returns that Genus value.
A PageNode is a Node that generates a documentation page.
The Parameter class describes one function parameter.
const QString & type() const
void set(const QString &type, const QString &name, const QString &defaultValue=QString())
const QString & name() const
void setDefaultValue(const QString &t)
Parameter(QString type, QString name=QString(), QString defaultValue=QString())
QString signature(bool includeValue=false) const
Reconstructs the text signature for the parameter and returns it.
void setCanonicalType(const QString &t)
void setName(const QString &name)
const QString & canonicalType() const
const QString & defaultValue() const
A class for parsing and managing a function parameter list.
Parameter & operator[](int index)
const ParameterVector & parameters() const
void append(const QString &type)
QSet< QString > getNames() const
Insert all the parameter names into names.
bool match(const Parameters ¶meters) const
Returns true if parameters contains the same parameter signature as this.
Parameters(const QString &signature)
QString rawSignature(bool names=false, bool values=false) const
Returns the signature of all the parameters with all the spaces and commas removed.
QString generateTypeList() const
Construct a list of the parameter types and return it.
bool isPrivateSignal() const
const Parameter & at(int i) const
void append(const QString &type, const QString &name)
QString signature(bool includeValues=false) const
Returns the list of reconstructed parameters.
const Parameter & last() const
QString generateTypeAndNameList() const
Construct a list of the parameter type/name pairs and return it.
void append(const QString &type, const QString &name, const QString &value)
Append a Parameter constructed from type, name, and value to the parameter vector.
void set(const QString &signature)
Parse the parameter signature by splitting the string, and store the individual parameters in the par...
This class describes one instance of using the Q_PROPERTY macro.
PureDocParser(const Location &location)
This class provides exclusive access to the qdoc database, which consists of a forrest of trees and a...
static void destroyQdocDB()
Destroys the singleton.
static QDocDatabase * qdocDB()
Creates the singleton.
NamespaceNode * primaryTreeRoot()
Returns a pointer to the root node of the primary tree.
void processForest()
This function calls a set of functions for each tree in the forest that has not already been analyzed...
void resolveStuff()
Performs several housekeeping tasks prior to generating the documentation.
static void terminate()
Clear the static maps so that subsequent runs don't try to use contents from a previous run.
A class for containing the elements of one documentation section.
const QString & singular() const
void clear()
A Section is now an element in a static vector, so we don't have to repeatedly construct and destroy ...
void setAggregate(Aggregate *t)
const NodeVector & obsoleteMembers() const
void appendMembers(const NodeVector &nv)
void insert(Node *node)
Inserts the node into this section if it is appropriate for this section.
void reduce()
If this section is not empty, convert its maps to sequential structures for better traversal during d...
ClassNodesList & classNodesList()
const Aggregate * aggregate() const
const NodeVector & reimplementedMembers() const
const QString & title() const
const QString & plural() const
const QList< std::pair< Aggregate *, int > > & inheritedMembers() const
void appendMember(Node *node)
bool insertReimplementedMember(Node *node)
Returns true if the node is a reimplemented member function of the current class.
const QString & divClass() const
~Section()
The destructor must delete the members of collections when the members are allocated on the heap.
const NodeVector & members() const
A class for creating vectors of collections for documentation.
Aggregate * aggregate() const
const SectionVector & stdCppClassDetailsSections() const
void buildStdCppClassRefPageSections()
Build the section vectors for a standard reference page, when the aggregate node is a C++.
Sections(Aggregate *aggregate)
This constructor builds the vectors of sections based on the type of the aggregate node.
SectionVector & stdCppClassSummarySections()
SectionVector & stdQmlTypeSummarySections()
~Sections()
The behavior of the destructor depends on the type of the Aggregate node that was passed to the const...
SectionVector & stdDetailsSections()
const SectionVector & stdQmlTypeDetailsSections() const
const SectionVector & stdCppClassSummarySections() const
const SectionVector & stdQmlTypeSummarySections() const
void buildStdRefPageSections()
Build the section vectors for a standard reference page, when the aggregate node is not a C++ class o...
void clear(SectionVector &v)
Reset each Section in vector v to its initialized state.
SectionVector & stdCppClassDetailsSections()
void reduce(SectionVector &v)
Linearize the maps in each Section in v.
const SectionVector & stdDetailsSections() const
void buildStdQmlTypeRefPageSections()
Build the section vectors for a standard reference page, when the aggregate node is a QML type.
SectionVector & stdQmlTypeDetailsSections()
SectionVector & sinceSections()
@ SinceNamespaceFunctions
@ DetailsRelatedNonmembers
Sections(const NodeMultiMap &nsmap)
This constructor builds a vector of sections from the since node map, nsmap.
bool hasObsoleteMembers(SectionPtrVector *summary_spv, SectionPtrVector *details_spv) const
Returns true if any sections in this object contain obsolete members.
SectionVector & stdSummarySections()
const SectionVector & stdSummarySections() const
static Section & allMembersSection()
SourceFileParser(ClangCodeParser &clang_parser, PureDocParser &pure_parser)
static Text subText(const Atom *begin, const Atom *end=nullptr)
static Text sectionHeading(const Atom *sectionBegin)
void dump() const
Prints a human-readable version of the contained atoms to stderr.
const Atom * firstAtom() const
Text splitAtFirst(Atom::AtomType start)
Splits the current Text from start to end into a new Text object.
Text subText(Atom::AtomType left, Atom::AtomType right, const Atom *from=nullptr, bool inclusive=false) const
Text & operator=(const Text &text)
const Atom * lastAtom() const
QString toString() const
This function traverses the atom list of the Text object, extracting all the string parts.
static int compare(const Text &text1, const Text &text2)
static void terminate()
The heap allocated variables are freed here.
This class constructs and maintains a tree of instances of the subclasses of Node.
WebXMLGenerator(FileResolver &file_resolver)
std::pair< QString, QString > anchorForNode(const Node *node)
static bool isThreeColumnEnumValueTable(const Atom *atom)
Determines whether the list atom should be shown with three columns (constant-value-description).
QString getLink(const Atom *atom, const Node *relative, const Node **node)
This function is called for links, i.e.
static Node::NodeType typeFromString(const Atom *atom)
Returns the type of this atom as an enumeration.
QString refForNode(const Node *node)
Generates a clean and unique reference for the given node.
QHash< QString, QString > refMap
static bool isOneColumnValueTable(const Atom *atom)
Determines whether the list atom should be shown with just one column (value).
static QString targetType(const Node *node)
Returns a string describing the node type.
QString linkForNode(const Node *node, const Node *relative)
Construct the link string for the node and return it.
static void setImageFileName(const Node *relative, const QString &fileName)
For images shown in examples, set the image file to the one it will have once the documentation is ge...
static void rewritePropertyBrief(const Atom *atom, const Node *relative)
Rewrites the brief of this node depending on its first word.
static int hOffset(const Node *node)
Header offset depending on the type of the node.
static bool hasBrief(const Node *node)
Do not display.
XmlGenerator(FileResolver &file_resolver)
QString getAutoLink(const Atom *atom, const Node *relative, const Node **node, Node::Genus=Node::DontCare)
This function is called for autolinks, i.e.
static std::pair< QString, int > getAtomListValue(const Atom *atom)
Handles the differences in lists between list tags and since tags, and returns the content of the lis...
static const QRegularExpression m_funcLeftParen
QString registerRef(const QString &ref, bool xmlCompliant=false)
Registers an anchor reference and returns a unique and cleaned copy of the reference (the one that sh...
static std::pair< QString, QString > getTableWidthAttr(const Atom *atom)
Parses the table attributes from the given atom.
#define COMMAND_QMLINHERITS
#define COMMAND_MODULESTATE
#define COMMAND_NONREENTRANT
#define COMMAND_DEPRECATED
#define COMMAND_PRELIMINARY
#define COMMAND_CMAKETARGETITEM
#define COMMAND_REENTRANT
#define COMMAND_STARTPAGE
#define COMMAND_QMLDEFAULT
#define COMMAND_QMLABSTRACT
#define COMMAND_QTVARIABLE
#define COMMAND_QTCMAKEPACKAGE
#define COMMAND_NOAUTOLIST
#define COMMAND_QTCMAKETARGETITEM
#define COMMAND_THREADSAFE
#define COMMAND_CMAKECOMPONENT
#define COMMAND_QMLREADONLY
#define COMMAND_QMLENUMERATORSFROM
#define COMMAND_INPUBLICGROUP
#define COMMAND_QMLREQUIRED
#define COMMAND_ATTRIBUTION
#define COMMAND_INQMLMODULE
#define COMMAND_CMAKEPACKAGE
static std::string comparisonCategoryAsString(ComparisonCategory category)
static ComparisonCategory comparisonCategoryFromString(const std::string &string)
#define CONFIG_SINGLEEXEC
#define CONFIG_EXAMPLEDIRS
QMap< QString, ConfigVar > ConfigVarMap
#define CONFIG_NOLINKERRORS
#define CONFIG_LOGPROGRESS
#define CONFIG_SOURCEDIRS
#define CONFIG_DOCUMENTATIONINHEADERS
#define CONFIG_NAVIGATION
#define CONFIG_LANDINGPAGE
#define CONFIG_OUTPUTFORMATS
#define CONFIG_LANDINGTITLE
#define CONFIG_MODULEHEADER
#define CONFIG_HEADERDIRS
#define CONFIG_INCLUDEPATHS
Q_DECLARE_TYPEINFO(Doc, Q_RELOCATABLE_TYPE)
std::pair< QString, QString > ArgPair
QMultiMap< QString, QString > QStringMultiMap
QHash< QString, Macro > QHash_QString_Macro
QT_BEGIN_NAMESPACE typedef QHash< QString, int > QHash_QString_int
Q_DECLARE_TYPEINFO(Location, Q_COMPLEX_TYPE)
Q_DECLARE_TYPEINFO(Location::StackEntry, Q_RELOCATABLE_TYPE)
Combined button and popup list for selecting options.
This namespace holds QDoc-internal utility methods.
QString comma(qsizetype wordPosition, qsizetype numberOfWords)
QString separator(qsizetype wordPosition, qsizetype numberOfWords)
QMultiMap< QString, CollectionNode * > CNMultiMap
QList< ClassNode * > ClassList
QList< Node * > NodeVector
QMap< QString, NodeMultiMap > NodeMultiMapMap
QMap< QString, Node * > NodeMap
QMap< QString, NodeMap > NodeMapMap
QMap< QString, CollectionNode * > CNMap
QMultiMap< QString, Node * > NodeMultiMap
QList< Parameter > ParameterVector
static void parseSourceFiles(std::vector< QString > &&sources, SourceFileParser &source_file_parser, CppCodeParser &cpp_code_parser)
static void singleExecutionMode()
void logStartEndMessage(const QLatin1String &startStop, Config &config)
static void processQdocconfFile(const QString &fileName)
Processes the qdoc config file fileName.
static void clearModuleDependenciesAndProcessQdocconfFile(const QStringList &qdocFiles)
static void dualExecutionMode()
bool creationTimeBefore(const QFileInfo &fi1, const QFileInfo &fi2)
static void loadIndexFiles(const QSet< QString > &formats)
Read some XML indexes containing definitions from other documentation sets.
#define QDOC_REFINED_TYPEDEF(_type, _name)
\macro QDOC_REFINED_TYPEDEF(_type, _name)
std::pair< const QmlTypeNode *, NodeVector > ClassNodes
QList< const Section * > SectionPtrVector
QList< Section > SectionVector
QList< ClassNodes > ClassNodesList
static QString AUTOLINKERRORS
static QString HEADERSTYLES
static QString IGNORESINCE
static QString CODESUFFIX
static QString EXAMPLEDIRS
static QString CODEINDENT
static QString HEADERDIRS
static QString NATURALLANGUAGE
static QString WARNABOUTMISSINGPROJECTFILES
static QString SINGLEEXEC
static QString SOURCEDIRS
static QString IGNOREDIRECTIVES
static QString EXCLUDEDIRS
static QString FILEEXTENSIONS
static QString OUTPUTFORMATS
static QString REDIRECTDOCUMENTATIONTODEVNULL
static QString LANDINGPAGE
static QString MODULEHEADER
static QString CPPCLASSESPAGE
static QString PRODUCTNAME
static QString BUILDVERSION
static QString DOCBOOKEXTENSIONS
static QString VERSIONSYM
static QString IMAGEEXTENSIONS
static QString EXAMPLESINSTALLPATH
static QString HEADERSCRIPTS
static QString SOURCEENCODING
static QString IGNORETOKENS
static QString NAVIGATION
static QString SYNTAXHIGHLIGHTING
static QString IGNOREWORDS
static QString INCLUDEPATHS
static QString WARNINGLIMIT
static QString STYLESHEETS
static QString LANDINGTITLE
static QString CODEPREFIX
static QString LOGPROGRESS
static QString FALSEHOODS
static QString TRADEMARKSPAGE
static QString QMLTYPESPAGE
static QString EXCLUDEFILES
static QString EXTRAIMAGES
static QString NOLINKERRORS
static QString LOCATIONINFO
static QString TIMESTAMPS
static QString WARNABOUTMISSINGIMAGES
static QString DOCUMENTATIONINHEADERS
static QString SHOWINTERNAL
static QString CPPCLASSESTITLE
static QString QUOTINGINFORMATION
static QString FORMATTING
static QString MANIFESTMETA
static QString OUTPUTPREFIXES
static QString DESCRIPTION
static QString OUTPUTSUFFIXES
static QString QMLTYPESTITLE
QSet< QString > excluded_directories
QSet< QString > excluded_files
QHash_QString_Macro macroHash
QHash_QString_int cmdHash
FnCommandParser(QDocDatabase *qdb, const std::set< Config::HeaderFilePath > &all_headers, const QList< QByteArray > &defines, std::optional< std::reference_wrapper< const PCHFile > > pch)
std::variant< Node *, FnMatchError > operator()(const Location &location, const QString &fnSignature, const QString &idTag, QStringList context)
Use clang to parse the function signature from a function command.
Encapsulates information about.
ImportRec(QString name, QString version, QString importUri, QStringView importId)
QString m_majorMinorVersion
Simple structure used by the Doc and DocParser classes.
Location m_defaultDefLocation
QMap< QString, QString > m_otherDefs
Processes parser errors and outputs warnings for them.
void operator()(const FnMatchError &e) const
Generates a warning specific to FnMatchError.
QCommandLineOption noExamplesOption
QCommandLineOption redirectDocumentationToDevNullOption
QCommandLineOption outputFormatOption
QCommandLineOption prepareOption
QCommandLineOption showInternalOption
QCommandLineOption singleExecOption
QCommandLineOption useDocBookExtensions
QCommandLineOption autoLinkErrorsOption
QCommandLineOption highlightingOption
QCommandLineOption outputDirOption
QCommandLineOption atomsDumpOption
QCommandLineOption installDirOption
QCommandLineOption debugOption
QCommandLineOption timestampsOption
QCommandLineOption dependsOption
QCommandLineOption logProgressOption
QCommandLineOption indexDirOption
QCommandLineOption noLinkErrorsOption
QCommandLineOption includePathSystemOption
void process(const QStringList &arguments)
QCommandLineOption generateOption
QCommandLineOption includePathOption
QCommandLineOption frameworkOption
QCommandLineOption defineOption
QString to_qstring() const
ValuedDeclaration valued_declaration
std::optional< TemplateDeclarationStorage > template_declaration
std::string to_std_string() const
@ NonTypeTemplateParameter
@ TemplateTemplateParameter
Represents a file that is reachable by QDoc based on its current configuration.
const QString & get_path() const
Returns a string representing the canonicalized path to the file that was resolved.
ResolvedFile(QString query, FilePath filepath)
Constructs an instance of this type from query and filepath.
const QString & get_query() const
Returns a string representing the user-inputted path that was used to resolve the file.
std::vector< RelaxedTemplateParameter > parameters
std::string to_std_string() const
Topic(QString &t, QString a)
std::string to_std_string(PrintingPolicy policy=default_printing_policy()) const
static PrintingPolicy default_printing_policy()
bool are_template_declarations_substitutable(const TemplateDeclarationStorage &left, const TemplateDeclarationStorage &right)
bool operator!=(const Text &text1, const Text &text2)
bool operator>=(const Text &text1, const Text &text2)
bool operator<=(const Text &text1, const Text &text2)
bool operator>(const Text &text1, const Text &text2)
bool operator==(const Text &text1, const Text &text2)
bool operator<(const Text &text1, const Text &text2)