45 #define START_MARKER 0x4445465B // DEF[
46 #define END_MARKER 0x4445465D // DEF]
57 void init(
const char *df,
const char *n);
93 : sectionDict(0), sourceRefByDict(0), sourceRefsDict(0),
94 xrefListItems(0), partOfGroups(0),
95 details(0), inbodyDocs(0),
brief(0), body(0), hidden(FALSE), isArtificial(FALSE),
122 if (name!=
"<globalScope>")
153 if (exclSyms.count()==0)
return FALSE;
154 const char *pat = exclSyms.first();
155 QCString symName = name;
158 QCString pattern = pat;
159 bool forceStart=FALSE;
161 if (pattern.at(0)==
'^')
162 pattern=pattern.mid(1),forceStart=TRUE;
163 if (pattern.at(pattern.length()-1)==
'$')
164 pattern=pattern.left(pattern.length()-1),forceEnd=TRUE;
165 if (pattern.find(
'*')!=-1)
167 QRegExp re(
substitute(pattern,
"*",
".*"),TRUE);
169 i = re.match(symName,0,&pl);
173 int sl=symName.length();
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))
184 else if (!pattern.isEmpty())
186 int i = symName.find(pattern);
189 int pl=pattern.length();
190 int sl=symName.length();
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);
213 if (!symbolName.isEmpty())
244 static int sizeIndex=9;
257 if (!symbolName.isEmpty())
267 bool b = dl->removeRef(d);
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)
351 for (it.toFirst();(gd=it.current());++it)
420 if (!anchorList)
return;
422 QListIterator<SectionInfo> it(*anchorList);
424 for (;(si=it.current());++it)
454 for (li.toFirst();(si=li.current());++li)
474 for (li.toFirst();(si=li.current());++li)
482 int nextLevel = (int)si->
type;
486 for (i=level;i<nextLevel;i++)
491 else if (nextLevel<level)
493 for (i=nextLevel;i<level;i++)
498 QCString title = si->
title;
499 if (title.isEmpty()) title = si->
label;
502 bool isDir = ((li.current()) ? (
int)(li.current()->type > nextLevel):FALSE);
527 for (;(si=sdi.current());++sdi)
533 tagFile <<
" <docanchor file=\"" << si->
fileName <<
"\"";
534 if (!si->
title.isEmpty())
538 tagFile <<
">" << si->
label <<
"</docanchor>" <<
endl;
550 QCString docStr = doc.simplifyWhiteSpace();
551 MD5Buffer((
const unsigned char *)docStr.data(),docStr.length(),md5_sig);
552 MD5SigToString(md5_sig,sigStr.rawData(),33);
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";
639 brief = brief.stripWhiteSpace();
640 if (brief.isEmpty())
return;
641 int bl = brief.length();
642 if (bl>0 && needsDot)
644 int c = brief.at(bl-1);
647 case '.':
case '!':
case '?':
case '>':
case ':':
case ')':
break;
729 int &startLine,
int &endLine,QCString &result)
731 static bool filterSourceFiles =
Config_getBool(FILTER_SOURCE_FILES);
734 if (fileName==0 || fileName[0]==0)
return FALSE;
737 bool usePipe = !filter.isEmpty() && filterSourceFiles;
745 QCString cmd=filter+
" \""+fileName+
"\"";
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);
846 size_read=qstrlen(p);
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)
864 result.truncate(braceIndex+1);
881 if (!result.isEmpty() && result.at(result.length()-1)!=
'\n') result +=
"\n";
901 const int maxAnchorStrLen = 20;
902 char anchorStr[maxAnchorStrLen];
929 int lineMarkerPos = refText.find(
"@0");
930 int fileMarkerPos = refText.find(
"@1");
931 if (lineMarkerPos!=-1 && fileMarkerPos!=-1)
937 if (lineMarkerPos<fileMarkerPos)
940 ol.
parseText(refText.left(lineMarkerPos));
943 if (!latexSourceCode)
968 ol.
parseText(refText.mid(lineMarkerPos+2,
969 fileMarkerPos-lineMarkerPos-2));
973 if (!latexSourceCode)
999 refText.length()-fileMarkerPos-2));
1004 ol.
parseText(refText.left(fileMarkerPos));
1007 if (!latexSourceCode)
1019 if (latexSourceCode)
1032 ol.
parseText(refText.mid(fileMarkerPos+2,
1033 lineMarkerPos-fileMarkerPos-2));
1037 if (!latexSourceCode)
1050 if (latexSourceCode)
1064 refText.length()-lineMarkerPos-2));
1070 err(
"translation error: invalid markers in trDefinedInSourceFile()\n");
1106 QCString codeFragment;
1109 actualStart,actualEnd,codeFragment)
1149 static bool refLinkSource =
Config_getBool(REFERENCES_LINK_SOURCE);
1161 QRegExp marker(
"@[0-9]+");
1162 int index=0,newIndex,matchLen;
1164 while ((newIndex=marker.match(ldefLine,index,&matchLen))!=-1)
1167 ol.
parseText(ldefLine.mid(index,newIndex-index));
1168 uint entryIndex = ldefLine.mid(newIndex+1,matchLen-1).toUInt(&ok);
1175 if (!scope.isEmpty() && scope!=scopeName)
1189 if (sourceBrowser &&
1201 if (!latexSourceCode)
1209 const int maxLineNrStr = 10;
1210 char anchorStr[maxLineNrStr];
1219 if (latexSourceCode)
1236 if (!latexSourceCode)
1253 if (latexSourceCode)
1269 index=newIndex+matchLen;
1271 ol.
parseText(ldefLine.right(ldefLine.length()-index));
1326 if (!scope.isEmpty())
1328 name.prepend(scope+
"::");
1349 if (!scope.isEmpty())
1351 name.prepend(scope+
"::");
1372 err(
"Definition::addInnerCompound() called\n");
1456 QListIterator<ListItemInfo> slii(*sli);
1458 for (slii.toFirst();(lii=slii.current());++slii)
1477 QListIterator<ListItemInfo> slii(*xrefList);
1479 for (slii.toFirst();(lii=slii.current());++slii)
1495 for (slii.toFirst();(lii=slii.current());++slii)
1497 if (qstrcmp(lii->
type,listName)==0)
1520 if (!result.isEmpty()) result+=
"/";
1523 result+=((
const GroupDef*)
this)->groupTitle();
1527 result+=((
const PageDef*)
this)->title();
1558 result+=((
const FileDef*)
this)->getDirDef()->navigationPathAsString();
1560 result+=
"<li class=\"navelem\">";
1575 QCString
name = locName;
1576 if (name.right(2)==
"-p" )
1578 name = name.left(name.length()-2);
1605 navPath +=
"<div id=\"nav-path\" class=\"navpath\">\n"
1608 navPath +=
" </ul>\n"
1619 if (sectionDict==0)
return;
1632 bool inLi[5]={ FALSE, FALSE, FALSE, FALSE };
1633 for (li.toFirst();(si=li.current());++li)
1641 int nextLevel = (int)si->
type;
1642 if (nextLevel>level)
1644 for (l=level;l<nextLevel;l++)
1649 else if (nextLevel<level)
1651 for (l=level;l>nextLevel;l--)
1658 cs[0]=
'0'+nextLevel;
1661 ol.
writeString(
"<li class=\"level"+QCString(cs)+
"\"><a href=\"#"+si->
label+
"\">"+(si->
title.isEmpty()?si->
label:titleDoc)+
"</a>");
1662 inLi[nextLevel]=TRUE;
1710 if (s.left(w.length())==w)
1713 s=s.right(s.length()-w.length());
1722 QCString scopelessName=name;
1723 int i=scopelessName.findRev(
"::");
1724 if (i!=-1) scopelessName=scopelessName.mid(i+2);
1726 result=result.stripWhiteSpace();
1728 if (!result.isEmpty() && result.at(result.length()-1)==
'.')
1729 result=result.left(result.length()-1);
1733 const char *p = briefDescAbbrev.first();
1737 s.replace(QRegExp(
"\\$name"), scopelessName);
1740 p = briefDescAbbrev.next();
1744 if (!result.isEmpty())
1747 if (c>=
'a' && c<=
'z') c+=
'A'-
'a';
1770 static bool reentering=FALSE;
1786 return QCString(
"");
1886 for (gli.toFirst();(gd=gli.current());++gli)
1959 QCString result = *dest;
1960 int l = result.length();
1961 if (!relPath.isEmpty() && l>0 && result.at(0)==
'.')
1963 result.prepend(relPath);
1964 l+=relPath.length();
1966 if (l>0 && result.at(l-1)!=
'/') result+=
'/';