24#include <unordered_map>
49class OutputDocInterface;
70 virtual
void writeLink(const QCString &extRef,const QCString &file,
71 const QCString &anchor,std::string_view text
76class TextGeneratorOLImpl : public TextGeneratorIntf
79 TextGeneratorOLImpl(OutputList &ol);
80 void writeString(std::string_view s,
bool keepSpaces)
const override;
82 void writeLink(
const QCString &extRef,
const QCString &file,
83 const QCString &anchor,std::string_view text
97 const Definition *scope,
98 const FileDef *fileScope,
99 const Definition *self,
100 const QCString &text,
101 bool autoBreak=
FALSE,
103 bool keepSpaces=
FALSE,
111 GetDefInput(
const QCString &scName,
const QCString &memName,
const QCString &a) :
112 scopeName(scName),memberName(memName),args(a) {}
116 bool forceEmptyScope =
false;
117 const FileDef *currentFile =
nullptr;
118 bool checkCV =
false;
119 bool insideCode =
false;
125 const MemberDef *md=
nullptr;
126 const ClassDef *cd=
nullptr;
127 const FileDef *fd=
nullptr;
128 const NamespaceDef *nd=
nullptr;
129 const GroupDef *gd=
nullptr;
132GetDefResult
getDefs(
const GetDefInput &input);
134QCString
getFileFilter(
const QCString &name,
bool isSourceCode);
137 const QCString &name,
139 const Definition **resContext,
140 const MemberDef **resMember,
141 bool lookForSpecializations =
TRUE,
142 const FileDef *currentFile =
nullptr,
143 bool checkScope =
FALSE
149 const Definition **resContext,
151 const QCString &
prefix=QCString()
155 const QCString &linkTxt=QCString());
157void writePageRef(OutputList &ol,
const QCString &cn,
const QCString &mn);
161bool matchArguments2(
const Definition *srcScope,
const FileDef *srcFileScope,
const ArgumentList *srcAl,
162 const Definition *dstScope,
const FileDef *dstFileScope,
const ArgumentList *dstAl,
178struct SelectionMarkerInfo
181 const char *beginStr;
185 const char *closeStr;
190void checkBlocks(
const QCString& s,
const QCString fileName,
const SelectionMarkerInfo &markerInfo);
195FileDef *
findFileDef(
const FileNameLinkedMap *fnMap,
const QCString &n,
bool &ambig);
196QCString
findFilePath(
const QCString &file,
bool &ambig);
204 return c==
'_' || c>=128 || c<0 || isalnum(c) || c==
'$';
208 return c>=128 || c<0 || isalnum(c);
233struct KeywordSubstitution
236 using GetValue = std::function<QCString()>;
237 using GetValueWithParam = std::function<QCString(
const QCString &)>;
238 std::variant<GetValue,GetValueWithParam> getValueVariant;
246 const QCString &projName,
const QCString &projNum,
const QCString &projBrief);
259 QCString &className,QCString &namespaceName,
260 bool allowEmptyClass=
FALSE);
278 MemberGroupList *pMemberGroups,
279 const Definition *context);
285 const QCString &name,
286 const Definition *context,
287 const ArgumentList &formalArgs);
290 const QCString &name,
291 const ArgumentList &formalArgs,
292 const ArgumentList *actualArgs);
295 bool parentOnly=
TRUE,
296 QCString *lastScopeStripped=
nullptr,
297 QCString scopeName=QCString(),
298 bool allowArtificial=
true);
301 const Definition **typedefContext=
nullptr);
303QCString
mergeScopes(
const QCString &leftScope,
const QCString &rightScope);
310 const QCString &name,
311 const QCString &title,
312 const QCString &args,
313 const Definition *scope);
316 const QCString &ptitle,
318 const QCString &fileName,
322 GroupDef *gd=
nullptr,
323 const TagInfo *tagInfo=
nullptr,
373bool checkIfTypedef(
const Definition *scope,
const FileDef *fileScope,
const QCString &n);
375QCString
parseCommentAsText(
const Definition *scope,
const MemberDef *member,
const QCString &doc,
const QCString &fileName,
int lineNr);
379QCString
recodeString(
const QCString &str,
const char *fromEncoding,
const char *toEncoding);
387bool readInputFile(
const QCString &fileName,std::string &contents,
388 bool filter=
TRUE,
bool isSourceCode=
FALSE);
398 const QCString &targetFileName,
399 const QCString &anchor);
400QCString
externalRef(
const QCString &relPath,
const QCString &ref,
bool href);
403void writeMarkerList(OutputList &ol,
const std::string &markerText,
size_t numMarkers,
404 std::function<
void(
size_t)> replaceFunc);
407struct ColoredImgDataItem
410 unsigned short width;
411 unsigned short height;
412 const unsigned char *content;
413 const unsigned char *alpha;
419bool copyFile(
const QCString &src,
const QCString &dest);
421int lineBlock(
const QCString &text,
const QCString &marker);
423bool isURL(
const QCString &url);
425QCString
correctURL(
const QCString &url,
const QCString &relPath);
441 MemberListType inListType,
443 MemberListType *outListType1,
444 MemberListType *outListType2
453int findIndex(
const std::string &s,
const reg::Ex &re);
466QCString
detab(
const QCString &s,
size_t &refIndent);
This class represents an function or template argument list.
A abstract class representing of a compound symbol.
The common base class of all entity definitions found in the sources.
Class representing a directory in the file system.
A model of a file symbol.
Minimal replacement for QFileInfo.
Ordered dictionary of FileName objects.
A model of a group of symbols.
A model of a class/file/namespace member symbol.
A list of MemberDef objects as shown in documentation sections.
An abstract interface of a namespace symbol.
Class representing a list of output generators that are written to in parallel.
A model of a page symbol.
class that provide information about a section.
Abstract interface for a hyperlinked text fragment.
virtual void writeString(std::string_view, bool) const =0
virtual void writeBreak(int indent) const =0
virtual void writeLink(const QCString &extRef, const QCString &file, const QCString &anchor, std::string_view text) const =0
#define ABSTRACT_BASE_CLASS(cls)
Macro to implement rule of 5 for an abstract base class.
std::vector< std::string > StringVector
constexpr DocNodeVariant * parent(DocNodeVariant *n)
returns the parent node of a given node n or nullptr if the node has no parent.
static void addMembersToMemberGroup()
QCString substitute(const QCString &s, const QCString &src, const QCString &dst)
substitute all occurrences of src in s by dst
std::vector< RefItem * > RefItemVector
This struct is used to capture the tag file information for an Entry.
This file contains a number of basic enums and types.
Protection
Protection level of members.
SrcLangExt
Language as given by extension.
QCString externalRef(const QCString &relPath, const QCString &ref, bool href)
QCString removeRedundantWhiteSpace(const QCString &s)
QCString convertNameToFile(const QCString &name, bool allowDots=FALSE, bool allowUnderscore=FALSE)
QCString extractDirection(QCString &docs)
Strip the direction part from docs and return it as a string in canonical form The input docs string ...
QCString mergeScopes(const QCString &leftScope, const QCString &rightScope)
QCString findFilePath(const QCString &file, bool &ambig)
QCString normalizeNonTemplateArgumentsInString(const QCString &name, const Definition *context, const ArgumentList &formalArgs)
QCString linkToText(SrcLangExt lang, const QCString &link, bool isFileName)
QCString recodeString(const QCString &str, const char *fromEncoding, const char *toEncoding)
size_t updateColumnCount(const char *s, size_t col)
QCString substituteClassNames(const QCString &s)
QCString convertToHtml(const QCString &s, bool keepEntities=TRUE)
void extractNamespaceName(const QCString &scopeName, QCString &className, QCString &namespaceName, bool allowEmptyClass=FALSE)
bool findAndRemoveWord(QCString &s, const char *word)
removes occurrences of whole word from sentence, while keeps internal spaces and reducing multiple se...
QCString insertTemplateSpecifierInScope(const QCString &scope, const QCString &templ)
bool protectionLevelVisible(Protection prot)
QCString convertCharEntitiesToUTF8(const QCString &s)
QCString generateAnonymousAnchor(const QCString &fileName, int count)
std::vector< KeywordSubstitution > KeywordSubstitutionList
bool readInputFile(const QCString &fileName, std::string &contents, bool filter=TRUE, bool isSourceCode=FALSE)
read a file name fileName and optionally filter and transcode it
int lineBlock(const QCString &text, const QCString &marker)
Returns the line number of the line following the line with the marker.
void addCodeOnlyMappings()
std::string join(const StringVector &s, const std::string &delimiter)
create a string where the string in the vector are joined by the given delimiter
void checkBlocks(const QCString &s, const QCString fileName, const SelectionMarkerInfo &markerInfo)
void writeTypeConstraints(OutputList &ol, const Definition *d, const ArgumentList &al)
bool leftScopeMatch(const QCString &scope, const QCString &name)
QCString correctURL(const QCString &url, const QCString &relPath)
Corrects URL url according to the relative path relPath.
QCString stripAnonymousNamespaceScope(const QCString &s)
QCString stripPath(const QCString &s)
QCString stripFromIncludePath(const QCString &path)
QCString fixSpaces(const QCString &s)
QCString removeEmptyLines(const QCString &s)
bool checkIfTypedef(const Definition *scope, const FileDef *fileScope, const QCString &n)
bool transcodeCharacterStringToUTF8(std::string &input, const char *inputEncoding)
int nextUtf8CharPosition(const QCString &utf8Str, uint32_t len, uint32_t startPos)
bool patternMatch(const FileInfo &fi, const StringVector &patList)
QCString generateMarker(int id)
QCString selectBlocks(const QCString &s, const SelectionBlockList &blockList, const SelectionMarkerInfo &markerInfo)
remove disabled blocks and all block markers from s and return the result as a string
bool recognizeFixedForm(const QCString &contents, FortranFormat format)
bool openOutputFile(const QCString &outFile, std::ofstream &f)
int extractClassNameFromType(const QCString &type, int &pos, QCString &name, QCString &templSpec, SrcLangExt=SrcLangExt::Unknown)
std::vector< SelectionBlock > SelectionBlockList
void addRefItem(const RefItemVector &sli, const QCString &key, const QCString &prefix, const QCString &name, const QCString &title, const QCString &args, const Definition *scope)
void addGroupListToTitle(OutputList &ol, const Definition *d)
QCString relativePathToRoot(const QCString &name)
QCString substituteTemplateArgumentsInString(const QCString &name, const ArgumentList &formalArgs, const ArgumentList *actualArgs)
void generateFileRef(OutputList &ol, const QCString &, const QCString &linkTxt=QCString())
SrcLangExt getLanguageFromCodeLang(QCString &fileName)
Routine to handle the language attribute of the \code command.
QCString tempArgListToString(const ArgumentList &al, SrcLangExt lang, bool includeDefaults=true)
void writePageRef(OutputList &ol, const QCString &cn, const QCString &mn)
void linkifyText(const TextGeneratorIntf &ol, const Definition *scope, const FileDef *fileScope, const Definition *self, const QCString &text, bool autoBreak=FALSE, bool external=TRUE, bool keepSpaces=FALSE, int indentLevel=0)
void clearSubDirs(const Dir &d)
bool resolveRef(const QCString &scName, const QCString &name, bool inSeeBlock, const Definition **resContext, const MemberDef **resMember, bool lookForSpecializations=TRUE, const FileDef *currentFile=nullptr, bool checkScope=FALSE)
QCString showFileDefMatches(const FileNameLinkedMap *fnMap, const QCString &n)
QCString stripExtensionGeneral(const QCString &fName, const QCString &ext)
QCString filterTitle(const QCString &title)
QCString unescapeCharsInString(const QCString &s)
void createSubDirs(const Dir &d)
bool matchArguments2(const Definition *srcScope, const FileDef *srcFileScope, const ArgumentList *srcAl, const Definition *dstScope, const FileDef *dstFileScope, const ArgumentList *dstAl, bool checkCV, SrcLangExt lang)
bool fileVisibleInIndex(const FileDef *fd, bool &genSourceFile)
QCString stripScope(const QCString &name)
QCString replaceAnonymousScopes(const QCString &s, const QCString &replacement=QCString())
QCString externalLinkTarget(const bool parent=false)
bool checkExtension(const QCString &fName, const QCString &ext)
bool isURL(const QCString &url)
Checks whether the given url starts with a supported protocol.
QCString substituteKeywords(const QCString &s, const KeywordSubstitutionList &keywords)
SrcLangExt getLanguageFromFileName(const QCString &fileName, SrcLangExt defLang=SrcLangExt::Cpp)
void stripIndentationVerbatim(QCString &doc, const int indentationLevel)
bool updateLanguageMapping(const QCString &extension, const QCString &parser)
void addDirPrefix(QCString &fileName)
int computeQualifiedIndex(const QCString &name)
Return the index of the last :: in the string name that is still before the first <.
QCString stripExtension(const QCString &fName)
void initDefaultExtensionMapping()
QCString parseCommentAsText(const Definition *scope, const MemberDef *member, const QCString &doc, const QCString &fileName, int lineNr)
QCString integerToAlpha(int n, bool upper=true)
PageDef * addRelatedPage(const QCString &name, const QCString &ptitle, const QCString &doc, const QCString &fileName, int docLine, int startLine, const RefItemVector &sli=RefItemVector(), GroupDef *gd=nullptr, const TagInfo *tagInfo=nullptr, bool xref=FALSE, SrcLangExt lang=SrcLangExt::Unknown)
QCString convertToJSString(const QCString &s)
QCString integerToRoman(int n, bool upper=true)
bool resolveLink(const QCString &scName, const QCString &lr, bool inSeeBlock, const Definition **resContext, QCString &resAnchor, const QCString &prefix=QCString())
QCString langToString(SrcLangExt lang)
Returns a string representation of lang.
QCString determineAbsoluteIncludeName(const QCString &curFile, const QCString &incFileName)
QCString detab(const QCString &s, size_t &refIndent)
EntryType guessSection(const QCString &name)
void convertProtectionLevel(MemberListType inListType, Protection inProt, MemberListType *outListType1, MemberListType *outListType2)
Computes for a given list type inListType, which are the the corresponding list type(s) in the base c...
QCString fileToString(const QCString &name, bool filter=FALSE, bool isSourceCode=FALSE)
int findIndex(const StringVector &sv, const std::string &s)
find the index of a string in a vector of strings, returns -1 if the string could not be found
QCString removeAnonymousScopes(const QCString &s)
QCString removeLongPathMarker(QCString path)
void writeExamples(OutputList &ol, const ExampleList &el)
QCString correctId(const QCString &s)
void mergeMemberOverrideOptions(MemberDefMutable *md1, MemberDefMutable *md2)
QCString getDotImageExtension()
QCString createHtmlUrl(const QCString &relPath, const QCString &ref, bool href, bool islocalFile, const QCString &targetFileName, const QCString &anchor)
GetDefResult getDefs(const GetDefInput &input)
QCString projectLogoFile()
QCString escapeCharsInString(const QCString &name, bool allowDots, bool allowUnderscore=FALSE)
StringVector split(const std::string &s, const std::string &delimiter)
split input string s by string delimiter delimiter.
QCString getEncoding(const FileInfo &fi)
QCString getLanguageSpecificSeparator(SrcLangExt lang, bool classScope=FALSE)
Returns the scope separator to use given the programming language lang.
QCString stripFromPath(const QCString &path)
FortranFormat convertFileNameFortranParserCode(QCString fn)
QCString stripLeadingAndTrailingEmptyLines(const QCString &s, int &docLine)
Special version of QCString::stripWhiteSpace() that only strips completely blank lines.
bool copyFile(const QCString &src, const QCString &dest)
Copies the contents of file with name src to the newly created file with name dest.
QCString stripTemplateSpecifiersFromScope(const QCString &fullName, bool parentOnly=TRUE, QCString *lastScopeStripped=nullptr, QCString scopeName=QCString(), bool allowArtificial=true)
QCString getFileFilter(const QCString &name, bool isSourceCode)
QCString argListToString(const ArgumentList &al, bool useCanonicalType=FALSE, bool showDefVals=TRUE)
QCString getOverloadDocs()
QCString convertToXML(const QCString &s, bool keepEntities=FALSE)
QCString stripIndentation(const QCString &s)
bool containsWord(const QCString &s, const char *word)
returns TRUE iff string s contains word w
int getPrefixIndex(const QCString &name)
bool rightScopeMatch(const QCString &scope, const QCString &name)
void writeMarkerList(OutputList &ol, const std::string &markerText, size_t numMarkers, std::function< void(size_t)> replaceFunc)
QCString inlineArgListToDoc(const ArgumentList &al)
QCString resolveTypeDef(const Definition *d, const QCString &name, const Definition **typedefContext=nullptr)
QCString replaceColorMarkers(const QCString &str)
Replaces any markers of the form ##AA in input string str by new markers of the form #AABBCC,...
QCString getFileNameExtension(const QCString &fn)
void mergeArguments(ArgumentList &, ArgumentList &, bool forceNameOverwrite=FALSE)
QCString convertToId(const QCString &s)
void writeColoredImgData(const QCString &dir, ColoredImgDataItem data[])
Writes the intensity only bitmap represented by data as an image to directory dir using the colors de...
QCString processMarkup(const QCString &s)
FileDef * findFileDef(const FileNameLinkedMap *fnMap, const QCString &n, bool &ambig)
int getScopeFragment(const QCString &s, int p, int *l)
void addHtmlExtensionIfMissing(QCString &fName)