47#if !ENABLE_DOCPARSER_TRACING
51#define AUTO_TRACE(...) (void)0
52#define AUTO_TRACE_ADD(...) (void)0
53#define AUTO_TRACE_EXIT(...) (void)0
61 return std::make_unique<DocParser>();
111 "image file name '{}' is ambiguous.\n"
122 result = result.
mid(i+1);
149 DString outputFile = outputDir+
"/"+result;
155 "destination of image {} is a symlink, replacing with image",
158 if (outputFile!=inputFile)
169 "could not open image {}",fileName);
179 epstopdfArgs.
sprintf(
"\"%s/%s.eps\" --outfile=\"%s/%s.pdf\"",
184 err(
"Problems running epstopdf. Check your TeX installation!\n");
199 "image file {} is not found in IMAGE_PATH: "
200 "assuming external image.",fileName
224 if (al.
empty())
return;
226 static const reg::Ex re(R
"(\$?\w+\.*)");
227 static const reg::Ex re_digits(R
"(\d+)");
230 for (; it!=
end ; ++it)
232 const auto &match = *it;
235 if (lang==SrcLangExt::Fortran) aName=aName.
lower();
242 if (lang==SrcLangExt::Fortran) argName=argName.
lower();
246 bool sameName = aName==argName;
247 bool samePosition = position==number;
248 if (samePosition || sameName)
268 if (!scope.
empty()) scope+=
"::";
else scope=
"";
275 inheritedFrom.
sprintf(
" inherited from member %s at line "
285 "positional argument with value '0' of command @param "
286 "is invalid, first parameter has index '1' for {}{}{}{}",
288 alStr, inheritedFrom);
294 "positional argument '{}' of command @param "
295 "is larger than the number of parameters ({}) for {}{}{}{}",
297 alStr, inheritedFrom);
303 "argument '{}' of command @param "
304 "is not found in the argument list of {}{}{}{}",
306 alStr, inheritedFrom);
323 "return value '{}' of {} has multiple documentation sections",
350 if (lang==SrcLangExt::Fortran) argName = argName.
lower();
354 if (lang==SrcLangExt::Python && (argName==
"self" || argName==
"cls"))
358 else if (lang==SrcLangExt::Cpp && (a.type==
"this" || a.type.startsWith(
"this ")))
362 else if (!argName.
empty())
366 if (count_named==0 && count_positional==0 && a.docs.empty())
370 else if (count_named==1 && count_positional==1 &&
Config_getBool(WARN_IF_DOC_ERROR))
374 "argument {} from the argument list of {} has both named and positional @param documentation sections",
377 else if (count_named+count_positional>1 &&
Config_getBool(WARN_IF_DOC_ERROR))
381 "argument {} from the argument list of {} has multiple @param documentation sections",
390 DString errMsg =
"The following parameter";
391 if (undocParams.
size()>1) errMsg+=
"s";
395 (undocParams.
size()>1 ?
" are" :
" is") +
" not documented:\n";
396 for (
const Argument &a : undocParams)
399 if (lang==SrcLangExt::Fortran) argName = argName.
lower();
401 if (!first) errMsg+=
"\n";
403 errMsg+=
" parameter '"+argName+
"'";
412 "too many @param commands for function {}. Found {} while function has {} parameter{}",
422 "{} has @param documentation sections but no arguments",
498 size_t rightBracePos = cmdArg.
find(
"}",
dstrlen(
"anonymous_namespace{"));
502 DString rightPart = cmdArg.
mid(rightBracePos + 1);
504 cmdArg = leftPart + rightPart;
516 int l=
static_cast<int>(cmdArg.
length());
518 size_t funcStart=cmdArg.
find(
'(');
527 size_t secondParen = cmdArg.
find(
'(', funcStart+1);
528 size_t leftParen = cmdArg.
find(
')', funcStart+1);
531 if (leftParen<secondParen)
533 funcStart=secondParen;
600 }
while (scopeOffset>=0);
612 case TokenRetval::TK_COMMAND_AT:
614 case TokenRetval::TK_COMMAND_BS:
622 case TokenRetval::TK_SYMBOL:
626 case TokenRetval::TK_HTMLTAG:
646 if (!tok.
is(TokenRetval::TK_WHITESPACE))
653 while (!tok.
is_any_of(TokenRetval::TK_NONE, TokenRetval::TK_EOF, TokenRetval::TK_WHITESPACE,
654 TokenRetval::TK_NEWPARA, TokenRetval::TK_LISTITEM, TokenRetval::TK_ENDLIST)
657 static const reg::Ex specialChar(R
"([.,|()\[\]:;?])");
673 case TokenRetval::TK_HTMLTAG:
693 return (tok.
is_any_of(TokenRetval::TK_NEWPARA,TokenRetval::TK_LISTITEM,TokenRetval::TK_ENDLIST)) ? tok : Token::make_RetVal_OK();
720 return std::get<DocStyleChange>(*stack.top());
767 if (numberOfElementsToClose==0) numberOfElementsToClose =
context.
styleStack.size();
777 numberOfElementsToClose--;
798 Token retval = Token::make_RetVal_OK();
799 for (
const auto &opt : tagHtmlAttribs)
801 if (opt.name==
"name" || opt.name==
"id")
803 if (!opt.value.empty())
813 else if (opt.name==
"href")
818 attrList.erase(attrList.begin()+index);
851 "end of comment block while expecting "
852 "command </{}> (Probable start '{}' at line {})",tagName, fileName, lineNr);
857 "end of comment block while expecting command </{}>",tagName);
865 auto ignoreWord = [](
const DString &w) ->
bool {
867 return std::find_if(list.begin(), list.end(),
868 [&w](
const auto &ignore) { return w.startsWith(ignore); }
919 AUTO_TRACE_ADD(
"no link as request is type but member is not a type or explicit link");
943 (
toFileDef(compound))->generateSourceFile()
956 AUTO_TRACE_ADD(
"resolved reference as unlinkable compound={} (linkable={}) member={} (linkable={})",
957 compound ? compound->
name() :
"<none>", compound ? (
int)compound->
isLinkable() : -1,
958 member ? member->
name() :
"<none>", member ? (
int)member->
isLinkable() : -1);
988 req->getOutputFileBase(),
1014 size_t p=0, i=0, ii=0;
1017 name1 = paramTypes.
mid(p,i-p);
1025 name1 = paramTypes.
mid(p);
1038 if (!tok.
is(TokenRetval::TK_WHITESPACE))
1045 if (!tok.
is_any_of(TokenRetval::TK_WORD,TokenRetval::TK_LNKWORD))
1059 if (!tok.
is(TokenRetval::TK_WHITESPACE))
1069 if (tok.
is_any_of(TokenRetval::TK_NONE,TokenRetval::TK_EOF))
1075 else if (!tok.
is_any_of(TokenRetval::TK_WORD,TokenRetval::TK_LNKWORD))
1097 for (
auto const &opt : optList)
1099 if (opt ==
"number")
1110 else if (opt ==
"year")
1121 else if (opt ==
"shortauthor")
1132 else if (opt ==
"nopar")
1136 else if (opt ==
"nocite")
1150 if (!tok.
is(TokenRetval::TK_WHITESPACE))
1157 else if (!tok.
is(TokenRetval::TK_WHITESPACE))
1171 if (tok.
is_any_of(TokenRetval::TK_NONE,TokenRetval::TK_EOF))
1177 else if (!tok.
is_any_of(TokenRetval::TK_WORD,TokenRetval::TK_LNKWORD))
1193 if (!tok.
is(TokenRetval::TK_WHITESPACE))
1200 if (tok.
is_any_of(TokenRetval::TK_NONE,TokenRetval::TK_EOF))
1206 else if (!tok.
is(TokenRetval::TK_WORD))
1233 while (!tok.
is_any_of(TokenRetval::TK_NONE,TokenRetval::TK_EOF))
1240 else if (tok.
is(TokenRetval::TK_HTMLTAG))
1252 if (tok.
is_any_of(TokenRetval::TK_NONE,TokenRetval::TK_EOF))
1256 while (tok.
is_any_of(TokenRetval::TK_WHITESPACE,TokenRetval::TK_WORD,TokenRetval::TK_HTMLTAG))
1258 if (tok.
is(TokenRetval::TK_WORD))
1286 if (tok.
is_any_of(TokenRetval::TK_COMMAND_AT,TokenRetval::TK_COMMAND_BS))
1292 else if (tok.
is(TokenRetval::TK_SYMBOL))
1297 else if (tok.
is(TokenRetval::TK_HTMLTAG))
1312 bool inlineImage =
false;
1316 if (!tok.
is(TokenRetval::TK_WHITESPACE))
1318 if (tok.
is(TokenRetval::TK_WORD))
1326 for (
const auto &opt : optList)
1328 if (opt.empty())
continue;
1332 locOptLow = locOpt.
lower();
1333 if (locOptLow ==
"inline")
1339 if (!anchorStr.
empty())
1342 "multiple use of option 'anchor' for 'image' command, ignoring: '{}'",
1347 anchorStr = locOpt.
mid(7);
1353 "unknown option '{}' for 'image' command specified",
1358 if (!tok.
is(TokenRetval::TK_WHITESPACE))
1372 if (!tok.
is_any_of(TokenRetval::TK_WORD,TokenRetval::TK_LNKWORD))
1379 if (!tok.
is(TokenRetval::TK_WHITESPACE))
1394 "\\image command is not valid", imgType);
1400 if (!tok.
is(TokenRetval::TK_WORD))
1405 if (!anchorStr.
empty())
1418 DString saveCmdName = cmdName;
1421 if (!tok.
is(TokenRetval::TK_WHITESPACE))
1424 cmdChar,
qPrint(saveCmdName));
1429 if (!tok.
is(TokenRetval::TK_WORD))
1445 if (!tok.
is(TokenRetval::TK_WHITESPACE))
1454 if (!tok.
is(TokenRetval::TK_WORD))
1469 if (!tok.
is(TokenRetval::TK_WORD))
1491 if (tok.
is_any_of(TokenRetval::TK_WORD,TokenRetval::TK_LNKWORD,TokenRetval::TK_SYMBOL,TokenRetval::TK_URL,
1492 TokenRetval::TK_COMMAND_AT,TokenRetval::TK_COMMAND_BS,TokenRetval::TK_HTMLTAG)
1499 switch (tok.
value())
1501 case TokenRetval::TK_COMMAND_AT:
1503 case TokenRetval::TK_COMMAND_BS:
1569 if (tok.
is(TokenRetval::TK_NEWPARA))
goto handlepara;
1570 else if (tok.
is_any_of(TokenRetval::TK_WORD,TokenRetval::TK_HTMLTAG))
1583 if (tok.
is(TokenRetval::TK_NEWPARA))
goto handlepara;
1584 else if (tok.
is_any_of(TokenRetval::TK_WORD,TokenRetval::TK_HTMLTAG))
1597 if (tok.
is(TokenRetval::TK_NEWPARA))
goto handlepara;
1598 else if (tok.
is_any_of(TokenRetval::TK_WORD,TokenRetval::TK_HTMLTAG))
1610 if (tok.
is_any_of(TokenRetval::TK_NONE,TokenRetval::TK_EOF))
1622 if (tok.
is_any_of(TokenRetval::TK_NONE,TokenRetval::TK_EOF))
1634 if (tok.
is_any_of(TokenRetval::TK_NONE,TokenRetval::TK_EOF))
1646 if (tok.
is_any_of(TokenRetval::TK_NONE,TokenRetval::TK_EOF))
1658 if (tok.
is_any_of(TokenRetval::TK_NONE,TokenRetval::TK_EOF))
1670 if (tok.
is_any_of(TokenRetval::TK_NONE,TokenRetval::TK_EOF))
1726 case TokenRetval::TK_HTMLTAG:
1807 case TokenRetval::TK_SYMBOL:
1820 case TokenRetval::TK_WHITESPACE:
1821 case TokenRetval::TK_NEWPARA:
1828 case TokenRetval::TK_LNKWORD:
1836 case TokenRetval::TK_WORD:
1844 case TokenRetval::TK_URL:
1867 for (
const auto &opt : tagHtmlAttribs)
1870 if (opt.name==
"src" && !opt.value.empty())
1875 attrList.erase(attrList.begin()+index);
1897 Token retval = Token::make_RetVal_OK();
1899 if (doc.
empty())
return retval;
1905 DocPara *lastPar=!children.
empty() ? std::get_if<DocPara>(&children.
back()):
nullptr;
1914 if (isFirst) { par->markFirst(); isFirst=
false; }
1915 retval=par->parse();
1918 if (lastPar) lastPar->
markLast(
false);
1925 }
while (retval.
is(TokenRetval::TK_NEWPARA));
1939 if (!filePath.
empty())
1952 "Check your EXAMPLE_PATH",file);
1962 bool insideDQuote=
false;
1963 bool insideSQuote=
false;
1965 while (j<len && !found)
1967 if (!insideSQuote && !insideDQuote)
1971 case '(': round++;
break;
1972 case ')': round--;
break;
1973 case '"': insideDQuote=
true;
break;
1974 case '\'': insideSQuote=
true;
break;
1982 found=(round==0) && (j<8 || !
literal_at(data+j-8,
"operator"));
1986 else if (insideSQuote)
1988 if (data[j]==
'\'' && (j==0 || data[j]!=
'\\'))
1993 else if (insideDQuote)
1995 if (data[j]==
'"' && (j==0 || data[j]!=
'\\'))
2015 while (k<len && data[k]==
' ') k++;
2016 if (k<len-1 && data[k]==
'&' && data[k+1]==
'&') j=k+2;
2017 else if (k<len && data[k]==
'&' ) j=k+1;
2021 if (j>0 && data[j-1]==
'.') { e--; }
2033#define CHECK_FOR_COMMAND(str,action) \
2034 do if ((i+sizeof(str)<len) && literal_at(data+i+1,str) && !isId(data[i+sizeof(str)])) \
2035 { j=i+sizeof(str); action; } while(0)
2040 if (i==0 || (data[i-1]!=
'@' && data[i-1]!=
'\\'))
2051 if (i==0 || (data[i-1]!=
'@' && data[i-1]!=
'\\'))
2077 if ((data[i]==
'@' || data[i]==
'\\') &&
2078 (i==0 || (data[i-1]!=
'@' && data[i-1]!=
'\\')))
2082 return i+endMarker.
length()+1;
2088 return i<len ? i+1 : len;
2102 if (c==
'@' || c==
'\\')
2109 while (j<len && (data[j]==
' ' || data[j]==
'\t')) j++;
2119 "@copy{} or @copydoc target '{}' found but is from a tag file, skipped",
2120 isBrief?
"brief":
"details",
id);
2130 auto addDocs = [&](
const DString &file_,
int line_,
const DString &doc_)
2132 result+=
" \\ifile \""+file_+
"\" ";
2134 size_t len_ = doc_.
length();
2160 "Found recursive @copy{} or @copydoc relation for argument '{}'.",
2161 isBrief?
"brief":
"details",
id);
2167 "@copy{} or @copydoc target '{}' not found", isBrief?
"brief":
"details",
id);
2180 result+=
DString(data+orgPos,i-orgPos);
2194 lineNr += (c==
'\n') ? 1 : 0;
2215 if (parser==
nullptr)
return nullptr;
2312 size_t ioLen = input.
length();
2323 auto ast = std::make_unique<DocNodeAST>(
DocRoot(parser,md!=
nullptr,options.
singleLine()));
2324 std::get<DocRoot>(ast->root).parse();
2351 if (parser==
nullptr)
return nullptr;
2383 auto ast = std::make_unique<DocNodeAST>(
DocTitle(parser,
nullptr));
2388 std::get<DocTitle>(ast->root).parseFromString(
nullptr,input);
2404 if (parser==
nullptr)
return nullptr;
2438 auto ast = std::make_unique<DocNodeAST>(
DocText(parser));
2447 std::get<DocText>(ast->root).parse();
2463 if (parser==
nullptr)
return nullptr;
2464 if (!srcFile.
empty())
2470 return std::make_unique<DocNodeAST>(
DocRef(parser,
nullptr,target,context));
2485 if (startPos>=len)
return len;
2486 uint8_t c =
static_cast<uint8_t
>(utf8Str[startPos]);
2491 int (*matcher)(int) =
nullptr;
2492 c =
static_cast<uint8_t
>(utf8Str[startPos+bytes]);
2496 c =
static_cast<uint8_t
>(utf8Str[startPos+bytes]);
2500 matcher = std::isxdigit;
2504 matcher = std::isdigit;
2507 else if (std::isalnum(c))
2510 matcher = std::isalnum;
2514 while ((c =
static_cast<uint8_t
>(utf8Str[startPos+bytes]))!=0 && matcher(c))
2524 return startPos+bytes;
2531 if (doc.
empty())
return "";
2532 static std::mutex s_docCacheMutex;
2533 static std::unordered_map<std::string,DString> s_docCache;
2535 std::lock_guard lock(s_docCacheMutex);
2536 auto it = s_docCache.find(doc.
str());
2537 if (it != s_docCache.end())
2552 .setAutolinkSupport(
false))
2554 auto astImpl =
dynamic_cast<const DocNodeAST*
>(ast.get());
2558 std::visit(visitor,astImpl->root);
2563 int l=
static_cast<int>(result.
length());
2567 if (charCnt>=80)
break;
2574 if (result.
at(i)==
',' ||
2575 result.
at(i)==
'.' ||
2576 result.
at(i)==
'!' ||
2577 result.
at(i)==
'?' ||
2585 if ( i < l) result=result.
left(i)+
"...";
2586 s_docCache.
insert(std::make_pair(doc.
str(),result));
2587 return result.
data();
2595 static std::mutex s_docCacheMutex;
2596 static std::unordered_map<std::string,DString> s_docCache;
2598 std::lock_guard lock(s_docCacheMutex);
2599 auto it = s_docCache.find(doc.
str());
2600 if (it != s_docCache.end())
2607 auto astImpl =
dynamic_cast<const DocNodeAST*
>(ast.get());
2615 std::visit(visitor,astImpl->root);
2623 s_docCache.
insert(std::make_pair(doc.
str(),result));
This class contains the information about the argument of a function or template.
This class represents an function or template argument list.
void push_back(const Argument &a)
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
DString & insert(size_t index, const DString &s)
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
Class representing a directory in the file system.
bool remove(const std::string &path, bool acceptsAbsPath=true) const
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.
Class representing the abstract syntax tree of a documentation block.
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,...
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.
Root node of documentation tree.
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)
Root node of a text fragment.
Node representing a simple section title.
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.
DString showFileDefMatches(const DString &n) const
Returns a list of file definitions in fnMap that match the file name n.
FileDef * findFileDef(const DString &n, bool &ambig) const
Returns the file definition in fnMap that matches the file name n.
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.
Generator for HTML code fragments.
Concrete visitor implementation for HTML output.
static HtmlEntityMapper & instance()
Returns the one and only instance of the HTML entity mapper.
DString convertCharEntitiesToUTF8(const DString &s) const
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.
Class representing a list of different code generators.
void add(OutputCodeIntfPtr &&p)
A model of a page symbol.
static RequirementManager & instance()
void setCurrentDoc(const Definition *ctx, const DString &anchor, bool isSourceFile)
Concrete visitor implementation for TEXT output.
Text streaming class that buffers data.
std::string str() const
Return the contents of the buffer as a std::string object.
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.
DString parseCommentAsText(const Definition *scope, const MemberDef *md, const DString &doc, const DString &fileName, int lineNr)
IDocNodeASTPtr validatingParseTitle(IDocParser &parserIntf, const DString &fileName, int lineNr, const DString &input)
IDocParserPtr createDocParser()
factory function to create a parser
DString parseCommentAsHtml(const Definition *scope, const MemberDef *member, const DString &doc, const DString &fileName, int lineNr)
IDocNodeASTPtr createRef(IDocParser &parserIntf, const DString &target, const DString &context, const DString &srcFile, int srcLine)
static int nextUTF8CharPosition(const DString &utf8Str, uint32_t len, uint32_t startPos)
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
StringVector split(const std::string &s, const std::string &delimiter, bool retainEmpty=false)
split input string s by string delimiter delimiter.
Helper class to pass options when calling OutputList::generateDoc().
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
uint8_t getUTF8CharNumBytes(char c)
Returns the number of bytes making up a single UTF8 character given the first byte in the sequence.
DString inlineArgListToDoc(const ArgumentList &al)
DString filterTitle(const DString &title)
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)
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)
GetDefResult getDefs(const GetDefInput &input)
DString findExampleFilePath(const DString &file, bool &ambig)
A bunch of utility functions.