4#ifndef WEBXMLGENERATOR_H
5#define WEBXMLGENERATOR_H
11#include <QtCore/qscopedpointer.h>
12#include <QtCore/qxmlstream.h>
27 void append(QXmlStreamWriter &writer,
Node *node)
override;
42 void generateAnnotatedList(QXmlStreamWriter &writer,
const Node *relative,
44 void generateAnnotatedList(QXmlStreamWriter &writer,
const Node *relative,
46 void generateRelations(QXmlStreamWriter &writer,
const Node *node);
47 void startLink(QXmlStreamWriter &writer,
const Atom *atom,
const Node *node,
49 void endLink(QXmlStreamWriter &writer);
52 bool m_hasQuotingInformation {
false };
53 QString quoteCommand {};
54 QScopedPointer<QXmlStreamWriter> currentWriter {};
55 bool m_supplement {
false };
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
void appendToRelatedByProxy(const NodeList &t)
Appends the list of node pointers to the list of elements that are related to this Aggregate but are ...
qsizetype count() const
Returns the number of children in the child list.
void resolveRelates()
Adopts each non-aggregate C++ node (function/macro, typedef, enum, variable, or a shared comment node...
void adoptChild(Node *child)
This Aggregate becomes the adoptive parent of child.
QString typeWord(bool cap) const
Returns a word representing the kind of Aggregate this node is.
void resolveQmlInheritance()
Resolves the inheritance information for all QML type children of this aggregate.
virtual QmlTypeNode * qmlBaseNode() const
If this Aggregate is a QmlTypeNode, this function returns a pointer to the QmlTypeNode that is its ba...
bool hasOverloads(const FunctionNode *fn) const
Returns true if this aggregate has multiple function overloads matching the name of fn.
NodeList::ConstIterator constBegin() const
Returns a const iterator pointing at the beginning of the child list.
void findAllObsoleteThings()
Finds all the obsolete C++ classes and QML types in this aggregate and all the C++ classes and QML ty...
~Aggregate() override
Destroys this Aggregate; deletes each child.
bool hasObsoleteMembers() const
Returns true if this aggregate contains at least one child that is marked obsolete.
FunctionMap & functionMap()
Returns a reference to this Aggregate's function map, which is a map of all the children of this Aggr...
void findAllSince()
Finds all the nodes in this node where a {since} command appeared in the qdoc comment and sorts them ...
void normalizeOverloads()
Sorts the lists of overloads in the function map and assigns overload numbers.
NodeList & relatedByProxy()
Returns a reference to a list of node pointers where each element points to a node in an index file f...
void findAllFunctions(NodeMapMap &functionIndex)
Insert all functions declared in this aggregate into the functionIndex.
void findAllNamespaces(NodeMultiMap &namespaces)
For each child of this node, if the child is a namespace node, insert the child into the namespaces m...
void markUndocumentedChildrenInternal()
Mark all child nodes that have no documentation as having private access and internal status.
bool isAggregate() const override
Returns true because this node is an instance of Aggregate, which means it can have children.
void addChild(Node *child)
Adds the child to this node's child list and sets the child's parent pointer to this Aggregate.
NodeList m_relatedByProxy
FunctionMap m_functionMap
FunctionNode * findFunctionChild(const FunctionNode *clone)
Returns the function node that is a child of this node, such that the function described has the same...
const NodeList & nonfunctionList()
Returns a const reference to the list of child nodes of this aggregate that are not function nodes.
const NodeList & childNodes() const
Returns a const reference to the child list.
NodeList::ConstIterator constEnd() const
Returns a const iterator pointing at the end of the child list.
const std::optional< QString > & includeFile() const
void findAllClasses()
Finds all the C++ classes, QML types, QML basic types, and examples in this aggregate and inserts the...
void findAllAttributions(NodeMultiMap &attributions)
Find all the attribution pages in this node and insert them into attributions.
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
static const QSet< QString > meta_commands
std::vector< TiedDocumentation > processQmlProperties(const UntiedDocumentation &untied)
bool splitQmlPropertyArg(const QString &arg, QString &type, QString &module, QString &element, QString &name, const Location &location)
A QML property argument has the form...
FunctionNode * parseOtherFuncArg(const QString &topic, const Location &location, const QString &funcArg)
Parse QML signal/method topic commands.
FunctionNode * parseMacroArg(const Location &location, const QString ¯oArg)
Parse the macro arguments in macroArg ad hoc, without using any actual parser.
void processMetaCommand(const Doc &doc, const QString &command, const ArgPair &argLocPair, Node *node)
Process the metacommand command in the context of the node associated with the topic command and the ...
CppCodeParser(FnCommandParser &&parser)
static const QSet< QString > topic_commands
static bool isQMLMethodTopic(const QString &t)
returns true if t is {qmlsignal}, {qmlmethod}, {qmlattachedsignal}, or {qmlattachedmethod}...
void processMetaCommands(const std::vector< TiedDocumentation > &tied)
static bool isQMLPropertyTopic(const QString &t)
Returns true if t is {qmlproperty}, {qmlpropertygroup}, or {qmlattachedproperty}.
virtual Node * processTopicCommand(const Doc &doc, const QString &command, const ArgPair &arg)
Process the topic command found in the doc with argument arg.
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 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.
void generateSortedQmlNames(const Node *base, const QStringList &knownTypes, const NodeList &subs)
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
void setImages(const QStringList &images)
const QString & projectFile() const
void appendImage(QString &image)
const QStringList & images() const
void setFiles(const QStringList &files, const QString &projectFile)
void setImageFileName(const QString &ifn) override
If this PageNode is an ExampleNode, the image file name data member is set to ifn.
ExampleNode(Aggregate *parent, const QString &name)
QString imageFileName() const override
If this PageNode is an ExampleNode, the image file name data member is returned.
void appendFile(QString &file)
const QStringList & files() 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.
bool isMacroWithParams() const
bool isMacroWithoutParams() const
QString metanessString() const
Returns a string representing the Metaness enum value for this function.
signed short overloadNumber() const
Returns the overload number for this function.
const QList< PropertyNode * > & associatedProperties() const
bool isPrivateSignal() const
void setReimpFlag()
Sets the function node's reimp flag to true, which means the {\reimp} command was used in the qdoc co...
const QString & returnType() const
QString kindString() const
Returns a string representing the kind of function this Function node represents, which depends on th...
QString qmlTypeName() const override
If this is a QmlPropertyNode or a FunctionNode representing a QML method, this function returns the q...
const Parameters & parameters() const
void setVirtualness(Virtualness virtualness)
const std::optional< QString > & declaredReturnType() const
bool isNonvirtual() const
QString logicalModuleIdentifier() const override
If this is a CollectionNode, this function returns the logical module identifier.
void setInvokable(bool b)
const QString & overridesThis() const
bool isDefault() const override
Returns true if the QML property node is marked as default.
Node * clone(Aggregate *parent) override
Clone this node on the heap and make the clone a child of parent.
bool isDeprecated() const override
\reimp
bool hasOverloads() const
Returns true if this function has overloads.
bool isPureVirtual() const
const std::optional< QString > & getNoexcept() const
bool isCppFunction() const
bool isMarkedReimp() const override
Returns true if the FunctionNode is marked as a reimplemented function.
QString element() const override
If this node is a QmlPropertyNode or a FunctionNode, this function returns the name of the parent nod...
bool isSpecialMemberFunction() const
QString signature(Node::SignatureOptions options) const override
Reconstructs and returns the function's signature.
bool isMacro() const override
returns true if either FunctionNode::isMacroWithParams() or FunctionNode::isMacroWithoutParams() retu...
QString logicalModuleVersion() const override
If this is a CollectionNode, this function returns the logical module version number.
const QString & tag() const
bool isAttached() const override
Returns true if the QML property or QML method node is marked as attached.
void setOverloadNumber(signed short number)
Sets the function node's overload number to number.
bool isStatic() const override
Returns true if the FunctionNode represents a static function.
bool isIgnored() const
In some cases, it is ok for a public function to be not documented.
friend int compare(const FunctionNode *f1, const FunctionNode *f2)
Compares FunctionNode f1 with f2, assumed to have identical names.
void setMetaness(Metaness metaness)
static Genus getGenus(Metaness metaness)
Determines the Genus value for this FunctionNode given the Metaness value metaness.
QString returnTypeString() const
Returns the type of the function as a string.
bool isQmlSignalHandler() const
QString logicalModuleName() const override
If this is a CollectionNode, this function returns the logical module name.
Parameters & parameters()
bool hasAssociatedProperties() const
const PropertyNode * primaryAssociatedProperty() const
Returns the primary associated property, if this is an access function for one or more properties.
QString virtualness() const
Returns this function's virtualness value as a string for use as an attribute value in index files.
Metaness metaness() const
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.
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)
int appendSortedQmlNames(Text &text, const Node *base, const QStringList &knownTypes, const NodeList &subs)
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 *)
QString fileExtension() const override
Returns "html" for this subclass of Generator.
void generateProxyPage(Aggregate *aggregate, CodeMarker *marker) override
void generatePageNode(PageNode *pn, CodeMarker *marker) override
Generate the HTML page for an entity that doesn't map to any underlying parsable C++ or QML element.
void generateCppReferencePage(Aggregate *aggregate, CodeMarker *marker) override
Generate a reference page for the C++ class, namespace, or header file documented in node using the c...
QString format() override
void generateDocs() override
If qdoc is in the {-prepare} phase, traverse the primary tree to generate the index file for the curr...
void generateCollectionNode(CollectionNode *cn, CodeMarker *marker) override
Generate the HTML page for a group, module, or QML module.
~HtmlGenerator() override
Destroys the HTML output generator.
HtmlGenerator(FileResolver &file_resolver)
void generateExampleFilePage(const Node *en, ResolvedFile resolved_file, CodeMarker *marker) override
Generate an html file with the contents of a C++ or QML source file.
QString fileBase(const Node *node) const override
void generateGenericCollectionPage(CollectionNode *cn, CodeMarker *marker) override
Generate the HTML page for a generic collection.
void generateQmlTypePage(QmlTypeNode *qcn, CodeMarker *marker) override
Generate the HTML page for a QML type.
void initializeGenerator() override
Initializes the HTML output generator's data structures from the configuration (Config) singleton.
void terminateGenerator() override
Gracefully terminates the HTML output generator.
qsizetype generateAtom(const Atom *atom, const Node *relative, CodeMarker *marker) override
Generate html from an instance of Atom.
~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.
The ManifestWriter is responsible for writing manifest files.
This class represents a C++ namespace.
bool isFirstClassAggregate() const override
Returns true.
bool hasDocumentedChildren() const
Returns true if this namespace node contains at least one child that has documentation and is not pri...
void includeChild(Node *child)
This function is only called from QDocDatabase::resolveNamespaces().
void setTree(Tree *t)
Sets the Tree pointer to t, which means this NamespaceNode is in the Tree t.
bool wasSeen() const override
Returns true if the {\namespace} command that this NamespaceNode represents has been parsed by qdoc.
void setDocNode(NamespaceNode *ns)
Called in QDocDatabase::resolveNamespaces() to set the pointer to the NamespaceNode in which this nam...
NamespaceNode * docNode() const
Returns a pointer to the NamespaceNode that represents where the namespace documentation is actually ...
bool docMustBeGenerated() const override
Returns true if this namespace node is not private and contains at least one public child node with d...
~NamespaceNode() override=default
void reportDocumentedChildrenInUndocumentedNamespace() const
Report qdoc warning for each documented child in a namespace that is not documented.
Tree * tree() const override
Returns a pointer to the Tree that contains this NamespaceNode.
bool isDocumentedHere() const
Returns true if this namespace is to be documented in the current module.
void markSeen()
Sets the data member that indicates that the {\namespace} command this NamespaceNode represents has b...
bool isRelatableType() const override
Returns true.
const NodeList & includedChildren() const
Returns a const reference to the namespace node's list of included children, which contains pointers ...
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.
bool isTextPageNode() const override
Returns true if this instance of PageNode is not an Aggregate.
QString title() const override
Returns the node's title, which is used for the page title.
void setNoAutoList(bool b)
Sets the no auto-list flag to b.
QString fullTitle() const override
Returns the node's full title.
const PageNode * navigationParent() const
bool isPageNode() const override
Always returns true because this is a PageNode.
virtual QString imageFileName() const
If this PageNode is an ExampleNode, the image file name data member is returned.
QString subtitle() const override
Returns the node's subtitle, which may be empty.
bool noAutoList() const
Returns the value of the no auto-list flag.
void setNavigationParent(const PageNode *parent)
bool isAttribution() const
const QStringList & groupNames() const
Returns a const reference to the string list containing all the group names.
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.
void setWritable(bool writable)
const NodeList & getters() const
void setStored(bool stored)
const NodeList & resetters() const
const NodeList & functions(FunctionRole role) const
const NodeList & setters() const
PropertyType propertyType() const
static QString roleName(FunctionRole role)
Returns a string representing an access function role.
void setPropertyType(PropertyType type)
const NodeList & notifiers() const
const PropertyNode * overriddenFrom() const
void addFunction(FunctionNode *function, FunctionRole role)
const QString & dataType() const
bool writableDefault() const
FunctionRole role(const FunctionNode *functionNode) const
Returns the role of functionNode for this property.
void setOverriddenFrom(const PropertyNode *baseProperty)
Sets this property's {overridden from} property to baseProperty, which indicates that this property o...
void addSignal(FunctionNode *function, FunctionRole role)
NodeList functions() const
bool storedDefault() const
QString qualifiedDataType() const
Returns a string containing the data type qualified with "const" either prepended to the data type or...
A class for representing an Aggregate that is documented in a different module.
bool docMustBeGenerated() const override
Returns true because a ProxyNode always means some documentation must be generated.
bool isRelatableType() const override
Returns true because the ProxyNode exists so that elements can be related to it with the {\relates}...
PureDocParser(const Location &location)
std::vector< UntiedDocumentation > parse_qdoc_file(const QString &filePath)
Parses the source file identified by filePath and adds its parsed contents to the database.
This class provides exclusive access to the qdoc database, which consists of a forrest of trees and a...
Node * findNodeForInclude(const QStringList &path)
NodeMapMap & getFunctionIndex()
Returns the function index.
void setSearchOrder(QStringList &t)
void resolveNamespaces()
Multiple namespace nodes for namespace X can exist in the qdoc database in different trees.
TextToNodeMap & getLegaleseTexts()
Returns a reference to the collection of legalese texts.
NodeMultiMap & getAttributions()
Returns a reference to the multimap of attribution nodes.
static void destroyQdocDB()
Destroys the singleton.
void addExampleNode(ExampleNode *n)
NodeMultiMap & getQmlTypesWithObsoleteMembers()
Returns a reference to the map of QML types with obsolete members.
NodeMultiMap & getObsoleteQmlTypes()
Returns a reference to the map of obsolete QML types.
static NodeMultiMapMap & newQmlTypeMaps()
static NodeMultiMap & classesWithObsoleteMembers()
static QDocDatabase * qdocDB()
Creates the singleton.
const CNMap & qmlModules()
Returns a const reference to the collection of all QML module nodes in the primary tree.
void resolveBaseClasses()
static NodeMultiMap & qmlTypes()
NodeMultiMap & getQmlTypes()
Returns a reference to the multimap of QML types.
NodeMultiMap & getClassesWithObsoleteMembers()
Returns a reference to the map of C++ classes with obsolete members.
NodeMultiMap & getQmlValueTypes()
Returns a reference to the map of QML basic types.
static NodeMultiMapMap & newEnumValueMaps()
static NodeMultiMap & obsoleteClasses()
NodeMultiMap & getCppClasses()
Returns a reference to the map of all C++ classes.
QStringList groupNamesForNode(Node *node)
NamespaceNode * primaryTreeRoot()
Returns a pointer to the root node of the primary tree.
void readIndexes(const QStringList &indexFiles)
Reads and parses the qdoc index files listed in indexFiles.
static NodeMultiMapMap & newSinceMaps()
static NodeMultiMap & obsoleteQmlTypes()
NodeMultiMap & getNamespaces()
Returns a reference to the namespace map.
const CNMap & modules()
Returns a const reference to the collection of all module nodes in the primary tree.
static NodeMultiMap & cppClasses()
Aggregate * findRelatesNode(const QStringList &path)
NodeMultiMap & getExamples()
Returns a reference to the multimap of example nodes.
static NodeMultiMap & qmlBasicTypes()
ClassNode * findClassNode(const QStringList &path)
void processForest()
This function calls a set of functions for each tree in the forest that has not already been analyzed...
Node * findNodeByNameAndType(const QStringList &path, bool(Node::*isMatch)() const)
void updateNavigation()
Updates navigation (previous/next page links and the navigation parent) for pages listed in the TOC,...
void setSearchOrder(const QList< Tree * > &searchOrder)
ExampleNodeMap & exampleNodeMap()
static NodeMultiMap & qmlTypesWithObsoleteMembers()
void resolveStuff()
Performs several housekeeping tasks prior to generating the documentation.
static NodeMultiMapMap & newClassMaps()
NodeMultiMap & getObsoleteClasses()
Returns a reference to the map of obsolete C++ clases.
static NodeMultiMap & examples()
const CollectionNode * getModuleNode(const Node *relative)
Returns the collection node representing the module that relative node belongs to,...
void resolveProxies()
Each instance of class Tree that represents an index file must be traversed to find all instances of ...
void mergeCollections(Node::NodeType type, CNMap &cnm, const Node *relative)
Finds all the collection nodes of the specified type and merges them into the collection node map cnm...
void mergeCollections(CollectionNode *c)
Finds all the collection nodes with the same name and type as c and merges their members into the mem...
const CNMap & groups()
Returns a const reference to the collection of all group nodes in the primary tree.
const QList< Tree * > & searchOrder()
A class representing a forest of Tree objects.
QString markedUpName(const Node *node) override
Constructs and returns the marked up name for the node.
bool recognizeCode(const QString &code) override
Returns true if the code is recognized by the parser.
bool recognizeLanguage(const QString &language) override
Returns true if the language is recognized.
QString markedUpCode(const QString &code, const Node *relative, const Location &location) override
bool recognizeExtension(const QString &ext) override
Returns true if ext is any of a list of file extensions for the QML language.
~QmlCodeMarker() override=default
QList< QQmlJS::SourceLocation > extractPragmas(QString &script)
Atom::AtomType atomType() const override
Returns the type of atom used to represent QML code in the documentation.
void initializeParser() override
QString language() override
Returns "QML".
QStringList sourceFileNameFilter() override
Returns a string list containing "*.qml".
void parseSourceFile(const Location &location, const QString &filePath, CppCodeParser &) override
Parses the source file at filePath and inserts the contents into the database.
void extractPragmas(QString &script)
Copy & paste from src/declarative/qml/qdeclarativescriptparser.cpp, then modified to return no values...
void terminateParser() override
Terminating a code parser is trivial.
~QmlCodeParser() override=default
static void terminate()
Clear the static maps so that subsequent runs don't try to use contents from a previous run.
void setAbstract(bool b) override
If this node is a ClassNode or a QmlTypeNode, the node's abstract flag data member is set to b.
ClassNode * classNode() override
If this is a QmlTypeNode, this function returns the pointer to the C++ ClassNode that this QML type r...
void setImportList(const ImportList &il)
bool isInternal() const override
Returns true if the node's status is Internal, or if its parent is a class with Internal status.
void setQmlModule(CollectionNode *t) override
If this is a QmlTypeNode, this function sets the QML type's QML module pointer to the CollectionNode ...
QString qmlFullBaseName() const override
If this QML type node has a base type node, return the fully qualified name of that QML type,...
QString logicalModuleIdentifier() const override
If the QML type's QML module pointer is set, return the QML module identifier from the QML module nod...
static QMultiMap< const Node *, Node * > s_inheritedBy
bool inherits(Aggregate *type)
Returns true if this QML type inherits type.
bool isWrapper() const override
Returns true if the node is a class node or a QML type node that is marked as being a wrapper class o...
QString logicalModuleVersion() const override
If the QML type's QML module pointer is set, return the QML module version from the QML module node.
bool isAbstract() const override
Returns true if the ClassNode or QmlTypeNode is marked abstract.
void resolveInheritance(NodeMap &previousSearches)
Recursively resolves the base node for this QML type when only the name of the base type is known.
void setWrapper() override
If this node is a ClassNode or a QmlTypeNode, the node's wrapper flag data member is set to true.
static void addInheritedBy(const Node *base, Node *sub)
Record the fact that QML class base is inherited by QML class sub.
const QString & qmlBaseName() const
QString logicalModuleName() const override
If the QML type's QML module pointer is set, return the QML module name from the QML module node.
bool isFirstClassAggregate() const override
Returns true if this Node is an Aggregate but not a ProxyNode.
static void subclasses(const Node *base, NodeList &subs)
Loads the list subs with the nodes of all the subclasses of base.
QmlTypeNode * qmlBaseNode() const override
If this Aggregate is a QmlTypeNode, this function returns a pointer to the QmlTypeNode that is its ba...
void setClassNode(ClassNode *cn) override
If this is a QmlTypeNode, this function sets the C++ class node to cn.
CollectionNode * logicalModule() const override
If this is a QmlTypeNode, a pointer to its QML module is returned, which is a pointer to a Collection...
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)
ParseResult operator()(const TaggedSourceFile &source)
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)
QString previousLexeme() const
static void terminate()
The heap allocated variables are freed here.
const Location & location() const
Tokenizer(const Location &loc, QFile &file)
void setParsingFnOrMacro(bool macro)
Tokenizer(const Location &loc, QByteArray in)
This class constructs and maintains a tree of instances of the subclasses of Node.
const QString & indexTitle() const
void markDontDocumentNodes()
The {don't document} map has been loaded with the names of classes and structs in the current module ...
void appendProxy(ProxyNode *t)
const QString & camelCaseModuleName() const
static QString refForAtom(const Atom *atom)
Returns a canonical title for the atom, if the atom is a SectionLeft, SectionHeadingLeft,...
Node * findNodeByNameAndType(const QStringList &path, bool(Node::*isMatch)() const) const
Find the node with the specified path name that is of the specified type and subtype.
const QString & physicalModuleName() const
const QString & indexFileName() const
QString fileBase(const Node *node) const override
virtual const Atom * addAtomElements(QXmlStreamWriter &writer, const Atom *atom, const Node *relative, CodeMarker *marker)
void terminateGenerator() override
Gracefully terminates the HTML output generator.
void generateDocumentation(Node *node) override
Recursive writing of HTML files from the root node.
void append(QXmlStreamWriter &writer, Node *node) override
virtual void generateIndexSections(QXmlStreamWriter &writer, Node *node)
void generateExampleFilePage(const Node *en, ResolvedFile file, CodeMarker *marker=nullptr) override
Generate an html file with the contents of a C++ or QML source file.
void generatePageNode(PageNode *pn, CodeMarker *marker) override
Generate the HTML page for an entity that doesn't map to any underlying parsable C++ or QML element.
WebXMLGenerator(FileResolver &file_resolver)
QString format() override
QString fileExtension() const override
Returns "html" for this subclass of Generator.
void initializeGenerator() override
Initializes the HTML output generator's data structures from the configuration (Config) singleton.
void generateCppReferencePage(Aggregate *aggregate, CodeMarker *marker) override
Generate a reference page for the C++ class, namespace, or header file documented in node using the c...
qsizetype generateAtom(const Atom *atom, const Node *relative, CodeMarker *marker) override
Most of the output is generated by QDocIndexFiles and the append() callback.
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_HEADERFILE
#define COMMAND_EXTERNALPAGE
#define COMMAND_QMLINHERITS
#define COMMAND_MODULESTATE
#define COMMAND_NONREENTRANT
#define COMMAND_QMLSIGNAL
#define COMMAND_DEPRECATED
#define COMMAND_PRELIMINARY
#define COMMAND_QMLPROPERTYGROUP
#define COMMAND_NAMESPACE
#define COMMAND_CMAKETARGETITEM
#define COMMAND_REENTRANT
#define COMMAND_QMLMODULE
#define COMMAND_QMLPROPERTY
#define COMMAND_STARTPAGE
#define COMMAND_QMLDEFAULT
#define COMMAND_QMLABSTRACT
#define COMMAND_QMLNATIVETYPE
#define COMMAND_QTVARIABLE
#define COMMAND_QTCMAKEPACKAGE
#define COMMAND_NOAUTOLIST
#define COMMAND_QMLATTACHEDPROPERTY
#define COMMAND_COMPARESWITH
#define COMMAND_QTCMAKETARGETITEM
#define COMMAND_INHEADERFILE
#define COMMAND_PREVIOUSPAGE
#define COMMAND_QMLBASICTYPE
#define COMMAND_THREADSAFE
#define COMMAND_QMLMETHOD
#define COMMAND_DONTDOCUMENT
#define COMMAND_CMAKECOMPONENT
#define COMMAND_QMLREADONLY
#define COMMAND_QMLENUMERATORSFROM
#define COMMAND_INPUBLICGROUP
#define COMMAND_QMLREQUIRED
#define COMMAND_QMLVALUETYPE
#define COMMAND_ATTRIBUTION
#define COMMAND_INQMLMODULE
#define COMMAND_QMLINSTANTIATES
#define COMMAND_TYPEALIAS
#define COMMAND_CMAKEPACKAGE
#define COMMAND_QMLATTACHEDMETHOD
#define COMMAND_QMLATTACHEDSIGNAL
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
bool hasTooManyTopics(const Doc &doc)
Checks if there are too many topic commands in doc.
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
QT_BEGIN_NAMESPACE typedef QMultiMap< Text, const Node * > TextToNodeMap
QList< ImportRec > ImportList
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
TaggedSourceFile tag_source_file(const QString &path)
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< TiedDocumentation > tied
std::vector< UntiedDocumentation > untied
A record of a linkable target within the documentation.
Node::Genus genus() const
TargetType
A type of a linkable target record.
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)
QMap< QString, QmlTypeNode * > QmlTypeMap
QMultiMap< QString, PageNode * > PageNodeMultiMap
QMultiMap< QString, TargetRec * > TargetMap
QMultiMap< QString, const ExampleNode * > ExampleNodeMap