45 #define START_MARKER 0x4445465B // DEF[ 46 #define END_MARKER 0x4445465D // DEF] 57 void init(
const char *df,
const char *
n);
122 if (name!=
"<globalScope>")
154 const char *pat = exclSyms.
first();
159 bool forceStart=
FALSE;
161 if (pattern.
at(0)==
'^')
162 pattern=pattern.
mid(1),forceStart=
TRUE;
163 if (pattern.
at(pattern.
length()-1)==
'$')
165 if (pattern.
find(
'*')!=-1)
169 i = re.
match(symName,0,&pl);
175 if ((i==0 || pattern.
at(0)==
'*' || (!
isId(symName.
at(i-1)) && !forceStart)) &&
176 (i+pl==sl || pattern.
at(i+pl)==
'*' || (!
isId(symName.
at(i+pl)) && !forceEnd))
186 int i = symName.
find(pattern);
192 if ((i==0 || (!
isId(symName.
at(i-1)) && !forceStart)) &&
193 (i+pl==sl || (!
isId(symName.
at(i+pl)) && !forceEnd))
201 pat = exclSyms.
next();
212 if (!vhdlOpt && index!=-1) symbolName=symbolName.
mid(index+2);
244 static int sizeIndex=9;
284 const char *
name,
const char *
b,
285 const char *
d,
bool isSymbol) : m_cookie(0)
322 for (it.toFirst();(si=it.current());++it)
332 for (it.toFirst();(md=it.current());++it)
342 for (it.toFirst();(md=it.current());++it)
420 if (!anchorList)
return;
454 for (li.toFirst();(si=li.current());++li)
474 for (li.toFirst();(si=li.current());++li)
486 for (i=level;i<nextLevel;i++)
491 else if (nextLevel<level)
493 for (i=nextLevel;i<
level;i++)
502 bool isDir = ((li.current()) ? (
int)(li.current()->type > nextLevel):
FALSE);
527 for (;(si=sdi.current());++sdi)
533 tagFile <<
" <docanchor file=\"" << si->
fileName <<
"\"";
538 tagFile <<
">" << si->
label <<
"</docanchor>" <<
endl;
555 if (sigList.
find(sigStr)==-1)
567 bool stripWhiteSpace,
bool atTop)
618 #define uni_isupper(c) (QChar(c).category()==QChar::Letter_Uppercase) 628 if (pp==-1 || ((
uchar)s[pp])<0x80)
return FALSE;
635 static bool needsDot = outputLanguage!=
"Japanese" &&
636 outputLanguage!=
"Chinese" &&
637 outputLanguage!=
"Korean";
642 if (bl>0 && needsDot)
644 int c = brief.
at(bl-1);
647 case '.':
case '!':
case '?':
case '>':
case ':':
case ')':
break;
731 static bool filterSourceFiles =
Config_getBool(
"FILTER_SOURCE_FILES");
734 if (fileName==0 || fileName[0]==0)
return FALSE;
737 bool usePipe = !filter.
isEmpty() && filterSourceFiles;
760 while (lineNr<startLine && !feof(f))
762 while ((c=fgetc(f))!=
'\n' && c!=EOF) ;
764 if (found && c ==
'\n') c =
'\0';
770 while (lineNr<=endLine && !feof(f) && !found)
773 while ((c=fgetc(f))!=
'{' && c!=
':' && c!=EOF)
782 col+=tabSize - (col%tabSize);
784 else if (pc==
'/' && c==
'/')
786 while ((c=fgetc(f))!=
'\n' && c!=EOF) pc=c;
787 if (c==
'\n') lineNr++,col=0;
789 else if (pc==
'/' && c==
'*')
791 while (((c=fgetc(f))!=
'/' || pc!=
'*') && c!=EOF)
793 if (c==
'\n') lineNr++,col=0;
806 if (cn!=
':') found=
TRUE;
819 if (endLine!=startLine)
822 spaces.
fill(
' ',col);
831 if (cn==
'\n') lineNr++;
833 const int maxLineLength=4096;
834 char lineStr[maxLineLength];
842 char *
p = fgets(lineStr, maxLineLength,f);
854 }
while (size_read == (maxLineLength-1));
857 }
while (lineNr<=endLine && !feof(f));
860 int newLineIndex = result.
findRev(
'\n');
861 int braceIndex = result.
findRev(
'}');
862 if (braceIndex > newLineIndex)
900 const int maxAnchorStrLen = 20;
901 char anchorStr[maxAnchorStrLen];
920 static bool latexSourceCode =
Config_getBool(
"LATEX_SOURCE_CODE");
928 int lineMarkerPos = refText.
find(
"@0");
929 int fileMarkerPos = refText.
find(
"@1");
930 if (lineMarkerPos!=-1 && fileMarkerPos!=-1)
936 if (lineMarkerPos<fileMarkerPos)
942 if (!latexSourceCode)
968 fileMarkerPos-lineMarkerPos-2));
972 if (!latexSourceCode)
998 refText.
length()-fileMarkerPos-2));
1006 if (!latexSourceCode)
1018 if (latexSourceCode)
1032 lineMarkerPos-fileMarkerPos-2));
1036 if (!latexSourceCode)
1049 if (latexSourceCode)
1063 refText.
length()-lineMarkerPos-2));
1069 err(
"translation error: invalid markers in trDefinedInSourceFile()\n");
1108 actualStart,actualEnd,codeFragment)
1145 static bool latexSourceCode =
Config_getBool(
"LATEX_SOURCE_CODE");
1148 static bool refLinkSource =
Config_getBool(
"REFERENCES_LINK_SOURCE");
1161 int index=0,newIndex,matchLen;
1163 while ((newIndex=marker.
match(ldefLine,index,&matchLen))!=-1)
1167 uint entryIndex = ldefLine.
mid(newIndex+1,matchLen-1).
toUInt(&ok);
1174 if (!scope.
isEmpty() && scope!=scopeName)
1188 if (sourceBrowser &&
1200 if (!latexSourceCode)
1208 const int maxLineNrStr = 10;
1209 char anchorStr[maxLineNrStr];
1218 if (latexSourceCode)
1235 if (!latexSourceCode)
1252 if (latexSourceCode)
1268 index=newIndex+matchLen;
1371 err(
"Definition::addInnerCompound() called\n");
1532 if (!result.
isEmpty()) result+=
"/";
1535 result+=((
const GroupDef*)
this)->groupTitle();
1539 result+=((
const PageDef*)
this)->title();
1570 result+=((
const FileDef*)
this)->getDirDef()->navigationPathAsString();
1572 result+=
"<li class=\"navelem\">";
1588 if (name.
right(2)==
"-p" )
1617 navPath +=
"<div id=\"nav-path\" class=\"navpath\">\n" 1620 navPath +=
" </ul>\n" 1631 if (sectionDict==0)
return;
1645 for (li.toFirst();(si=li.current());++li)
1653 int nextLevel = (
int)si->
type;
1654 if (nextLevel>level)
1656 for (
l=level;
l<nextLevel;
l++)
1661 else if (nextLevel<level)
1663 for (
l=level;
l>nextLevel;
l--)
1670 cs[0]=
'0'+nextLevel;
1674 inLi[nextLevel]=
TRUE;
1735 int i=scopelessName.
findRev(
"::");
1736 if (i!=-1) scopelessName=scopelessName.
mid(i+2);
1745 const char *
p = briefDescAbbrev.
first();
1752 p = briefDescAbbrev.
next();
1759 if (c>=
'a' && c<=
'z') c+=
'A'-
'a';
1782 static bool reentering=
FALSE;
1944 static bool briefMemberDesc =
Config_getBool(
"BRIEF_MEMBER_DESC");
1958 if (!relPath.
isEmpty() && l>0 && result.
at(0)==
'.')
1963 if (l>0 && result.
at(l-1)!=
'/') result+=
'/';
QCString convertToXML(const char *s)
QCString symbolName() const
ParserInterface * getParser(const char *extension)
int _getXRefListId(const char *listName) const
virtual bool isLinkable() const =0
QCString stripWhiteSpace() const
bool isArtificial() const
virtual QCString trRTFTableOfContents()=0
virtual QCString getReference() const
QCString getReference() const
The QRegExp class provides pattern matching using regular expressions or wildcards.
void writeToc(OutputList &ol)
QCString convertNameToFile(const char *name, bool allowDots=FALSE) const
virtual bool isLinkableInProject() const =0
void setBodyDef(FileDef *fd)
void append(const type *d)
FILE * portable_popen(const char *name, const char *type)
Abstract interface for programming language parsers.
SectionDict * sectionDict
virtual void setName(const char *name)
QList< ListItemInfo > * xrefListItems() const
static QCString htmlFileExtension
void writeString(const char *text)
void writeSourceReffedBy(OutputList &ol, const char *scopeName)
QCString inbodyDocumentation() const
void setLanguage(SrcLangExt lang)
virtual void addInnerCompound(Definition *d)
void disableAllBut(OutputGenerator::OutputType o)
FileDef * getBodyDef() const
void setArtificial(bool b)
virtual bool hasDocumentation() const
void writeNavigationPath(OutputList &ol) const
virtual void setOuterScope(Definition *d)
QCString pathFragment() const
virtual bool isVisibleInProject() const
#define Config_getList(val)
QCString left(uint len) const
virtual QCString trDefinedAtLineInSourceFile()=0
virtual bool isReference() const
Simplified and optimized version of QTextStream.
void addSectionsToIndex()
int find(char c, int index=0, bool cs=TRUE) const
virtual QCString getOutputFileBase() const =0
virtual QCString displayName(bool includeScope=TRUE) const =0
GroupList * partOfGroups() const
void append(const char *key, const T *d)
int findRev(char c, int index=-1, bool cs=TRUE) const
QCString getFileFilter(const char *name, bool isSourceCode)
virtual void setInbodyDocumentation(const char *d, const char *docFile, int docLine)
void _writeSourceRefList(OutputList &ol, const char *scopeName, const QCString &text, MemberSDict *members, bool)
bool parseText(const QCString &textStr)
MemberSDict * getReferencesMembers() const
QCString getDefFileName() const
MemberSDict * sourceRefByDict
QCString getDefFileExtension() const
void writeDocAnchorsToTagFile(FTextStream &)
QCString transcodeCharacterStringToUTF8(const QCString &input)
#define Config_getEnum(val)
void _setBriefDescription(const char *b, const char *briefFile, int briefLine)
#define Config_getInt(val)
decltype(auto) constexpr size(T &&obj)
ADL-aware version of std::size.
static NamespaceDef * globalScope
static ParserManager * parserManager
virtual DefType definitionType() const =0
static void addToMap(const char *name, Definition *d)
QCString getLanguageSpecificSeparator(SrcLangExt lang, bool classScope)
static StringDict tagDestinationDict
MemberSDict * getReferencedByMembers() const
Q_EXPORT uint qstrlen(const char *str)
const QCString & name() const
static bool matchExcludedSymbols(const char *name)
QCString inbodyFile() const
QCString parseCommentAsText(const Definition *scope, const MemberDef *md, const QCString &doc, const QCString &fileName, int lineNr)
QCString getScopeString() const
void pushGeneratorState()
virtual QCString getSourceFileBase() const
virtual QCString getSourceAnchor() const
QCString navigationPathAsString() const
int endLine
line number of the end of the definition
bool hasBriefDescription() const
void MD5Buffer(const unsigned char *buf, unsigned int len, unsigned char sig[16])
QCString convertToHtml(const char *s, bool keepEntities)
void init(const char *df, const char *n)
QCString getSourceFileBase() const
QCString right(uint len) const
SrcLangExt getLanguage() const
void setLocalName(const QCString name)
static void print(DebugMask mask, int prio, const char *fmt,...)
static QDict< DefinitionIntf > * symbolMap
QCString & prepend(const char *s)
MemberSDict * sourceRefsDict
void disable(OutputGenerator::OutputType o)
void makePartOfGroup(GroupDef *gd)
static SectionDict * sectionDict
A bunch of utility functions.
void addSectionsToDefinition(QList< SectionInfo > *anchorList)
const char * data() const
virtual bool hasUserDocumentation() const
#define Config_getBool(val)
void setReference(const char *r)
virtual bool isVisible() const
QCString briefFile() const
bool isObjCMethod() const
virtual QCString qualifiedName() const
friend class IteratorDict
void err(const char *fmt,...)
static QDict< Definition > * clangUsrMap
void writeSourceRefs(OutputList &ol, const char *scopeName)
QCString absFilePath() const
virtual QCString briefDescription(bool abbreviate=FALSE) const
void addContentsItem(bool isDir, const char *name, const char *ref, const char *file, const char *anchor, bool separateIndex=FALSE, bool addToNavIndex=FALSE, Definition *def=0)
static bool stripWord(QCString &s, QCString w)
QCString mid(uint index, uint len=0xffffffff) const
int match(const QCString &str, int index=0, int *len=0, bool indexIsStart=TRUE) const
int nextUtf8CharPosition(const QCString &utf8Str, int len, int startPos)
QCString & sprintf(const char *format,...)
static bool lastCharIsMultibyte(const QCString &s)
const uint SDict_primes[]
virtual Definition * getOuterScope() const
void setRefItems(const QList< ListItemInfo > *sli)
void writeNavigationPath(const char *s)
int getEndBodyLine() const
virtual QCString trReferences()=0
bool readCodeFragment(const char *fileName, int &startLine, int &endLine, QCString &result)
virtual Definition * findInnerCompound(const char *name)
SrcLangExt getLanguageFromFileName(const QCString fileName)
int getStartBodyLine() const
void writeInlineCode(OutputList &ol, const char *scopeName)
void MD5SigToString(unsigned char signature[16], char *str, int len)
void _setDocumentation(const char *d, const char *docFile, int docLine, bool stripWhiteSpace, bool atTop)
int computeQualifiedIndex(const QCString &name)
void addSourceReferences(MemberDef *d)
void writeSourceDef(OutputList &ol, const char *scopeName)
QCString stripScope(const char *name)
Definition(const char *defFileName, int defLine, int defColumn, const char *name, const char *b=0, const char *d=0, bool isSymbol=TRUE)
void addSourceReferencedBy(MemberDef *d)
void setId(const char *name)
A model of a page symbol.
uint toUInt(bool *ok=0) const
int portable_pclose(FILE *stream)
virtual void setBriefDescription(const char *b, const char *briefFile, int briefLine)
virtual QCString trReferencedBy()=0
QCString convertNameToFile(const char *name, bool allowDots, bool allowUnderscore)
bool fill(char c, int len=-1)
void mergeRefItems(Definition *d)
QCString getOutputFileBase() const
QList< ListItemInfo > * xrefListItems
QCString abbreviate(const char *s, const char *name)
Translator * theTranslator
virtual void setDocumentation(const char *d, const char *docFile, int docLine, bool stripWhiteSpace=TRUE)
bool removeRef(const type *d)
QCString briefDescriptionAsTooltip() const
void _setInbodyDocumentation(const char *d, const char *docFile, int docLine)
QCString stripLeadingAndTrailingEmptyLines(const QCString &s, int &docLine)
QCString externalReference(const QCString &relPath) const
void docify(const char *s)
Q_EXPORT int qstrcmp(const char *str1, const char *str2)
virtual QCString trWriteList(int numEntries)=0
T * find(const char *key)
virtual QCString documentation() const
void writeObjectLink(const char *ref, const char *file, const char *anchor, const char *name)
static void removeFromMap(Definition *d)
void setAutoDelete(bool enable)
virtual void parseCode(CodeOutputInterface &codeOutIntf, const char *scopeName, const QCString &input, SrcLangExt lang, bool isExampleBlock, const char *exampleName=0, FileDef *fileDef=0, int startLine=-1, int endLine=-1, bool inlineFragment=FALSE, MemberDef *memberDef=0, bool showLineNumbers=TRUE, Definition *searchCtx=0, bool collectXRefs=TRUE)=0
FILE * portable_fopen(const char *fileName, const char *mode)
void _setSymbolName(const QCString &name)
QCString & replace(uint index, uint len, const char *s)
QCString localName() const
const char * qPrint(const char *s)
bool _docsAlreadyAdded(const QCString &doc, QCString &sigList)
static IndexList * indexList
QCString simplifyWhiteSpace() const
QCString substitute(const QCString &s, const QCString &src, const QCString &dst)
substitute all occurrences of src in s by dst
virtual QCString anchor() const =0
QTextStream & endl(QTextStream &s)
FileDef * fileDef
file definition containing the function body
int startLine
line number of the start of the definition
virtual void setHidden(bool b)
void setBodySegment(int bls, int ble)
virtual void resetCodeParserState()=0