43#if !ENABLE_DOCPARSER_TRACING
47#define AUTO_TRACE(...) (void)0
48#define AUTO_TRACE_ADD(...) (void)0
49#define AUTO_TRACE_EXIT(...) (void)0
57 return std::make_unique<DocParser>();
107 "image file name '{}' is ambiguous.\n"
118 result = result.
mid(i+1);
145 DString outputFile = outputDir+
"/"+result;
149 Dir().remove(outputFile.
str());
151 "destination of image {} is a symlink, replacing with image",
154 if (outputFile!=inputFile)
165 "could not open image {}",fileName);
175 epstopdfArgs.
sprintf(
"\"%s/%s.eps\" --outfile=\"%s/%s.pdf\"",
180 err(
"Problems running epstopdf. Check your TeX installation!\n");
184 Dir().remove(outputDir.
str()+
"/"+baseName.
str()+
".eps");
195 "image file {} is not found in IMAGE_PATH: "
196 "assuming external image.",fileName
220 if (al.
empty())
return;
222 static const reg::Ex re(R
"(\$?\w+\.*)");
223 static const reg::Ex re_digits(R
"(\d+)");
226 for (; it!=
end ; ++it)
228 const auto &match = *it;
231 if (lang==SrcLangExt::Fortran) aName=aName.
lower();
238 if (lang==SrcLangExt::Fortran) argName=argName.
lower();
242 bool sameName = aName==argName;
243 bool samePosition = position==number;
244 if (samePosition || sameName)
264 if (!scope.
empty()) scope+=
"::";
else scope=
"";
271 inheritedFrom.
sprintf(
" inherited from member %s at line "
281 "positional argument with value '0' of command @param "
282 "is invalid, first parameter has index '1' for {}{}{}{}",
284 alStr, inheritedFrom);
290 "positional argument '{}' of command @param "
291 "is larger than the number of parameters ({}) for {}{}{}{}",
293 alStr, inheritedFrom);
299 "argument '{}' of command @param "
300 "is not found in the argument list of {}{}{}{}",
302 alStr, inheritedFrom);
319 "return value '{}' of {} has multiple documentation sections",
346 if (lang==SrcLangExt::Fortran) argName = argName.
lower();
350 if (lang==SrcLangExt::Python && (argName==
"self" || argName==
"cls"))
354 else if (lang==SrcLangExt::Cpp && (a.type==
"this" || a.type.startsWith(
"this ")))
358 else if (!argName.
empty())
362 if (count_named==0 && count_positional==0 && a.docs.empty())
366 else if (count_named==1 && count_positional==1 &&
Config_getBool(WARN_IF_DOC_ERROR))
370 "argument {} from the argument list of {} has both named and positional @param documentation sections",
373 else if (count_named+count_positional>1 &&
Config_getBool(WARN_IF_DOC_ERROR))
377 "argument {} from the argument list of {} has multiple @param documentation sections",
386 DString errMsg =
"The following parameter";
387 if (undocParams.
size()>1) errMsg+=
"s";
391 (undocParams.
size()>1 ?
" are" :
" is") +
" not documented:\n";
392 for (
const Argument &a : undocParams)
395 if (lang==SrcLangExt::Fortran) argName = argName.
lower();
397 if (!first) errMsg+=
"\n";
399 errMsg+=
" parameter '"+argName+
"'";
408 "too many @param commands for function {}. Found {} while function has {} parameter{}",
418 "{} has @param documentation sections but no arguments",
494 size_t rightBracePos = cmdArg.
find(
"}",
dstrlen(
"anonymous_namespace{"));
496 DString rightPart = cmdArg.
mid(rightBracePos + 1);
498 cmdArg = leftPart + rightPart;
505 int l=
static_cast<int>(cmdArg.
length());
507 size_t funcStart=cmdArg.
find(
'(');
516 size_t secondParen = cmdArg.
find(
'(', funcStart+1);
517 size_t leftParen = cmdArg.
find(
')', funcStart+1);
520 if (leftParen<secondParen)
522 funcStart=secondParen;
584 }
while (scopeOffset>=0);
596 case TokenRetval::TK_COMMAND_AT:
598 case TokenRetval::TK_COMMAND_BS:
606 case TokenRetval::TK_SYMBOL:
610 case TokenRetval::TK_HTMLTAG:
630 if (!tok.
is(TokenRetval::TK_WHITESPACE))
637 while (!tok.
is_any_of(TokenRetval::TK_NONE, TokenRetval::TK_EOF, TokenRetval::TK_WHITESPACE,
638 TokenRetval::TK_NEWPARA, TokenRetval::TK_LISTITEM, TokenRetval::TK_ENDLIST)
641 static const reg::Ex specialChar(R
"([.,|()\[\]:;?])");
657 case TokenRetval::TK_HTMLTAG:
677 return (tok.
is_any_of(TokenRetval::TK_NEWPARA,TokenRetval::TK_LISTITEM,TokenRetval::TK_ENDLIST)) ? tok : Token::make_RetVal_OK();
704 return std::get<DocStyleChange>(*stack.top());
751 if (numberOfElementsToClose==0) numberOfElementsToClose =
context.
styleStack.size();
761 numberOfElementsToClose--;
782 Token retval = Token::make_RetVal_OK();
783 for (
const auto &opt : tagHtmlAttribs)
785 if (opt.name==
"name" || opt.name==
"id")
787 if (!opt.value.empty())
797 else if (opt.name==
"href")
802 attrList.erase(attrList.begin()+index);
835 "end of comment block while expecting "
836 "command </{}> (Probable start '{}' at line {})",tagName, fileName, lineNr);
841 "end of comment block while expecting command </{}>",tagName);
849 auto ignoreWord = [](
const DString &w) ->
bool {
851 return std::find_if(list.begin(), list.end(),
852 [&w](
const auto &ignore) { return w.startsWith(ignore); }
903 AUTO_TRACE_ADD(
"no link as request is type but member is not a type or explicit link");
927 (
toFileDef(compound))->generateSourceFile()
940 AUTO_TRACE_ADD(
"resolved reference as unlinkable compound={} (linkable={}) member={} (linkable={})",
941 compound ? compound->
name() :
"<none>", compound ? (
int)compound->
isLinkable() : -1,
942 member ? member->
name() :
"<none>", member ? (
int)member->
isLinkable() : -1);
972 req->getOutputFileBase(),
998 size_t p=0, i=0, ii=0;
1001 name1 = paramTypes.
mid(p,i-p);
1009 name1 = paramTypes.
mid(p);
1022 if (!tok.
is(TokenRetval::TK_WHITESPACE))
1029 if (!tok.
is_any_of(TokenRetval::TK_WORD,TokenRetval::TK_LNKWORD))
1043 if (!tok.
is(TokenRetval::TK_WHITESPACE))
1053 if (tok.
is_any_of(TokenRetval::TK_NONE,TokenRetval::TK_EOF))
1059 else if (!tok.
is_any_of(TokenRetval::TK_WORD,TokenRetval::TK_LNKWORD))
1081 for (
auto const &opt : optList)
1083 if (opt ==
"number")
1094 else if (opt ==
"year")
1105 else if (opt ==
"shortauthor")
1116 else if (opt ==
"nopar")
1120 else if (opt ==
"nocite")
1134 if (!tok.
is(TokenRetval::TK_WHITESPACE))
1141 else if (!tok.
is(TokenRetval::TK_WHITESPACE))
1155 if (tok.
is_any_of(TokenRetval::TK_NONE,TokenRetval::TK_EOF))
1161 else if (!tok.
is_any_of(TokenRetval::TK_WORD,TokenRetval::TK_LNKWORD))
1177 if (!tok.
is(TokenRetval::TK_WHITESPACE))
1184 if (tok.
is_any_of(TokenRetval::TK_NONE,TokenRetval::TK_EOF))
1190 else if (!tok.
is(TokenRetval::TK_WORD))
1217 while (!tok.
is_any_of(TokenRetval::TK_NONE,TokenRetval::TK_EOF))
1224 else if (tok.
is(TokenRetval::TK_HTMLTAG))
1236 if (tok.
is_any_of(TokenRetval::TK_NONE,TokenRetval::TK_EOF))
1240 while (tok.
is_any_of(TokenRetval::TK_WHITESPACE,TokenRetval::TK_WORD,TokenRetval::TK_HTMLTAG))
1242 if (tok.
is(TokenRetval::TK_WORD))
1270 if (tok.
is_any_of(TokenRetval::TK_COMMAND_AT,TokenRetval::TK_COMMAND_BS))
1276 else if (tok.
is(TokenRetval::TK_SYMBOL))
1281 else if (tok.
is(TokenRetval::TK_HTMLTAG))
1296 bool inlineImage =
false;
1300 if (!tok.
is(TokenRetval::TK_WHITESPACE))
1302 if (tok.
is(TokenRetval::TK_WORD))
1310 for (
const auto &opt : optList)
1312 if (opt.empty())
continue;
1316 locOptLow = locOpt.
lower();
1317 if (locOptLow ==
"inline")
1323 if (!anchorStr.
empty())
1326 "multiple use of option 'anchor' for 'image' command, ignoring: '{}'",
1331 anchorStr = locOpt.
mid(7);
1337 "unknown option '{}' for 'image' command specified",
1342 if (!tok.
is(TokenRetval::TK_WHITESPACE))
1356 if (!tok.
is_any_of(TokenRetval::TK_WORD,TokenRetval::TK_LNKWORD))
1363 if (!tok.
is(TokenRetval::TK_WHITESPACE))
1378 "\\image command is not valid", imgType);
1384 if (!tok.
is(TokenRetval::TK_WORD))
1389 if (!anchorStr.
empty())
1402 DString saveCmdName = cmdName;
1405 if (!tok.
is(TokenRetval::TK_WHITESPACE))
1408 cmdChar,
qPrint(saveCmdName));
1413 if (!tok.
is(TokenRetval::TK_WORD))
1429 if (!tok.
is(TokenRetval::TK_WHITESPACE))
1438 if (!tok.
is(TokenRetval::TK_WORD))
1453 if (!tok.
is(TokenRetval::TK_WORD))
1475 if (tok.
is_any_of(TokenRetval::TK_WORD,TokenRetval::TK_LNKWORD,TokenRetval::TK_SYMBOL,TokenRetval::TK_URL,
1476 TokenRetval::TK_COMMAND_AT,TokenRetval::TK_COMMAND_BS,TokenRetval::TK_HTMLTAG)
1483 switch (tok.
value())
1485 case TokenRetval::TK_COMMAND_AT:
1487 case TokenRetval::TK_COMMAND_BS:
1553 if (tok.
is(TokenRetval::TK_NEWPARA))
goto handlepara;
1554 else if (tok.
is_any_of(TokenRetval::TK_WORD,TokenRetval::TK_HTMLTAG))
1567 if (tok.
is(TokenRetval::TK_NEWPARA))
goto handlepara;
1568 else if (tok.
is_any_of(TokenRetval::TK_WORD,TokenRetval::TK_HTMLTAG))
1581 if (tok.
is(TokenRetval::TK_NEWPARA))
goto handlepara;
1582 else if (tok.
is_any_of(TokenRetval::TK_WORD,TokenRetval::TK_HTMLTAG))
1594 if (tok.
is_any_of(TokenRetval::TK_NONE,TokenRetval::TK_EOF))
1606 if (tok.
is_any_of(TokenRetval::TK_NONE,TokenRetval::TK_EOF))
1618 if (tok.
is_any_of(TokenRetval::TK_NONE,TokenRetval::TK_EOF))
1630 if (tok.
is_any_of(TokenRetval::TK_NONE,TokenRetval::TK_EOF))
1642 if (tok.
is_any_of(TokenRetval::TK_NONE,TokenRetval::TK_EOF))
1654 if (tok.
is_any_of(TokenRetval::TK_NONE,TokenRetval::TK_EOF))
1710 case TokenRetval::TK_HTMLTAG:
1791 case TokenRetval::TK_SYMBOL:
1804 case TokenRetval::TK_WHITESPACE:
1805 case TokenRetval::TK_NEWPARA:
1812 case TokenRetval::TK_LNKWORD:
1820 case TokenRetval::TK_WORD:
1828 case TokenRetval::TK_URL:
1851 for (
const auto &opt : tagHtmlAttribs)
1854 if (opt.name==
"src" && !opt.value.empty())
1859 attrList.erase(attrList.begin()+index);
1881 Token retval = Token::make_RetVal_OK();
1883 if (doc.
empty())
return retval;
1889 DocPara *lastPar=!children.
empty() ? std::get_if<DocPara>(&children.
back()):
nullptr;
1898 if (isFirst) { par->markFirst(); isFirst=
false; }
1899 retval=par->parse();
1902 if (lastPar) lastPar->
markLast(
false);
1909 }
while (retval.
is(TokenRetval::TK_NEWPARA));
1923 if (!filePath.
empty())
1936 "Check your EXAMPLE_PATH",file);
1946 bool insideDQuote=
false;
1947 bool insideSQuote=
false;
1949 while (j<len && !found)
1951 if (!insideSQuote && !insideDQuote)
1955 case '(': round++;
break;
1956 case ')': round--;
break;
1957 case '"': insideDQuote=
true;
break;
1958 case '\'': insideSQuote=
true;
break;
1966 found=(round==0) && (j<8 || !
literal_at(data+j-8,
"operator"));
1970 else if (insideSQuote)
1972 if (data[j]==
'\'' && (j==0 || data[j]!=
'\\'))
1977 else if (insideDQuote)
1979 if (data[j]==
'"' && (j==0 || data[j]!=
'\\'))
1999 while (k<len && data[k]==
' ') k++;
2000 if (k<len-1 && data[k]==
'&' && data[k+1]==
'&') j=k+2;
2001 else if (k<len && data[k]==
'&' ) j=k+1;
2005 if (j>0 && data[j-1]==
'.') { e--; }
2015#define CHECK_FOR_COMMAND(str,action) \
2016 do if ((i+sizeof(str)<len) && literal_at(data+i+1,str)) \
2017 { j=i+sizeof(str); action; } while(0)
2022 if (i==0 || (data[i-1]!=
'@' && data[i-1]!=
'\\'))
2033 if (i==0 || (data[i-1]!=
'@' && data[i-1]!=
'\\'))
2059 if ((data[i]==
'@' || data[i]==
'\\') &&
2060 (i==0 || (data[i-1]!=
'@' && data[i-1]!=
'\\')))
2064 return i+endMarker.
length()+1;
2070 return i<len ? i+1 : len;
2084 if (c==
'@' || c==
'\\')
2091 while (j<len && (data[j]==
' ' || data[j]==
'\t')) j++;
2101 "@copy{} or @copydoc target '{}' found but is from a tag file, skipped",
2102 isBrief?
"brief":
"details",
id);
2112 auto addDocs = [&](
const DString &file_,
int line_,
const DString &doc_)
2114 result+=
" \\ifile \""+file_+
"\" ";
2116 size_t len_ = doc_.
length();
2142 "Found recursive @copy{} or @copydoc relation for argument '{}'.",
2143 isBrief?
"brief":
"details",
id);
2149 "@copy{} or @copydoc target '{}' not found", isBrief?
"brief":
"details",
id);
2162 result+=
DString(data+orgPos,i-orgPos);
2176 lineNr += (c==
'\n') ? 1 : 0;
2196 assert(parser!=
nullptr);
2197 if (parser==
nullptr)
return nullptr;
2294 size_t ioLen = input.
length();
2305 auto ast = std::make_unique<DocNodeAST>(
DocRoot(parser,md!=
nullptr,options.
singleLine()));
2306 std::get<DocRoot>(ast->root).parse();
2332 assert(parser!=
nullptr);
2333 if (parser==
nullptr)
return nullptr;
2365 auto ast = std::make_unique<DocNodeAST>(
DocTitle(parser,
nullptr));
2370 std::get<DocTitle>(ast->root).parseFromString(
nullptr,input);
2385 assert(parser!=
nullptr);
2386 if (parser==
nullptr)
return nullptr;
2420 auto ast = std::make_unique<DocNodeAST>(
DocText(parser));
2429 std::get<DocText>(ast->root).parse();
2444 assert(parser!=
nullptr);
2445 if (parser==
nullptr)
return nullptr;
2446 if (!srcFile.
empty())
2452 return std::make_unique<DocNodeAST>(
DocRef(parser,
nullptr,target,context));
This class represents an function or template argument list.
void push_back(const Argument &a)
AutoNodeStack(DocParser *parser, DocNodeVariant *node)
constexpr void setNoCite() noexcept
static constexpr CiteInfoOption makeNumber()
constexpr void changeToNumber() noexcept
constexpr void setNoPar() noexcept
constexpr bool isUnknown() const noexcept
static constexpr CiteInfoOption makeYear()
static constexpr CiteInfoOption makeShortAuthor()
A abstract class representing of a compound symbol.
A String class for use with Doxygen wrapping std::string and adding some additional functionality off...
DString & setNum(short n)
size_t rfind(char c, size_t pos=npos) const
DString mid(size_t index, size_t len=npos) const
bool empty() const
Returns true iff the string is empty (std::string compatible alias for isEmpty()).
std::string_view view() const
static constexpr size_t npos
value used to indicate 'not found' or 'to the end of the string', matching std::string::npos
char & at(size_t i)
Returns a reference to the character at index i.
DString right(size_t len) const
size_t size() const
Returns the length of the string, not counting the 0-terminator.
DString & prepend(const char *s)
size_t find(char c, size_t pos=0) const
DString & sprintf(const char *format,...)
void reserve(size_t size)
Reserve space for size bytes without changing the string contents.
DString stripWhiteSpace() const
returns a copy of this string with leading and trailing whitespace removed
DString left(size_t len) const
const std::string & str() const
const char * data() const
Returns a pointer to the contents of the string in the form of a 0-terminated C string.
bool startsWith(const char *s) const
bool endsWith(const char *s) const
size_t length() const
Returns the length of the string, not counting the 0-terminator.
static bool isFlagSet(const DebugMask mask)
The common base class of all entity definitions found in the sources.
virtual DString briefDescription(bool abbreviate=false) const =0
virtual DString briefFile() const =0
virtual SrcLangExt getLanguage() const =0
Returns the programming language this definition was written in.
virtual int docLine() const =0
virtual DString getDefFileName() const =0
virtual DString documentation() const =0
virtual bool isLinkable() const =0
virtual int getDefLine() const =0
virtual DefType definitionType() const =0
virtual const DString & name() const =0
virtual DString briefDescriptionAsTooltip() const =0
virtual int briefLine() const =0
virtual DString qualifiedName() const =0
virtual DString anchor() const =0
virtual DString getReference() const =0
virtual DString docFile() const =0
virtual DString getSourceFileBase() const =0
virtual bool isReference() const =0
virtual DString getOutputFileBase() const =0
Node representing an anchor.
Node representing a citation of some bibliographic reference.
Node representing a Hypertext reference.
Node representing an image.
Node representing an internal reference to some item.
Node representing a word that can be linked to something.
Node representing a paragraph in the documentation tree.
void markLast(bool v=true)
void handleIFile(char cmdChar, const DString &cmdName)
std::stack< DocParserContext > contextStack
void handlePendingStyleCommands(DocNodeVariant *parent, DocNodeList &children, size_t numberOfElementsToClose=0)
void handleInternalRef(DocNodeVariant *parent, DocNodeList &children)
void readTextFileByName(const DString &file, DString &text)
void errorHandleDefaultToken(DocNodeVariant *parent, Token tok, DocNodeList &children, const DString &txt)
void handleRef(DocNodeVariant *parent, DocNodeList &children, char cmdChar, const DString &cmdName)
Token handleAHref(DocNodeVariant *parent, DocNodeList &children, const HtmlAttribList &tagHtmlAttribs)
void handleStyleEnter(DocNodeVariant *parent, DocNodeList &children, DocStyleChange::Style s, const DString &tagName, const HtmlAttribList *attribs)
void handleParameterType(DocNodeVariant *parent, DocNodeList &children, const DString ¶mTypes)
bool defaultHandleToken(DocNodeVariant *parent, Token &tok, DocNodeList &children, bool handleWord=true)
void handleInitialStyleCommands(DocNodeVariant *parent, DocNodeList &children)
bool findDocsForMemberOrCompound(const DString &commandName, DString *pDoc, DString *pBrief, const Definition **pDef)
DString processCopyDoc(const char *data, size_t &len)
Token handleStyleArgument(DocNodeVariant *parent, DocNodeList &children, const DString &cmdName)
void handleStyleLeave(DocNodeVariant *parent, DocNodeList &children, DocStyleChange::Style s, const DString &tagName)
void checkUnOrMultipleDocumentedParams()
void defaultHandleTitleAndSize(const CommandType cmd, DocNodeVariant *parent, DocNodeList &children, DString &width, DString &height)
void handleImage(DocNodeVariant *parent, DocNodeList &children)
void handleLinkedWord(DocNodeVariant *parent, DocNodeList &children, bool ignoreAutoLinkFlag=false, bool typeLinkOnly=false)
void handleCite(DocNodeVariant *parent, DocNodeList &children)
void handlePrefix(DocNodeVariant *parent, DocNodeList &children)
void handleILine(char cmdChar, const DString &cmdName)
Token internalValidatingParseDoc(DocNodeVariant *parent, DocNodeList &children, const DString &doc)
void handleAnchor(DocNodeVariant *parent, DocNodeList &children)
void handleImg(DocNodeVariant *parent, DocNodeList &children, const HtmlAttribList &tagHtmlAttribs)
void handleUnclosedStyleCommands()
DString findAndCopyImage(const DString &fileName, DocImage::Type type, bool doWarn=true)
Node representing a reference to some item.
DocRef(DocParser *parser, DocNodeVariant *parent, const DString &target, const DString &context)
DocRoot(DocParser *parser, bool indent, bool sl)
Node representing a separator.
Node representing a style change.
const char * styleString() const
const HtmlAttribList & attribs() const
Node representing a special symbol.
static HtmlEntityMapper::SymType decodeSymbol(const DString &symName)
DocText(DocParser *parser)
DocTitle(DocParser *parser, DocNodeVariant *parent)
DString getFileName() const
void setStateTitleAttrValue()
void unputString(const DString &tag)
void setLineNr(int lineno)
void findSections(const DString &input, const Definition *d, const DString &fileName)
void setStateInternalRef()
void init(const char *input, const DString &fileName, bool markdownSupport, bool insideHtmlLink)
void setFileName(const DString &fileName)
Node representing a URL (or email address).
Node representing a verbatim, unparsed text fragment.
Node representing some amount of white space.
Node representing a word.
static NamespaceLinkedMap * namespaceLinkedMap
static FileNameLinkedMap * inputNameLinkedMap
static ClassLinkedMap * classLinkedMap
static NamespaceDefMutable * globalScope
static FileNameLinkedMap * imageNameLinkedMap
static IndexList * indexList
static PageLinkedMap * pageLinkedMap
static FileNameLinkedMap * exampleNameLinkedMap
static SearchIndexIntf searchIndex
static GroupLinkedMap * groupLinkedMap
A model of a file symbol.
virtual DString absFilePath() const =0
Minimal replacement for QFileInfo.
A model of a group of symbols.
virtual DString groupTitle() const =0
T & back()
access the last element
void pop_back()
removes the last element
bool empty() const
checks whether the container is empty
Class representing a list of HTML attributes.
void addImageFile(const DString &name)
const T * find(const std::string &key) const
A model of a class/file/namespace member symbol.
virtual bool isObjCMethod() const =0
virtual const MemberDef * inheritsDocsFrom() const =0
virtual DString objCMethodName(bool localLink, bool showStatic) const =0
virtual const ClassDef * getClassDef() const =0
virtual bool isTypedef() const =0
virtual const ArgumentList & argumentList() const =0
virtual bool isFunction() const =0
virtual bool isDocsForDefinition() const =0
virtual bool isDefine() const =0
virtual DString getScopeString() const =0
virtual const MemberDef * templateMaster() const =0
virtual bool isEnumerate() const =0
virtual void detectUndocumentedParams(bool hasParamCommand, bool hasReturnCommand) const =0
virtual const ArgumentList & declArgumentList() const =0
virtual bool isEnumValue() const =0
An abstract interface of a namespace symbol.
A model of a page symbol.
static RequirementManager & instance()
void setCurrentDoc(const Definition *ctx, const DString &anchor, bool isSourceFile)
bool is(TokenRetval rv) const
TOKEN_SPECIFICATIONS RETVAL_SPECIFICATIONS const char * to_string() const
TokenRetval value() const
bool is_any_of(ARGS... args) const
char command_to_char() const
ClassDef * getClass(const DString &n)
Class representing a regular expression.
Class to iterate through matches.
#define Config_getList(name)
#define Config_getBool(name)
#define Config_getString(name)
std::vector< std::string > StringVector
DirIterator end(const DirIterator &) noexcept
#define AUTO_TRACE_ADD(...)
#define AUTO_TRACE_EXIT(...)
std::variant< DocWord, DocLinkedWord, DocURL, DocLineBreak, DocHorRuler, DocAnchor, DocCite, DocStyleChange, DocSymbol, DocEmoji, DocWhiteSpace, DocSeparator, DocVerbatim, DocInclude, DocIncOperator, DocFormula, DocIndexEntry, DocAutoList, DocAutoListItem, DocTitle, DocXRefItem, DocImage, DocDotFile, DocMscFile, DocDiaFile, DocVhdlFlow, DocLink, DocRef, DocInternalRef, DocHRef, DocHtmlHeader, DocHtmlDescTitle, DocHtmlDescList, DocSection, DocSecRefItem, DocSecRefList, DocInternal, DocParBlock, DocSimpleList, DocHtmlList, DocSimpleSect, DocSimpleSectSep, DocParamSect, DocPara, DocParamList, DocSimpleListItem, DocHtmlListItem, DocHtmlDescData, DocHtmlCell, DocHtmlCaption, DocHtmlRow, DocHtmlTable, DocHtmlBlockQuote, DocText, DocRoot, DocHtmlDetails, DocHtmlSummary, DocPlantUmlFile, DocMermaidFile > DocNodeVariant
constexpr DocNodeVariant * parent(DocNodeVariant *n)
returns the parent node of a given node n or nullptr if the node has no parent.
IDocNodeASTPtr validatingParseTitle(IDocParser &parserIntf, const DString &fileName, int lineNr, const DString &input)
IDocParserPtr createDocParser()
factory function to create a parser
IDocNodeASTPtr createRef(IDocParser &parserIntf, const DString &target, const DString &context, const DString &srcFile, int srcLine)
IDocNodeASTPtr validatingParseText(IDocParser &parserIntf, const DString &input)
static DString extractCopyDocId(const char *data, size_t &j, size_t len)
static size_t isVerbatimSection(const char *data, size_t i, size_t len, DString &endMarker)
void docFindSections(const DString &input, const Definition *d, const DString &fileName)
static size_t skipToEndMarker(const char *data, size_t i, size_t len, const DString &endMarker)
static size_t isCopyBriefOrDetailsCmd(const char *data, size_t i, size_t len, bool &brief)
IDocNodeASTPtr validatingParseDoc(IDocParser &parserIntf, const DString &fileName, int startLine, const Definition *ctx, const MemberDef *md, const DString &input, const DocOptions &options)
#define CHECK_FOR_COMMAND(str, action)
std::unique_ptr< IDocNodeAST > IDocNodeASTPtr
std::unique_ptr< IDocParser > IDocParserPtr
pointer to parser interface
Private header shared between docparser.cpp and docnode.cpp.
IterableStack< const DocNodeVariant * > DocStyleChangeStack
bool insidePRE(const DocNodeVariant *n)
bool insideLI(const DocNodeVariant *n)
DString substitute(const DString &s, const DString &src, const DString &dst)
substitute all occurrences of src in s by dst
int dstrncmp(const char *str1, const char *str2, size_t len)
uint32_t dstrlen(const char *str)
Returns the length of string str, or 0 if a null pointer is passed.
const char * qPrint(const char *s)
FileDef * toFileDef(Definition *d)
GroupDef * toGroupDef(Definition *d)
MemberDef * toMemberDef(Definition *d)
#define warn_incomplete_doc(file, line, fmt,...)
#define warn(file, line, fmt,...)
#define warn_doc_error(file, line, fmt,...)
const Mapper< HtmlTagType > * htmlTagMapper
const Mapper< CommandType > * cmdMapper
int system(const DString &command, const DString &args, bool commandHasConsole=true)
DString trunc(const DString &s, size_t numChars=15)
bool match(std::string_view str, Match &match, const Ex &re)
Matches a given string str for a match against regular expression re.
PageDef * toPageDef(Definition *d)
Portable versions of functions that are platform dependent.
Some helper functions for std::string.
bool literal_at(const char *data, const char(&str)[N])
returns true iff data points to a substring that matches string literal str
This class contains the information about the argument of a function or template.
void append(Args &&... args)
Append a new DocNodeVariant to the list by constructing it with type T and parameters Args.
T * get_last()
Returns a pointer to the last element in the list if that element exists and holds a T,...
bool autolinkSupport() const
DString exampleName() const
bool linkFromIndex() const
bool markdownSupport() const
StringMultiSet retvalsFound
DocStyleChangeStack styleStack
StringMultiSet paramsFound
DefinitionStack copyStack
DocStyleChangeStack initialStyleStack
const MemberDef * memberDef
DString findFilePath(const DString &file, bool &ambig)
DString inlineArgListToDoc(const ArgumentList &al)
DString detab(const DString &s, size_t &refIndent)
bool resolveRef(const DString &scName, const DString &name, bool inSeeBlock, const Definition **resContext, const MemberDef **resMember, SrcLangExt lang, bool lookForSpecialization, const FileDef *currentFile, bool checkScope)
DString removeRedundantWhiteSpace(const DString &s)
DString convertNameToFile(const DString &name, bool allowDots, bool allowUnderscore)
DString showFileDefMatches(const FileNameLinkedMap *fnMap, const DString &n)
FileDef * findFileDef(const FileNameLinkedMap *fnMap, const DString &n, bool &ambig)
SrcLangExt getLanguageFromFileName(const DString &fileName, SrcLangExt defLang)
DString fileToString(const DString &name, bool filter, bool isSourceCode)
DString linkToText(SrcLangExt lang, const DString &link, bool ignoreDots)
DString relativePathToRoot(const DString &name)
DString argListToString(const ArgumentList &al, bool useCanonicalType, bool showDefVals)
bool copyFile(const DString &src, const DString &dest)
Copies the contents of file with name src to the newly created file with name dest.
DString getLanguageSpecificSeparator(SrcLangExt lang, bool classScope)
Returns the scope separator to use given the programming language lang.
GetDefResult getDefs(const GetDefInput &input)
StringVector split(const std::string &s, const std::string &delimiter)
split input string s by string delimiter delimiter.
A bunch of utility functions.