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;
595 }
while (scopeOffset>=0);
607 case TokenRetval::TK_COMMAND_AT:
609 case TokenRetval::TK_COMMAND_BS:
617 case TokenRetval::TK_SYMBOL:
621 case TokenRetval::TK_HTMLTAG:
641 if (!tok.
is(TokenRetval::TK_WHITESPACE))
648 while (!tok.
is_any_of(TokenRetval::TK_NONE, TokenRetval::TK_EOF, TokenRetval::TK_WHITESPACE,
649 TokenRetval::TK_NEWPARA, TokenRetval::TK_LISTITEM, TokenRetval::TK_ENDLIST)
652 static const reg::Ex specialChar(R
"([.,|()\[\]:;?])");
668 case TokenRetval::TK_HTMLTAG:
688 return (tok.
is_any_of(TokenRetval::TK_NEWPARA,TokenRetval::TK_LISTITEM,TokenRetval::TK_ENDLIST)) ? tok : Token::make_RetVal_OK();
715 return std::get<DocStyleChange>(*stack.top());
762 if (numberOfElementsToClose==0) numberOfElementsToClose =
context.
styleStack.size();
772 numberOfElementsToClose--;
793 Token retval = Token::make_RetVal_OK();
794 for (
const auto &opt : tagHtmlAttribs)
796 if (opt.name==
"name" || opt.name==
"id")
798 if (!opt.value.empty())
808 else if (opt.name==
"href")
813 attrList.erase(attrList.begin()+index);
846 "end of comment block while expecting "
847 "command </{}> (Probable start '{}' at line {})",tagName, fileName, lineNr);
852 "end of comment block while expecting command </{}>",tagName);
860 auto ignoreWord = [](
const DString &w) ->
bool {
862 return std::find_if(list.begin(), list.end(),
863 [&w](
const auto &ignore) { return w.startsWith(ignore); }
914 AUTO_TRACE_ADD(
"no link as request is type but member is not a type or explicit link");
938 (
toFileDef(compound))->generateSourceFile()
951 AUTO_TRACE_ADD(
"resolved reference as unlinkable compound={} (linkable={}) member={} (linkable={})",
952 compound ? compound->
name() :
"<none>", compound ? (
int)compound->
isLinkable() : -1,
953 member ? member->
name() :
"<none>", member ? (
int)member->
isLinkable() : -1);
983 req->getOutputFileBase(),
1009 size_t p=0, i=0, ii=0;
1012 name1 = paramTypes.
mid(p,i-p);
1020 name1 = paramTypes.
mid(p);
1033 if (!tok.
is(TokenRetval::TK_WHITESPACE))
1040 if (!tok.
is_any_of(TokenRetval::TK_WORD,TokenRetval::TK_LNKWORD))
1054 if (!tok.
is(TokenRetval::TK_WHITESPACE))
1064 if (tok.
is_any_of(TokenRetval::TK_NONE,TokenRetval::TK_EOF))
1070 else if (!tok.
is_any_of(TokenRetval::TK_WORD,TokenRetval::TK_LNKWORD))
1092 for (
auto const &opt : optList)
1094 if (opt ==
"number")
1105 else if (opt ==
"year")
1116 else if (opt ==
"shortauthor")
1127 else if (opt ==
"nopar")
1131 else if (opt ==
"nocite")
1145 if (!tok.
is(TokenRetval::TK_WHITESPACE))
1152 else if (!tok.
is(TokenRetval::TK_WHITESPACE))
1166 if (tok.
is_any_of(TokenRetval::TK_NONE,TokenRetval::TK_EOF))
1172 else if (!tok.
is_any_of(TokenRetval::TK_WORD,TokenRetval::TK_LNKWORD))
1188 if (!tok.
is(TokenRetval::TK_WHITESPACE))
1195 if (tok.
is_any_of(TokenRetval::TK_NONE,TokenRetval::TK_EOF))
1201 else if (!tok.
is(TokenRetval::TK_WORD))
1228 while (!tok.
is_any_of(TokenRetval::TK_NONE,TokenRetval::TK_EOF))
1235 else if (tok.
is(TokenRetval::TK_HTMLTAG))
1247 if (tok.
is_any_of(TokenRetval::TK_NONE,TokenRetval::TK_EOF))
1251 while (tok.
is_any_of(TokenRetval::TK_WHITESPACE,TokenRetval::TK_WORD,TokenRetval::TK_HTMLTAG))
1253 if (tok.
is(TokenRetval::TK_WORD))
1281 if (tok.
is_any_of(TokenRetval::TK_COMMAND_AT,TokenRetval::TK_COMMAND_BS))
1287 else if (tok.
is(TokenRetval::TK_SYMBOL))
1292 else if (tok.
is(TokenRetval::TK_HTMLTAG))
1307 bool inlineImage =
false;
1311 if (!tok.
is(TokenRetval::TK_WHITESPACE))
1313 if (tok.
is(TokenRetval::TK_WORD))
1321 for (
const auto &opt : optList)
1323 if (opt.empty())
continue;
1327 locOptLow = locOpt.
lower();
1328 if (locOptLow ==
"inline")
1334 if (!anchorStr.
empty())
1337 "multiple use of option 'anchor' for 'image' command, ignoring: '{}'",
1342 anchorStr = locOpt.
mid(7);
1348 "unknown option '{}' for 'image' command specified",
1353 if (!tok.
is(TokenRetval::TK_WHITESPACE))
1367 if (!tok.
is_any_of(TokenRetval::TK_WORD,TokenRetval::TK_LNKWORD))
1374 if (!tok.
is(TokenRetval::TK_WHITESPACE))
1389 "\\image command is not valid", imgType);
1395 if (!tok.
is(TokenRetval::TK_WORD))
1400 if (!anchorStr.
empty())
1413 DString saveCmdName = cmdName;
1416 if (!tok.
is(TokenRetval::TK_WHITESPACE))
1419 cmdChar,
qPrint(saveCmdName));
1424 if (!tok.
is(TokenRetval::TK_WORD))
1440 if (!tok.
is(TokenRetval::TK_WHITESPACE))
1449 if (!tok.
is(TokenRetval::TK_WORD))
1464 if (!tok.
is(TokenRetval::TK_WORD))
1486 if (tok.
is_any_of(TokenRetval::TK_WORD,TokenRetval::TK_LNKWORD,TokenRetval::TK_SYMBOL,TokenRetval::TK_URL,
1487 TokenRetval::TK_COMMAND_AT,TokenRetval::TK_COMMAND_BS,TokenRetval::TK_HTMLTAG)
1494 switch (tok.
value())
1496 case TokenRetval::TK_COMMAND_AT:
1498 case TokenRetval::TK_COMMAND_BS:
1564 if (tok.
is(TokenRetval::TK_NEWPARA))
goto handlepara;
1565 else if (tok.
is_any_of(TokenRetval::TK_WORD,TokenRetval::TK_HTMLTAG))
1578 if (tok.
is(TokenRetval::TK_NEWPARA))
goto handlepara;
1579 else if (tok.
is_any_of(TokenRetval::TK_WORD,TokenRetval::TK_HTMLTAG))
1592 if (tok.
is(TokenRetval::TK_NEWPARA))
goto handlepara;
1593 else if (tok.
is_any_of(TokenRetval::TK_WORD,TokenRetval::TK_HTMLTAG))
1605 if (tok.
is_any_of(TokenRetval::TK_NONE,TokenRetval::TK_EOF))
1617 if (tok.
is_any_of(TokenRetval::TK_NONE,TokenRetval::TK_EOF))
1629 if (tok.
is_any_of(TokenRetval::TK_NONE,TokenRetval::TK_EOF))
1641 if (tok.
is_any_of(TokenRetval::TK_NONE,TokenRetval::TK_EOF))
1653 if (tok.
is_any_of(TokenRetval::TK_NONE,TokenRetval::TK_EOF))
1665 if (tok.
is_any_of(TokenRetval::TK_NONE,TokenRetval::TK_EOF))
1721 case TokenRetval::TK_HTMLTAG:
1802 case TokenRetval::TK_SYMBOL:
1815 case TokenRetval::TK_WHITESPACE:
1816 case TokenRetval::TK_NEWPARA:
1823 case TokenRetval::TK_LNKWORD:
1831 case TokenRetval::TK_WORD:
1839 case TokenRetval::TK_URL:
1862 for (
const auto &opt : tagHtmlAttribs)
1865 if (opt.name==
"src" && !opt.value.empty())
1870 attrList.erase(attrList.begin()+index);
1892 Token retval = Token::make_RetVal_OK();
1894 if (doc.
empty())
return retval;
1900 DocPara *lastPar=!children.
empty() ? std::get_if<DocPara>(&children.
back()):
nullptr;
1909 if (isFirst) { par->markFirst(); isFirst=
false; }
1910 retval=par->parse();
1913 if (lastPar) lastPar->
markLast(
false);
1920 }
while (retval.
is(TokenRetval::TK_NEWPARA));
1934 if (!filePath.
empty())
1947 "Check your EXAMPLE_PATH",file);
1957 bool insideDQuote=
false;
1958 bool insideSQuote=
false;
1960 while (j<len && !found)
1962 if (!insideSQuote && !insideDQuote)
1966 case '(': round++;
break;
1967 case ')': round--;
break;
1968 case '"': insideDQuote=
true;
break;
1969 case '\'': insideSQuote=
true;
break;
1977 found=(round==0) && (j<8 || !
literal_at(data+j-8,
"operator"));
1981 else if (insideSQuote)
1983 if (data[j]==
'\'' && (j==0 || data[j]!=
'\\'))
1988 else if (insideDQuote)
1990 if (data[j]==
'"' && (j==0 || data[j]!=
'\\'))
2010 while (k<len && data[k]==
' ') k++;
2011 if (k<len-1 && data[k]==
'&' && data[k+1]==
'&') j=k+2;
2012 else if (k<len && data[k]==
'&' ) j=k+1;
2016 if (j>0 && data[j-1]==
'.') { e--; }
2026#define CHECK_FOR_COMMAND(str,action) \
2027 do if ((i+sizeof(str)<len) && literal_at(data+i+1,str)) \
2028 { j=i+sizeof(str); action; } while(0)
2033 if (i==0 || (data[i-1]!=
'@' && data[i-1]!=
'\\'))
2044 if (i==0 || (data[i-1]!=
'@' && data[i-1]!=
'\\'))
2070 if ((data[i]==
'@' || data[i]==
'\\') &&
2071 (i==0 || (data[i-1]!=
'@' && data[i-1]!=
'\\')))
2075 return i+endMarker.
length()+1;
2081 return i<len ? i+1 : len;
2095 if (c==
'@' || c==
'\\')
2102 while (j<len && (data[j]==
' ' || data[j]==
'\t')) j++;
2112 "@copy{} or @copydoc target '{}' found but is from a tag file, skipped",
2113 isBrief?
"brief":
"details",
id);
2123 auto addDocs = [&](
const DString &file_,
int line_,
const DString &doc_)
2125 result+=
" \\ifile \""+file_+
"\" ";
2127 size_t len_ = doc_.
length();
2153 "Found recursive @copy{} or @copydoc relation for argument '{}'.",
2154 isBrief?
"brief":
"details",
id);
2160 "@copy{} or @copydoc target '{}' not found", isBrief?
"brief":
"details",
id);
2173 result+=
DString(data+orgPos,i-orgPos);
2187 lineNr += (c==
'\n') ? 1 : 0;
2208 if (parser==
nullptr)
return nullptr;
2305 size_t ioLen = input.
length();
2316 auto ast = std::make_unique<DocNodeAST>(
DocRoot(parser,md!=
nullptr,options.
singleLine()));
2317 std::get<DocRoot>(ast->root).parse();
2344 if (parser==
nullptr)
return nullptr;
2376 auto ast = std::make_unique<DocNodeAST>(
DocTitle(parser,
nullptr));
2381 std::get<DocTitle>(ast->root).parseFromString(
nullptr,input);
2397 if (parser==
nullptr)
return nullptr;
2431 auto ast = std::make_unique<DocNodeAST>(
DocText(parser));
2440 std::get<DocText>(ast->root).parse();
2456 if (parser==
nullptr)
return nullptr;
2457 if (!srcFile.
empty())
2463 return std::make_unique<DocNodeAST>(
DocRef(parser,
nullptr,target,context));
2478 if (startPos>=len)
return len;
2479 uint8_t c =
static_cast<uint8_t
>(utf8Str[startPos]);
2484 int (*matcher)(int) =
nullptr;
2485 c =
static_cast<uint8_t
>(utf8Str[startPos+bytes]);
2489 c =
static_cast<uint8_t
>(utf8Str[startPos+bytes]);
2493 matcher = std::isxdigit;
2497 matcher = std::isdigit;
2500 else if (std::isalnum(c))
2503 matcher = std::isalnum;
2507 while ((c =
static_cast<uint8_t
>(utf8Str[startPos+bytes]))!=0 && matcher(c))
2517 return startPos+bytes;
2524 if (doc.
empty())
return "";
2525 static std::mutex s_docCacheMutex;
2526 static std::unordered_map<std::string,DString> s_docCache;
2528 std::lock_guard lock(s_docCacheMutex);
2529 auto it = s_docCache.find(doc.
str());
2530 if (it != s_docCache.end())
2545 .setAutolinkSupport(
false))
2547 auto astImpl =
dynamic_cast<const DocNodeAST*
>(ast.get());
2551 std::visit(visitor,astImpl->root);
2556 int l=
static_cast<int>(result.
length());
2560 if (charCnt>=80)
break;
2567 if (result.
at(i)==
',' ||
2568 result.
at(i)==
'.' ||
2569 result.
at(i)==
'!' ||
2570 result.
at(i)==
'?' ||
2578 if ( i < l) result=result.
left(i)+
"...";
2579 s_docCache.
insert(std::make_pair(doc.
str(),result));
2580 return result.
data();
2588 static std::mutex s_docCacheMutex;
2589 static std::unordered_map<std::string,DString> s_docCache;
2591 std::lock_guard lock(s_docCacheMutex);
2592 auto it = s_docCache.find(doc.
str());
2593 if (it != s_docCache.end())
2600 auto astImpl =
dynamic_cast<const DocNodeAST*
>(ast.get());
2608 std::visit(visitor,astImpl->root);
2616 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)
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.