浏览该文件的文档.
25 #include <unordered_set>
77 #define ENABLE_TRACINGSUPPORT 0
79 #if defined(_OS_MAC_) && ENABLE_TRACINGSUPPORT
80 #define TRACINGSUPPORT
91 #define REL_PATH_TO_ROOT "../../"
93 static const char *
hex =
"0123456789ABCDEF";
109 const char *p=s.
data();
132 for (i=0;i<indent;i++)
172 auto startsWithColon = [](
const std::string &del)
174 for (
size_t i=0;i<del.size();i++)
176 if (del[i]==
'@')
return false;
177 else if (del[i]==
':')
return true;
183 auto endsWithColon = [](
const std::string &del)
185 for (
int i=(
int)del.size()-1;i>=0;i--)
187 if (del[i]==
'@')
return false;
188 else if (del[i]==
':')
return true;
193 static const reg::Ex re(R
"([\s:]*@\d+[\s:]*)");
194 std::string s = str.str();
198 size_t sl=s.length();
199 bool needsSeparator=
false;
200 for ( ; iter!=
end ; ++iter)
202 const auto &
match = *iter;
203 size_t i =
match.position();
206 if (needsSeparator) result+=
"::";
207 needsSeparator=
false;
208 result+=s.substr(p,i-p);
210 std::string delim =
match.str();
211 needsSeparator = needsSeparator || (startsWithColon(delim) && endsWithColon(delim));
216 if (needsSeparator) result+=
"::";
226 static const reg::Ex marker(R
"(@\d+)");
228 replacement.isEmpty() ? replacement.data() : "__anonymous__");
247 if (!newScope.
isEmpty()) newScope+=
"::";
248 newScope+=s.
mid(i,l);
253 if (!newScope.
isEmpty()) newScope+=
"::";
254 newScope+=s.
right(sl-i);
286 const int maxMarkerStrLen = 20;
287 char result[maxMarkerStrLen];
288 qsnprintf(result,maxMarkerStrLen,
"@%d",
id);
296 unsigned int length = 0;
297 for (
const auto &s : l)
300 if (prefix.
length() > length &&
307 if (length)
return potential;
334 if (n.
right(2)==
".c" ||
336 n.
right(4)==
".cxx" ||
337 n.
right(4)==
".cpp" ||
338 n.
right(4)==
".c++" ||
339 n.
right(5)==
".java" ||
343 n.
right(4)==
".ixx" ||
344 n.
right(4)==
".ipp" ||
345 n.
right(4)==
".i++" ||
346 n.
right(4)==
".inl" ||
347 n.
right(4)==
".xml" ||
348 n.
right(4)==
".lex" ||
351 if (n.
right(2)==
".h" ||
353 n.
right(4)==
".hxx" ||
354 n.
right(4)==
".hpp" ||
355 n.
right(4)==
".h++" ||
356 n.
right(4)==
".idl" ||
357 n.
right(4)==
".ddl" ||
358 n.
right(5)==
".pidl" ||
377 if (typedefContext) *typedefContext=context;
380 int scopeIndex = qualifiedName.
findRev(
"::");
384 resName=qualifiedName.
right(qualifiedName.
length()-scopeIndex-2);
393 while (mContext && md==0)
410 if (!tmp.
isEmpty()) qualScopePart=tmp;
413 if (resScope==0)
break;
437 for (
const auto &tmd_p : *mn)
447 if (dist!=-1 && (md==0 || dist<minDist))
467 if (args.
find(
")(")!=-1)
471 else if (args.
find(
'[')!=-1)
488 int i = name.
find(
'<');
497 static const char constScope[] = {
'c',
'o',
'n',
's',
't',
':' };
498 static const char volatileScope[] = {
'v',
'o',
'l',
'a',
't',
'i',
'l',
'e',
':' };
499 static const char virtualScope[] = {
'v',
'i',
'r',
't',
'u',
'a',
'l',
':' };
500 static const char operatorScope[] = {
'o',
'p',
'e',
'r',
'a',
't',
'o',
'r',
'?',
'?',
'?' };
556 if ((
int)s.
length()*3>growBufLen)
558 growBufLen = s.
length()*3;
559 growBuf = (
char *)realloc(growBuf,growBufLen+1);
561 if (growBuf==0)
return s;
563 const char *src=s.
data();
582 char nc=i<l-1 ? src[i+1] :
' ';
638 if (c==
'\\' && i+1<l)
665 (
isId(pc) || pc==
'*' || pc==
'&' || pc==
'.' || pc==
'>') &&
666 (osp<8 || (osp==8 && pc!=
'-'))
672 if (i<l-1 && (nc==
'-' || nc==
'&'))
680 ((i<l-1 && (
isId(nc) || nc==
'[')) ||
681 (i<l-2 && nc==
'$' &&
isId(src[i+2])) ||
682 (i<l-3 && nc==
'&' && src[i+2]==
'$' &&
isId(src[i+3]))
692 if (cliSupport && i<l-1 && (
isId(nc) || nc==
'-'))
699 if (i<l-1 && (
isId(nc) || nc==
'-'))
705 if (i>0 && pc!=
' ' && pc!=
'\t' && pc!=
':' &&
706 pc!=
'*' && pc!=
'&' && pc!=
'(' && pc!=
'/' &&
716 if (i>0 &&
isId(pc) && osp<9)
736 if (i>0 && i<l-1 && pc!=
'=' && pc!=
':' && !
isspace((
uchar)pc) &&
767 !(pc==
',' && nc==
'.') &&
768 (osp<8 || (osp>=8 &&
isId(pc) &&
isId(nc)))
776 else if ((pc==
'*' || pc==
'&' || pc==
'.') && nc==
'>')
784 if (c==
't' && csp==5 && i<l-1 &&
791 else if (c==
'e' && vosp==8 && i<l-1 &&
798 else if (c==
'l' && vsp==7 && i<l-1 &&
824 if (templateDepth > 0)
826 int nextOpenPos=name.
findRev(
'>', pos);
827 int nextClosePos=name.
findRev(
'<', pos);
828 if (nextOpenPos!=-1 && nextOpenPos>nextClosePos)
833 else if (nextClosePos!=-1)
845 int lastAnglePos=name.
findRev(
'>', pos);
846 int bracePos=name.
findRev(
'(', pos);
847 if (lastAnglePos!=-1 && lastAnglePos>bracePos)
854 int bp = bracePos>0 ? name.
findRev(
'(',bracePos-1) : -1;
856 return bp==-1 || (bp>=8 && name.
mid(bp-8,10)==
"operator()") ? bracePos : bp;
867 return (name==scope ||
868 (scope.
right(nl)==name &&
869 sl-nl>1 && scope.
at(sl-nl-1)==
':' && scope.
at(sl-nl-2)==
':'
878 return (name==scope ||
879 (scope.
left(nl)==name &&
880 sl>nl+1 && scope.
at(nl)==
':' && scope.
at(nl+1)==
':'
888 const QCString &text,
bool autoBreak,
bool external,
889 bool keepSpaces,
int indentLevel)
893 std::string txtStr=text.
str();
894 size_t strLen = txtStr.length();
895 if (strLen==0)
return;
897 static const reg::Ex regExp(R
"(\a[\w~!\\.:$]*)");
907 size_t floatingIndex=0;
908 for (; it!=
end ; ++it)
910 const auto &
match = *it;
911 size_t newIndex =
match.position();
912 size_t matchLen =
match.length();
913 floatingIndex+=newIndex-skipIndex+matchLen;
914 if (newIndex>0 && txtStr.at(newIndex-1)==
'0')
916 std::string part = txtStr.substr(skipIndex,newIndex+matchLen-skipIndex);
918 skipIndex=index=newIndex+matchLen;
923 bool insideString=
FALSE;
924 for (
size_t i=index;i<newIndex;i++)
926 if (txtStr.at(i)==
'"') insideString=!insideString;
930 if (strLen>35 && floatingIndex>30 && autoBreak)
932 std::string splitText = txtStr.substr(skipIndex,newIndex-skipIndex);
933 size_t splitLength = splitText.length();
935 size_t i = splitText.find(
',');
936 if (i==std::string::npos) { i=splitText.find(
'<');
if (i!=std::string::npos) offset=0; }
937 if (i==std::string::npos) i=splitText.find(
'>');
938 if (i==std::string::npos) i=splitText.find(
' ');
940 if (i!=std::string::npos)
942 std::string part1 = splitText.substr(0,i+offset);
944 out.
writeBreak(indentLevel==0 ? 0 : indentLevel+1);
945 std::string part2 = splitText.substr(i+offset);
947 floatingIndex=splitLength-i-offset+matchLen;
957 std::string part = txtStr.substr(skipIndex,newIndex-skipIndex);
961 std::string word=txtStr.substr(newIndex,matchLen);
994 if (!found && (cd || (cd=
getClass(matchWord))))
1007 else if ((cd=
getClass(matchWord+
"-p")))
1036 int m = matchWord.
findRev(
"::");
1044 scopeName=scope->
name();
1048 scopeName = matchWord.
left(m);
1049 matchWord = matchWord.
mid(m+2);
1065 if (md!=
self && (
self==0 || md->
name()!=self->name()))
1074 md->
anchor(),word.c_str());
1088 skipIndex=index=newIndex+matchLen;
1092 std::string lastPart = txtStr.substr(skipIndex);
1097 std::function<
void(
size_t)> replaceFunc)
1099 static const reg::Ex marker(R
"(@(\d+))");
1104 for ( ; it!=
end ; ++it)
1106 const auto &
match = *it;
1107 size_t newIndex =
match.position();
1108 size_t matchLen =
match.length();
1109 ol.
parseText(markerText.substr(index,newIndex-index));
1110 unsigned long entryIndex = std::stoul(
match[1].str());
1111 if (entryIndex<(
unsigned long)numMarkers)
1113 replaceFunc(entryIndex);
1115 index=newIndex+matchLen;
1122 auto replaceFunc = [&list,&ol](
size_t entryIndex)
1124 const auto &e = list[entryIndex];
1154 for (
auto it = al.
begin() ; it!=al.
end() ;)
1159 int i=type1.
find(
")(");
1163 type1=type1.
left(i);
1171 result+= type1+
" "+a.
name+type2+a.
array;
1175 result+= type1+type2;
1182 if (it!=al.
end()) result+=
", ";
1197 if (al.
empty())
return result;
1200 for (
const auto &a : al)
1202 if (a.defval.isEmpty() || includeDefault)
1204 if (!first) result+=
", ";
1205 if (!a.name.isEmpty())
1216 while (i>=0 &&
isId(a.type.at(i))) i--;
1219 result+=a.type.
right(a.type.length()-i-1);
1220 if (a.type.find(
"...")!=-1)
1232 result+=
" extends ";
1233 result+=a.typeConstraint;
1262 if (src<len && buf[src] ==
'\n')
1265 else if ( c ==
'\0' && src<len-1)
1278 for (
const auto &filterStr : filterList)
1281 int i_equals=fs.
find(
'=');
1288 filterPattern = filterPattern.
lower();
1289 input = input.
lower();
1296 if (filterName.
find(
' ')!=-1)
1298 filterName=
"\""+filterName+
"\"";
1318 if (name.
isEmpty())
return "";
1325 if (isSourceCode && !filterSrcList.empty())
1329 if (!found && filterName.
isEmpty())
1340 if ((filterName.
right(1) ==
"\"") && (filterName.
left(1) ==
"\""))
1354 const char *outputEncoding =
"UTF-8";
1355 if (inputEncoding.
isEmpty() ||
qstricmp(inputEncoding,outputEncoding)==0)
return input;
1356 int inputSize=input.
length();
1357 int outputSize=inputSize*4+1;
1360 if (cd==(
void *)(-1))
1362 err(
"unsupported character conversion: '%s'->'%s'\n",
1363 qPrint(inputEncoding),outputEncoding);
1368 size_t iLeft=inputSize;
1369 size_t oLeft=outputSize;
1370 const char *inputPtr = input.
data();
1371 char *outputPtr = output.
rawData();
1374 outputSize-=(int)oLeft;
1375 output.
resize(outputSize+1);
1376 output.
at(outputSize)=
'\0';
1381 err(
"failed to translate characters from %s to %s: check INPUT_ENCODING\ninput=[%s]\n",
1387 return error ? input : output;
1397 bool fileOpened=
false;
1398 if (name[0]==
'-' && name[1]==0)
1401 std::string contents;
1403 while (getline(std::cin,line))
1405 contents+=line+
'\n';
1414 err(
"file '%s' not found\n",
qPrint(name));
1422 if (s>1 && buf.
at(s-2)!=
'\n')
1432 err(
"cannot open file '%s' for reading\n",
qPrint(name));
1440 if (!sourceDateEpoch.
isEmpty())
1446 static bool warnedOnce=
FALSE;
1449 warn_uncond(
"Environment variable SOURCE_DATE_EPOCH does not contain a valid number; value is '%s'\n",
1450 qPrint(sourceDateEpoch));
1456 auto epoch_start = std::chrono::time_point<std::chrono::system_clock>{};
1457 auto epoch_seconds = std::chrono::seconds(epoch);
1458 auto build_time = epoch_start + epoch_seconds;
1459 std::time_t time = std::chrono::system_clock::to_time_t(build_time);
1460 return *gmtime(&time);
1465 auto now = std::chrono::system_clock::now();
1466 std::time_t time = std::chrono::system_clock::to_time_t(now);
1467 return *localtime(&time);
1476 (current.tm_wday+6)%7+1,
1492 for (
const auto &bcd : bcl)
1513 if (target==str) { target.
resize(0);
return; }
1517 while ((i=target.
find(str,p))!=-1)
1519 bool isMatch = (i==0 || !
isId(target.
at(i-1))) &&
1523 int i1=target.
find(
'*',i+l);
1524 int i2=target.
find(
'&',i+l);
1525 if (i1==-1 && i2==-1)
1532 else if ((i1!=-1 && i<i1) || (i2!=-1 && i<i2))
1580 int i=s.
find(
" class ");
1581 if (i!=-1)
return s.
left(i)+s.
mid(i+6);
1582 i=s.
find(
" typename ");
1583 if (i!=-1)
return s.
left(i)+s.
mid(i+9);
1584 i=s.
find(
" union ");
1585 if (i!=-1)
return s.
left(i)+s.
mid(i+6);
1586 i=s.
find(
" struct ");
1587 if (i!=-1)
return s.
left(i)+s.
mid(i+7);
1600 if (!templSpec.
isEmpty() && templSpec.
at(0) ==
'<')
1607 templSpec = resolvedType;
1618 if (count>10)
return word;
1620 QCString symName,result,templSpec,tmpName;
1621 if (tSpec && !tSpec->
isEmpty())
1644 bool isTemplInst = cd && !templSpec.
isEmpty();
1645 if (!cd && !templSpec.
isEmpty())
1677 if (cd==d && tSpec) *tSpec=
"";
1681 result = resolvedType+ts;
1689 if (tSpec) *tSpec=
"";
1703 result=cd->
name()+templSpec;
1754 result = resolvedType;
1786 if (i>pp) canType += type.
mid(pp,i-pp);
1807 std::string ts = templSpec.
str();
1808 static const reg::Ex re(R
"(\a\w*)");
1815 for (; it!=
end ; ++it)
1817 const auto &
match = *it;
1818 size_t ti =
match.position();
1819 size_t tl =
match.length();
1820 std::string matchStr =
match.str();
1821 canType += ts.substr(tp,ti-tp);
1825 canType+=ts.substr(tp);
1841 if ((type==
"const" || type==
"volatile") && !name.
isEmpty())
1846 if (name==
"const" || name==
"volatile")
1848 if (!type.
isEmpty()) type+=
" ";
1885 srcA.
type+=sSrcName;
1889 else if (sDstName==srcType.
right(sDstName.
length()))
1891 dstA.
type+=sDstName;
1923 ASSERT(srcScope!=0 && dstScope!=0);
1925 if (srcAl==0 || dstAl==0)
1927 bool match = srcAl==dstAl;
1958 if (srcAl->
size() != dstAl->
size())
1986 auto srcIt = srcAl->
begin();
1987 auto dstIt = dstAl->
begin();
1988 for (;srcIt!=srcAl->
end() && dstIt!=dstAl->
end();++srcIt,++dstIt)
1993 dstScope,dstFileScope,dstA)
2018 auto srcIt=srcAl.
begin();
2019 auto dstIt=dstAl.
begin();
2020 while (srcIt!=srcAl.
end() && dstIt!=dstAl.
end())
2038 if (srcA.
name==
"const" || srcA.
name==
"volatile")
2043 if (dstA.
name==
"const" || dstA.
name==
"volatile")
2069 if (forceNameOverwrite)
2121 else if (i1==-1 && i2!=-1 && dstA.
type.
right(j2)==srcA.
type)
2149 std::vector<const MemberDef *> &members)
2153 for (
const auto &md_p : *mn)
2164 currentFile==0 || fd==currentFile)
2180 members.push_back(md);
2216 bool forceEmptyScope,
2221 fd=0, md=0, cd=0, nd=0, gd=0;
2227 memberName =
substitute(memberName,
"\\",
"::");
2233 while ((is=scopeName.
findRev(
"::"))!=-1 &&
2234 (im=memberName.
find(
"::",pm))!=-1 &&
2235 (scopeName.
right(scopeName.
length()-is-2)==memberName.
mid(pm,im-pm))
2238 scopeName=scopeName.
left(is);
2246 if (memberName.
left(9)!=
"operator " &&
2248 (im=memberName.
findRev(
"::"))!=-1 &&
2249 im<(
int)memberName.
length()-2
2252 mScope=memberName.
left(im);
2257 if (mScope==scopeName) scopeName.
resize(0);
2264 if ((!forceEmptyScope || scopeName.
isEmpty()) &&
2268 int scopeOffset=scopeName.
length();
2274 className+=
"::"+mScope;
2285 if (fcd==0 && className.
find(
'<')!=-1)
2299 std::unique_ptr<ArgumentList> argList;
2304 for (
const auto &mmd_p : *mn)
2321 if (m<mdist && mcd->isLinkable())
2335 for (
const auto &mmd_p : *mn)
2345 if (m<mdist /* && mcd->isLinkable()*/ )
2378 if (emd->localName()==mName)
2380 if (emd->isLinkable())
2400 else if ((scopeOffset=scopeName.
findRev(
"::",scopeOffset-1))==-1)
2404 }
while (scopeOffset>=0);
2411 std::unique_ptr<ArgumentList> argList;
2412 bool hasEmptyArgs = args==
"()";
2419 for (
const auto &mmd_p : *mn)
2445 if (!fuzzy_mmd && hasEmptyArgs)
2467 int scopeOffset=scopeName.
length();
2473 namespaceName+=
"::"+mScope;
2477 namespaceName=mScope;
2480 if (!namespaceName.
isEmpty() &&
2488 for (
const auto &mmd_p : *mn)
2516 if (!args.
isEmpty() && args!=
"()")
2534 if (!found && args==
"()")
2538 for (
const auto &mmd_p : *mn)
2569 for (
const auto &mmd_p : *mn)
2574 int ni=namespaceName.
findRev(
"::");
2580 (notInNS || sameNS) &&
2598 else if ((scopeOffset=scopeName.
findRev(
"::",scopeOffset-1))==-1)
2602 }
while (scopeOffset>=0);
2606 std::vector<const MemberDef *> members;
2609 if (members.empty())
2615 if (members.size()!=1 && args==
"()")
2621 for (
auto it = mn->
rbegin(); it!=mn->
rend(); ++it)
2623 const auto &mmd_p = *it;
2635 members.push_back(mmd);
2640 if (!members.empty())
2645 for (
const auto &rmd : members)
2647 if (rmd->getFileDef() && rmd->getFileDef()->name() == currentFile->
name())
2702 bool explicitGlobalScope=
FALSE;
2703 if (scopeName.
at(0)==
':' && scopeName.
at(1)==
':')
2706 explicitGlobalScope=
TRUE;
2714 int scopeOffset=explicitGlobalScope ? 0 : docScopeName.
length();
2719 if (scopeOffset>0) fullName.
prepend(docScopeName.
left(scopeOffset)+
"::");
2736 else if ((scopeOffset=docScopeName.
findRev(
"::",scopeOffset-1))==-1)
2740 }
while (scopeOffset>=0);
2750 while ((c=*p++))
if (!islower(c))
return false;
2762 bool lookForSpecialization,
2771 if (fullName.
find(
"anonymous_namespace{")==-1)
2781 int endNamePos=bracePos!=-1 ? bracePos : fullName.
length();
2782 int scopePos=fullName.
findRev(
"::",endNamePos);
2783 bool explicitScope = fullName.
left(2)==
"::" &&
2785 tsName.
left(2)==
"::" ||
2800 if (!inSeeBlock && scopePos==-1 &&
isLowerCase(tsName))
2808 if (scName!=fullName &&
getScopeDefs(scName,fullName,cd,nd))
2821 else if (scName==fullName || (!inSeeBlock && scopePos==-1))
2834 if (explicitScope) nameStr=nameStr.
mid(2);
2838 if (bracePos!=-1) argsStr=fullName.
right(fullName.
length()-bracePos);
2842 int templPos=nameStr.
find(
'<');
2843 bool tryUnspecializedVersion =
FALSE;
2844 if (templPos!=-1 && nameStr.
find(
"operator")==-1)
2846 int endTemplPos=nameStr.
findRev(
'>');
2847 if (endTemplPos!=-1)
2849 if (!lookForSpecialization)
2851 nameStr=nameStr.
left(templPos)+nameStr.
right(nameStr.
length()-endTemplPos-1);
2855 tryUnspecializedVersion =
TRUE;
2872 if (
getDefs(scopeStr,nameStr,argsStr,
2895 if (md) { *resMember=md; *resContext=md; }
2896 else if (cd) *resContext=cd;
2897 else if (nd) *resContext=nd;
2898 else if (fd) *resContext=fd;
2899 else if (gd) *resContext=gd;
2900 else { *resContext=0; *resMember=0;
return FALSE; }
2915 else if (tsName.
find(
'.')!=-1)
2926 if (tryUnspecializedVersion)
2928 return resolveRef(scName,name,inSeeBlock,resContext,resMember,
FALSE,0,checkScope);
2952 if (!isFileName && result.
find(
'<')==-1) result=
substitute(result,
".",
"::",3);
2954 if (result.
at(0)==
':' && result.
at(1)==
':')
2988 const char *name,
bool inSeeBlock,
const char *rt)
2998 if (
resolveRef(scName,name,inSeeBlock,&compound,&md))
3016 linkText=((
GroupDef *)compound)->groupTitle();
3069 if (si) resAnchor = si->
label();
3080 resAnchor = si->
label();
3105 else if ((cd=
getClass(linkRefWithoutTemplates)))
3111 else if ((cd=
getClass(linkRef+
"-p")))
3138 if (md) resAnchor=md->
anchor();
3159 if (
resolveLink(clName,lr,inSeeBlock,&compound,anchor))
3167 linkText=(
toGroupDef(compound))->groupTitle();
3182 err(
"%s:%d: Internal error: resolveLink successful but no compound found!",__FILE__,__LINE__);
3229 const int maxAddrSize = 20;
3230 char addr[maxAddrSize];
3231 qsnprintf(addr,maxAddrSize,
"%p:",(
void*)fnMap);
3239 ambig = cachedResult->
isAmbig;
3252 if (name.
isEmpty())
goto exit;
3256 path=name.
left(slashPos+1);
3259 if (name.
isEmpty())
goto exit;
3260 if ((fn=fnMap->find(name)))
3265 const std::unique_ptr<FileDef> &fd = fn->front();
3267 fd->getPath().right(path.
length())==path :
3269 if (path.
isEmpty() || isSamePath)
3271 cachedResult->
fileDef = fd.get();
3280 for (
const auto &fd_p : *fn)
3292 cachedResult->
isAmbig = ambig;
3293 cachedResult->
fileDef = lastMatch;
3316 path=name.
left(slashPos+1);
3320 if ((fn=fnMap->
find(name)))
3322 for (
const auto &fd : *fn)
3324 if (path.
isEmpty() || fd->getPath().right(path.
length())==path)
3326 result+=
" "+fd->absFilePath()+
"\n";
3343 result =
substitute(result,
"$doxygenversion",getDoxygenVersion());
3344 result =
substitute(result,
"$projectname",projName);
3345 result =
substitute(result,
"$projectnumber",projNum);
3346 result =
substitute(result,
"$projectbrief",projBrief);
3361 for (
const auto &s : sl)
3363 const char *ps=s.c_str();
3364 const char *pd=name.
data();
3366 while (*ps!=0 && *pd!=0 && *ps==*pd) ps++,pd++,i++;
3367 if (*ps==0 && *pd!=0)
3383 int getUtf8Char(
const char *input,
char ids[MAX_UTF8_CHAR_SIZE],CaseModifier modifier)
3386 const unsigned char uc = (
unsigned char)*input;
3387 bool validUTF8Char =
false;
3390 const char* pt = input+1;
3392 if ((uc&0x80)==0x00)
3396 case CaseModifier::None: ids[0]=*input;
break;
3397 case CaseModifier::ToUpper: ids[0]=(char)toupper(*input);
break;
3398 case CaseModifier::ToLower: ids[0]=(char)tolower(*input);
break;
3405 if ((uc&0xE0)==0xC0)
3409 if ((uc&0xF0)==0xE0)
3413 if ((uc&0xF8)==0xF0)
3418 validUTF8Char = l>0;
3419 for (
int m=1; m<l && validUTF8Char; ++m)
3421 unsigned char ct = (
unsigned char)*pt;
3422 if (ct==0 || (ct&0xC0)!=0x80)
3424 validUTF8Char=
false;
3444 if (name.
isEmpty())
return name;
3449 const char *p=name.
data();
3454 case '_':
if (allowUnderscore) growBuf.
addChar(
'_');
else growBuf.
addStr(
"__");
break;
3455 case '-': growBuf.
addChar(
'-');
break;
3456 case ':': growBuf.
addStr(
"_1");
break;
3457 case '/': growBuf.
addStr(
"_2");
break;
3458 case '<': growBuf.
addStr(
"_3");
break;
3459 case '>': growBuf.
addStr(
"_4");
break;
3460 case '*': growBuf.
addStr(
"_5");
break;
3461 case '&': growBuf.
addStr(
"_6");
break;
3462 case '|': growBuf.
addStr(
"_7");
break;
3463 case '.':
if (allowDots) growBuf.
addChar(
'.');
else growBuf.
addStr(
"_8");
break;
3464 case '!': growBuf.
addStr(
"_9");
break;
3465 case ',': growBuf.
addStr(
"_00");
break;
3466 case ' ': growBuf.
addStr(
"_01");
break;
3467 case '{': growBuf.
addStr(
"_02");
break;
3468 case '}': growBuf.
addStr(
"_03");
break;
3469 case '?': growBuf.
addStr(
"_04");
break;
3470 case '^': growBuf.
addStr(
"_05");
break;
3471 case '%': growBuf.
addStr(
"_06");
break;
3472 case '(': growBuf.
addStr(
"_07");
break;
3473 case ')': growBuf.
addStr(
"_08");
break;
3474 case '+': growBuf.
addStr(
"_09");
break;
3475 case '=': growBuf.
addStr(
"_0a");
break;
3476 case '$': growBuf.
addStr(
"_0b");
break;
3477 case '\\': growBuf.
addStr(
"_0c");
break;
3478 case '@': growBuf.
addStr(
"_0d");
break;
3479 case ']': growBuf.
addStr(
"_0e");
break;
3480 case '[': growBuf.
addStr(
"_0f");
break;
3481 case '#': growBuf.
addStr(
"_0g");
break;
3485 bool doEscape =
true;
3486 if (allowUnicodeNames)
3491 growBuf.
addStr(p-1,charLen);
3499 unsigned char id = (
unsigned char)c;
3508 else if (caseSenseNames || !isupper(c))
3515 growBuf.
addChar((
char)tolower(c));
3521 return growBuf.
get();
3529 const char *p = s.
data();
3539 case '_': result+=c; p++;
break;
3540 case '1': result+=
':'; p++;
break;
3541 case '2': result+=
'/'; p++;
break;
3542 case '3': result+=
'<'; p++;
break;
3543 case '4': result+=
'>'; p++;
break;
3544 case '5': result+=
'*'; p++;
break;
3545 case '6': result+=
'&'; p++;
break;
3546 case '7': result+=
'|'; p++;
break;
3547 case '8': result+=
'.'; p++;
break;
3548 case '9': result+=
'!'; p++;
break;
3552 case '0': result+=
','; p+=2;
break;
3553 case '1': result+=
' '; p+=2;
break;
3554 case '2': result+=
'{'; p+=2;
break;
3555 case '3': result+=
'}'; p+=2;
break;
3556 case '4': result+=
'?'; p+=2;
break;
3557 case '5': result+=
'^'; p+=2;
break;
3558 case '6': result+=
'%'; p+=2;
break;
3559 case '7': result+=
'('; p+=2;
break;
3560 case '8': result+=
')'; p+=2;
break;
3561 case '9': result+=
'+'; p+=2;
break;
3562 case 'a': result+=
'='; p+=2;
break;
3563 case 'b': result+=
'$'; p+=2;
break;
3564 case 'c': result+=
'\\'; p+=2;
break;
3565 case 'd': result+=
'@'; p+=2;
break;
3566 case 'e': result+=
']'; p+=2;
break;
3567 case 'f': result+=
'['; p+=2;
break;
3568 case 'g': result+=
'#'; p+=2;
break;
3575 if (!caseSenseNames && c>=
'a' && c<=
'z')
3577 result+=(char)toupper(*p);
3606 if (name.
isEmpty())
return name;
3629 int resultLen = result.
length();
3635 MD5Buffer((
const unsigned char *)result.
data(),resultLen,md5_sig);
3636 MD5SigToString(md5_sig,sigStr);
3637 result=result.
left(128-32)+sigStr;
3642 int l1Dir=0,l2Dir=0;
3646 MD5Buffer((
const unsigned char *)result.
data(),result.
length(),md5_sig);
3647 l1Dir = md5_sig[14]&0xf;
3648 l2Dir = md5_sig[15];
3683 for (l1=0;l1<16;l1++)
3689 term(
"Failed to create output directory '%s'\n",
qPrint(subdir));
3691 for (l2=0;l2<256;l2++)
3694 subsubdir.
sprintf(
"d%x/d%02x",l1,l2);
3697 term(
"Failed to create output directory '%s'\n",
qPrint(subsubdir));
3709 for (
int l1=0;l1<16;l1++)
3713 for (
int l2=0;l2<256;l2++)
3716 subsubdir.
sprintf(
"d%x/d%02x",l1,l2);
3735 bool allowEmptyClass)
3742 namespaceName=nd->
name();
3747 while (p>=0 && (i=clName.
findRev(
"::",p))!=-1)
3754 namespaceName=nd->
name();
3763 className=scopeName;
3767 if (className.
isEmpty() && !namespaceName.
isEmpty() && !allowEmptyClass)
3770 className=namespaceName;
3775 if ( className.
right(2)==
"-p")
3777 className = className.
left(className.
length()-2);
3821 bool skipBracket=
FALSE;
3828 while (p>=0 && count>=0)
3830 char c=result.
at(p);
3836 if (p>0 && result.
at(p-1)==
':' && (count==0 || skipBracket))
3838 return result.
right(l-p-1);
3849 if (p>0 && result.
at(p-1)==
'>')
3857 bool foundMatch=
false;
3858 while (p>=0 && !foundMatch)
3870 if (round==0) count++;
3877 if (result.
at(p-1) ==
'<')
3884 foundMatch = count==0;
3899 done = count==0 || skipBracket;
3912 const char *p=s.
data();
3918 if ((c>=
'0' && c<=
'9') || (c>=
'a' && c<=
'z') || (c>=
'A' && c<=
'Z') || c==
'-' || c==
':' || c==
'.')
3920 if (first && c>=
'0' && c<=
'9') growBuf.
addChar(
'a');
3926 encChar[1]=
hex[((
unsigned char)c)>>4];
3927 encChar[2]=
hex[((
unsigned char)c)&0xF];
3934 return growBuf.
get();
3952 const char *p=s.
data();
3958 case '<': growBuf.
addStr(
"<");
break;
3959 case '>': growBuf.
addStr(
">");
break;
3960 case '&':
if (keepEntities)
3966 if (ce==
';' || (!(
isId(ce) || ce==
'#')))
break;
3972 while (p<e) growBuf.
addChar(*p++);
3984 case '\'': growBuf.
addStr(
"'");
break;
3985 case '"': growBuf.
addStr(
""");
break;
3986 case 1:
case 2:
case 3:
case 4:
case 5:
case 6:
case 7:
case 8:
3987 case 11:
case 12:
case 13:
case 14:
case 15:
case 16:
case 17:
case 18:
3988 case 19:
case 20:
case 21:
case 22:
case 23:
case 24:
case 25:
case 26:
3989 case 27:
case 28:
case 29:
case 30:
case 31:
3991 default: growBuf.
addChar(c);
break;
3995 return growBuf.
get();
4003 const unsigned char *q;
4005 const unsigned char *p=(
const unsigned char *)s.
data();
4011 case '<': growBuf.
addStr(
"<");
break;
4012 case '>': growBuf.
addStr(
">");
break;
4016 while ((*q >=
'a' && *q <=
'z') || (*q >=
'A' && *q <=
'Z') || (*q >=
'0' && *q <=
'9'))
4042 case '\'': growBuf.
addStr(
"'");
break;
4043 case '"': growBuf.
addStr(
""");
break;
4044 case 1:
case 2:
case 3:
case 4:
case 5:
case 6:
case 7:
case 8:
4045 case 11:
case 12:
case 14:
case 15:
case 16:
case 17:
case 18:
4046 case 19:
case 20:
case 21:
case 22:
case 23:
case 24:
case 25:
case 26:
4047 case 27:
case 28:
case 29:
case 30:
case 31:
4059 return growBuf.
get();
4067 const char *p=s.
data();
4073 case '<': growBuf.
addStr(
"<");
break;
4074 case '>': growBuf.
addStr(
">");
break;
4075 case '&':
if (keepEntities)
4081 if (ce==
';' || (!(
isId(ce) || ce==
'#')))
break;
4087 while (p<e) growBuf.
addChar(*p++);
4099 case '\'': growBuf.
addStr(
"'");
break;
4100 case '"': growBuf.
addStr(
""");
break;
4120 return growBuf.
get();
4127 const char *p=s.
data();
4133 case '"': growBuf.
addStr(
"\\\"");
break;
4134 case '\\': growBuf.
addStr(
"\\\\");
break;
4135 default: growBuf.
addChar(c);
break;
4146 const char *p=s.
data();
4152 case '(': growBuf.
addStr(
"\\(");
break;
4153 case ')': growBuf.
addStr(
"\\)");
break;
4154 default: growBuf.
addChar(c);
break;
4158 return growBuf.
get();
4174 std::string s = str.
data();
4175 static const reg::Ex re(R
"(&\a\w*;)");
4181 for (; it!=
end ; ++it)
4183 const auto &
match = *it;
4184 p =
match.position();
4188 growBuf.
addStr(s.substr(i,p-i));
4203 growBuf.
addStr(s.substr(i));
4206 return growBuf.
get();
4228 struct MoveMemberInfo
4231 : memberDef(md), memberGroup(mg), sli(rv) {}
4236 std::vector<MoveMemberInfo> movedMembers;
4238 for (
const auto &md : *ml)
4244 int groupId=fmd->getMemberGroupId();
4250 auto &info = it->second;
4251 auto mg_it = std::find_if(pMemberGroups->begin(),
4252 pMemberGroups->end(),
4253 [&groupId](
const auto &g)
4254 { return g->groupId()==groupId; }
4257 if (mg_it==pMemberGroups->end())
4259 auto mg = std::make_unique<MemberGroup>(
4268 pMemberGroups->push_back(std::move(mg));
4272 mg_ptr = (*mg_it).get();
4290 auto &info = it->second;
4291 auto mg_it = std::find_if(pMemberGroups->begin(),
4292 pMemberGroups->end(),
4293 [&groupId](
const auto &g)
4294 { return g->groupId()==groupId; }
4297 if (mg_it==pMemberGroups->end())
4299 auto mg = std::make_unique<MemberGroup>(
4308 pMemberGroups->push_back(std::move(mg));
4312 mg_ptr = (*mg_it).get();
4314 movedMembers.push_back(MoveMemberInfo(md,mg_ptr,info->m_sli));
4320 for (
const auto &mmi : movedMembers)
4322 ml->remove(mmi.memberDef);
4323 mmi.memberGroup->
insertMember(mmi.memberDef->resolveAlias());
4324 mmi.memberGroup->setRefItems(mmi.sli);
4340 static reg::Ex re_norm(R
"(\a[\w:]*)");
4341 static reg::Ex re_fortran(R
"(\a[\w:()=]*)");
4342 static const reg::Ex *re = &re_norm;
4346 if (type.
isEmpty())
return -1;
4347 int typeLen=(int)type.
length();
4352 if (type[pos]==
',')
return -1;
4358 std::string s = type.
str();
4364 const auto &
match = *it;
4365 int i = (int)
match.position();
4366 int l = (int)
match.length();
4371 while (ts<typeLen && type[ts]==
' ') ts++,tl++;
4372 if (ts<typeLen && type[ts]==
'<')
4377 while (te<typeLen && brCount!=0)
4381 if (te<typeLen-1 && type[te+1]==
'<') te++;
else brCount++;
4385 if (te<typeLen-1 && type[te+1]==
'>') te++;
else brCount--;
4418 int p=name.
find(
'<');
4419 if (p==-1)
return name;
4423 std::string s = result.
mid(p).
str();
4424 static const reg::Ex re(R
"([\a:][\w:]*)");
4429 for (; it!=
end ; ++it)
4431 const auto &
match = *it;
4432 size_t i =
match.position();
4433 size_t l =
match.length();
4434 result += s.substr(pi,i-pi);
4437 for (
const Argument &formArg : formalArgs)
4439 if (formArg.name == n)
4465 result+=s.substr(pi);
4480 const std::unique_ptr<ArgumentList> &actualArgs)
4484 if (formalArgs.
empty())
return nm;
4487 static const reg::Ex re(R
"(\a[\w:]*)");
4488 std::string name = nm.str();
4493 for (; it!=
end ; ++it)
4495 const auto &
match = *it;
4496 size_t i =
match.position();
4497 size_t l =
match.length();
4498 if (i>p) result += name.substr(p,i-p);
4503 actIt = actualArgs->begin();
4509 for (
auto formIt = formalArgs.
begin();
4510 formIt!=formalArgs.
end() && !found;
4516 if (actualArgs && actIt!=actualArgs->end())
4523 formArg.
type =
"class";
4528 formArg.
type =
"typename";
4530 if (formArg.
type==
"class" || formArg.
type==
"typename" || formArg.
type.
left(8)==
"template")
4537 if (formArg.
name==n && actualArgs && actIt!=actualArgs->end() && !actArg.
type.
isEmpty())
4549 result += actArg.
type+
" ";
4556 result += actArg.
type+
" "+actArg.
name+
" ";
4561 else if (formArg.
name==n &&
4562 (actualArgs==
nullptr || actIt==actualArgs->end()) &&
4571 else if (formArg.
name==n &&
4572 (actualArgs==
nullptr || actIt==actualArgs->end()) &&
4580 if (actualArgs && actIt!=actualArgs->end())
4591 result+=name.substr(p);
4609 int i=fullName.
find(
'<');
4610 if (i==-1)
return fullName;
4620 while (e<l && count>0)
4622 char c=fullName.
at(e++);
4625 case '(': round++;
break;
4626 case ')':
if (round>0) round--;
break;
4627 case '<':
if (round==0) count++;
break;
4628 case '>':
if (round==0) count--;
break;
4633 int si= fullName.
find(
"::",e);
4635 if (parentOnly && si==-1)
break;
4638 result+=fullName.
mid(p,i-p);
4642 result+=fullName.
mid(i,e-i);
4645 else if (pLastScopeStripped)
4648 *pLastScopeStripped=fullName.
mid(i,e-i);
4651 i=fullName.
find(
'<',p);
4653 result+=fullName.
right(l-p);
4672 int i=0,p=leftScope.
length();
4677 while ((i=leftScope.
findRev(
"::",p))>0)
4681 result = leftScope.
left(i+2)+rightScope;
4686 if (found)
return result;
4708 if (sp>=sl)
return -1;
4712 if (c==
':') sp++,p++;
else break;
4724 while (sp<sl && !done)
4730 case '<': count++;
break;
4731 case '>': count--;
if (count==0) done=
TRUE;
break;
4764 bool newPage =
true;
4769 warn(fileName,startLine,
"multiple use of page label '%s' with different titles, (other occurrence: %s, line: %d)",
4792 if (baseName.
right(4)==
".tex")
4810 std::unique_ptr<PageDef>(
4854 else if (si->
lineNr() != -1)
4885 if (!key.
isEmpty() && key[0]!=
'@')
4889 item->setPrefix(prefix);
4890 item->setScope(scope);
4891 item->setName(name);
4892 item->setTitle(title);
4893 item->setArgs(args);
4894 item->setGroup(key);
4912 if (!first) { ol.
writeString(
" | "); }
else first=
false;
4935 bool insideTabbing,
bool insidePre,
bool insideItem,
bool insideTable,
bool keepSpaces)
4939 const unsigned char *p=(
const unsigned char *)str.
data();
4940 const unsigned char *q;
4943 unsigned char pc=
'\0';
4954 if ((
unsigned char)*(p) == 0xbf && (
unsigned char)*(p+1) == 0xbd)
4962 case '\\': t <<
"\\(\\backslash\\)";
break;
4963 case '{': t <<
"\\{";
break;
4964 case '}': t <<
"\\}";
break;
4965 case '_': t <<
"\\_";
break;
4966 case '&': t <<
"\\&";
break;
4967 case '%': t <<
"\\%";
break;
4968 case '#': t <<
"\\#";
break;
4969 case '$': t <<
"\\$";
break;
4970 case '"': t <<
"\"{}";
break;
4971 case '-': t <<
"-\\/";
break;
4972 case '^':
insideTable ? t <<
"\\string^" : t << (char)c;
break;
4973 case '~': t <<
"\\string~";
break;
4974 case ' ':
if (keepSpaces) t <<
"~";
else t <<
' ';
4988 if ((
unsigned char)*(p) == 0xbf && (
unsigned char)*(p+1) == 0xbd)
4996 case '#': t <<
"\\#";
break;
4997 case '$': t <<
"\\$";
break;
4998 case '%': t <<
"\\%";
break;
4999 case '^': t <<
"$^\\wedge$";
break;
5003 while ((*q >=
'a' && *q <=
'z') || (*q >=
'A' && *q <=
'Z') || (*q >=
'0' && *q <=
'9'))
5029 case '*': t <<
"$\\ast$";
break;
5030 case '_':
if (!insideTabbing) t <<
"\\+";
5032 if (!insideTabbing) t <<
"\\+";
5034 case '{': t <<
"\\{";
break;
5035 case '}': t <<
"\\}";
break;
5036 case '<': t <<
"$<$";
break;
5037 case '>': t <<
"$>$";
break;
5038 case '|': t <<
"$\\vert$";
break;
5039 case '~': t <<
"$\\sim$";
break;
5045 case ']':
if (pc==
'[') t <<
"$\\,$";
5051 case '-': t <<
"-\\/";
5053 case '\\': t <<
"\\textbackslash{}";
5055 case '"': t <<
"\\char`\\\"{}";
5057 case '`': t <<
"\\`{}";
5059 case '\'': t <<
"\\textquotesingle{}";
5061 case ' ':
if (keepSpaces) {
if (insideTabbing) t <<
"\\>";
else t <<
'~'; }
else t <<
' ';
5066 if (!insideTabbing &&
5067 ((c>=
'A' && c<=
'Z' && pc!=
' ' && !(pc>=
'A' && pc <=
'Z') && pc!=
'\0' && *p) || (c==
':' && pc!=
':') || (pc==
'.' &&
isId(c)))
5091 const char *p=s.
data();
5098 case '|': t <<
"\\texttt{\"|}";
break;
5099 case '!': t <<
"\"!";
break;
5100 case '@': t <<
"\"@";
break;
5101 case '%': t <<
"\\%";
break;
5102 case '{': t <<
"\\lcurly{}";
break;
5103 case '}': t <<
"\\rcurly{}";
break;
5104 case '~': t <<
"````~";
break;
5110 while ((c=*p) && c!=
'@' && c!=
'[' && c!=
']' && c!=
'!' && c!=
'{' && c!=
'}' && c!=
'|')
5134 const char *p=s.
data();
5141 case '!': t <<
"\"!";
break;
5142 case '"': t <<
"\"\"";
break;
5143 case '@': t <<
"\"@";
break;
5144 case '|': t <<
"\\texttt{\"|}";
break;
5145 case '[': t <<
"[";
break;
5146 case ']': t <<
"]";
break;
5147 case '{': t <<
"\\lcurly{}";
break;
5148 case '}': t <<
"\\rcurly{}";
break;
5154 while ((c=*p) && c!=
'"' && c!=
'@' && c!=
'[' && c!=
']' && c!=
'!' && c!=
'{' && c!=
'}' && c!=
'|')
5177 const char *p=s.
data();
5183 case '\\': t <<
"\\textbackslash{}";
break;
5184 case '{': t <<
"\\{";
break;
5185 case '}': t <<
"\\}";
break;
5186 case '_': t <<
"\\_";
break;
5187 case '%': t <<
"\\%";
break;
5188 case '&': t <<
"\\&";
break;
5201 const signed char *p=(
const signed char*)s.
data();
5207 case '#': t <<
"\\#";
break;
5208 case '%': t <<
"\\%";
break;
5209 case '\\': t <<
"\\\\";
break;
5213 unsigned char id = (
unsigned char)c;
5214 t <<
"\\%" <<
hex[
id>>4] <<
hex[
id&0xF];
5227 static std::unordered_map<std::string,std::string>
g_tagMap;
5254 if ( ( ++(*nxtTag) ) >
'Z' )
5277 if (fName.
isEmpty())
return fName;
5278 if (fName.
find(
'.')==-1)
5311 i=
static_cast<int>(it->second.length());
5314 if (i>0 && ns==scope.
left(i))
break;
5324 result=result.
mid(i+1);
5329 result=result.
mid(i+1);
5337 if (str.
isEmpty() || word==0)
return false;
5338 static const reg::Ex re(R
"(\a+)");
5339 std::string s = str.str();
5342 if (it->str()==word)
return true;
5353 static reg::Ex re(R
"(\s*(<\a+>)\s*)");
5354 std::string s = sentence.str();
5360 for ( ; it!=
end ; ++it)
5362 const auto match = *it;
5363 std::string part =
match[1].str();
5366 size_t i =
match.position();
5367 size_t l =
match.length();
5368 result+=s.substr(p,i-p);
5369 result+=
match.str();
5375 size_t i =
match[1].position();
5376 size_t l =
match[1].length();
5377 result+=s.substr(p,i-p);
5381 result+=s.substr(p);
5397 const char *p = s.
data();
5400 int i=0,li=-1,l=s.
length();
5404 if (c==
' ' || c==
'\t' || c==
'\r') i++,p++;
5405 else if (c==
'\\' &&
qstrncmp(p,
"\\ilinebr",8)==0) i+=8,li=i,p+=8;
5406 else if (c==
'\n') i++,li=i,docLine++,p++;
5416 if (c==
' ' || c==
'\t' || c==
'\r') b--,p--;
5417 else if (c==
'r' && b>=7 &&
qstrncmp(p-7,
"\\ilinebr",8)==0) bi=b-7,b-=8,p-=8;
5418 else if (c==
'\n') bi=b,b--,p--;
5423 if (li==-1 && bi==-1)
return s;
5430 return s.
mid(li,bi-li);
5484 if (extName.
at(0)!=
'.') extName.
prepend(
".");
5494 err(
"Failed to assign extension %s to parser %s for language %s\n",
5579 if (extName.
isEmpty()) extName=
".no_extension";
5580 if (extName.
at(0)!=
'.') extName.
prepend(
".");
5601 if (langName.
at(0)==
'.') langName = langName.
mid(1);
5624 int lastDot = fn.
findRev(
'.');
5625 if (lastDot!=-1)
return fn.
mid(lastDot);
5648 if (range.first==range.second)
5654 if (qualifierIndex!=-1)
5656 explicitScopePart = name.
left(qualifierIndex);
5658 name = name.
mid(qualifierIndex+2);
5662 int minDistance = 10000;
5665 for (
auto it=range.first; it!=range.second; ++it)
5672 if (distance!=-1 && distance<minDistance)
5674 minDistance = distance;
5688 if (bestMatch && bestMatch->
isTypedef())
5696 if (startPos>=len)
return len;
5702 int (*matcher)(int) = 0;
5703 c = (
uchar)utf8Str[startPos+bytes];
5707 c = (
uchar)utf8Str[startPos+bytes];
5711 matcher = std::isxdigit;
5725 while ((c = (
uchar)utf8Str[startPos+bytes])!=0 && matcher(c))
5735 return startPos+bytes;
5749 auto visitor = std::make_unique<TextDocVisitor>(t);
5750 root->accept(visitor.get());
5758 if (charCnt>=80)
break;
5765 if (result.
at(i)==
',' ||
5766 result.
at(i)==
'.' ||
5767 result.
at(i)==
'!' ||
5775 if ( i < l) result=result.
left(i)+
"...";
5776 return result.
data();
5809 while ((c=*p) &&
isId(c)) p++;
5830 std::vector<QCString> args;
5831 int i,l=(int)argList.
length();
5835 char c = argList.
at(i);
5836 if (c==
',' && (i==0 || argList.
at(i-1)!=
'\\'))
5841 else if (c==
'@' || c==
'\\')
5851 std::vector<Marker> markerList;
5854 bool insideMarkerId=
false;
5856 auto isDigit = [](
char c) {
return c>=
'0' && c<=
'9'; };
5859 char c = i<l ? aliasValue.
at(i) :
'\0';
5860 if (insideMarkerId && !isDigit(c))
5862 insideMarkerId =
false;
5863 int markerLen = i-markerStart;
5864 markerList.push_back(
Marker(markerStart-1,
5865 aliasValue.
mid(markerStart,markerLen).
toInt(),
5868 if (c==
'\\' && (pc==
'@' || pc==
'\\'))
5875 if (isDigit(c) && pc==
'\\')
5877 insideMarkerId=
true;
5887 for (i=0;i<(int)markerList.size();i++)
5889 const Marker &m = markerList.at(i);
5890 result+=aliasValue.
mid(p,m.
pos-p);
5900 result+=aliasValue.
right(l-p);
5915 const char *p = s.
data();
5919 if (c==
',' && pc!=
'\\')
5930 return result.
str();
5936 static const reg::Ex re(R
"([\\@](\a\w*))");
5937 std::string str = s.str();
5942 size_t i =
match.position();
5943 size_t l =
match.length();
5944 if (i>p) result+=s.
mid(p,i-p);
5947 bool hasArgs = !args.
isEmpty();
5948 int argsLen = args.
length();
5964 cmd = cmdNoArgs+
"{1}";
5970 if ((allowRecursion || aliasesProcessed.find(cmd.
str())==aliasesProcessed.end()) &&
5974 if (!allowRecursion) aliasesProcessed.insert(cmd.
str());
5983 if (!allowRecursion) aliasesProcessed.erase(cmd.
str());
5985 if (hasArgs) p+=argsLen+2;
5990 result+=
match.str();
6004 int l = argList.
length();
6008 char c = argList.
at(i);
6009 if (c==
',' && (i==0 || argList.
at(i-1)!=
'\\')) count++;
6010 else if (c==
'@' || c==
'\\')
6025 if (args.
at(pos)==
'{')
6027 for (i=pos;i<args.
length();i++)
6031 if (args.
at(i)==
'{') bc++;
6032 if (args.
at(i)==
'}') bc--;
6033 prevChar=args.
at(i);
6043 return args.
mid(pos+1,i-pos-1);
6060 std::string
expandAlias(
const std::string &aliasName,
const std::string &aliasValue)
6065 aliasesProcessed.
insert(aliasName);
6070 return result.
str();
6075 if (al.
empty())
return;
6097 #ifdef TRACINGSUPPORT
6098 void *backtraceFrames[128];
6099 int frameCount = backtrace(backtraceFrames, 128);
6100 static char cmd[40960];
6102 p += sprintf(p,
"/usr/bin/atos -p %d ", (
int)getpid());
6103 for (
int x = 0; x < frameCount; x++)
6105 p += sprintf(p,
"%p ", backtraceFrames[x]);
6107 fprintf(stderr,
"========== STACKTRACE START ==============\n");
6111 while (
size_t len = fread(resBuf, 1,
sizeof(resBuf), fp))
6113 fwrite(resBuf, 1, len, stderr);
6117 fprintf(stderr,
"============ STACKTRACE END ==============\n");
6125 if (inputEncoding.
isEmpty() || outputEncoding.
isEmpty())
return size;
6126 if (
qstricmp(inputEncoding,outputEncoding)==0)
return size;
6128 if (cd==(
void *)(-1))
6130 term(
"unsupported character conversion: '%s'->'%s': %s\n"
6131 "Check the INPUT_ENCODING setting in the config file!\n",
6132 qPrint(inputEncoding),
qPrint(outputEncoding),strerror(errno));
6134 int tmpBufSize=size*4+1;
6135 BufStr tmpBuf(tmpBufSize);
6137 size_t oLeft=tmpBufSize;
6138 const char *srcPtr = srcBuf.
data();
6139 char *dstPtr = tmpBuf.
data();
6143 newSize = tmpBufSize-(int)oLeft;
6145 strncpy(srcBuf.
data(),tmpBuf.
data(),newSize);
6150 term(
"%s: failed to translate characters from %s to %s: check INPUT_ENCODING\n",
6166 if (filterName.
isEmpty() || !filter)
6168 std::ifstream f(fileName.
str(),std::ifstream::in | std::ifstream::binary);
6171 err(
"could not open file %s\n",
qPrint(fileName));
6174 size=(int)fi.
size();
6177 f.read(inBuf.
data(),size);
6180 err(
"problems while reading file %s\n",
qPrint(fileName));
6186 QCString cmd=filterName+
" \""+fileName+
"\"";
6191 err(
"could not execute filter %s\n",
qPrint(filterName));
6194 const int bufSize=1024;
6197 while ((numRead=(
int)fread(buf,1,bufSize,f))>0)
6200 inBuf.
addArray(buf,numRead),size+=numRead;
6241 size=inBuf.
curPos()-start;
6257 std::string t = title.
str();
6258 static const reg::Ex re(R
"(%[a-z_A-Z]+)");
6262 for (; it!=
end ; ++it)
6264 const auto &
match = *it;
6265 size_t i =
match.position();
6266 size_t l =
match.length();
6267 if (i>p) tf+=t.substr(p,i-p);
6268 tf+=
match.str().substr(1);
6287 caseSenseNames =
FALSE;
6290 if (!patList.empty())
6296 for (
auto pattern: patList)
6298 if (!pattern.empty())
6300 size_t i=pattern.find(
'=');
6301 if (i!=std::string::npos) pattern=pattern.substr(0,i);
6303 if (!caseSenseNames)
6325 static bool extLinksInWindow =
Config_getBool(EXT_LINKS_IN_WINDOW);
6326 if (extLinksInWindow)
6327 return "target=\"_blank\" ";
6329 return "target=\"_parent\" ";
6342 result = it->second;
6344 if (!relPath.
isEmpty() && l>0 && result.
at(0)==
'.')
6349 if (l>0 && result.
at(l-1)!=
'/') result+=
'/';
6350 if (!href) result.
append(
"\" ");
6373 if (!img.
save(fileName))
6375 fprintf(stderr,
"Warning: Cannot open file %s for writing\n",data->
name);
6391 std::string s=str.
str();
6392 static const reg::Ex re(R
"(##[0-9A-Fa-f][0-9A-Fa-f])");
6398 size_t sl=s.length();
6400 for (; it!=
end ; ++it)
6402 const auto &
match = *it;
6403 size_t i =
match.position();
6404 size_t l =
match.length();
6405 if (i>p) result+=s.substr(p,i-p);
6406 std::string lumStr =
match.str().substr(2);
6407 #define HEXTONUM(x) (((x)>='0' && (x)<='9') ? ((x)-'0') : \
6408 ((x)>='a' && (x)<='f') ? ((x)-'a'+10) : \
6409 ((x)>='A' && (x)<='F') ? ((x)-'A'+10) : 0)
6415 pow(level/255.0,gamma/100.0),&r,&g,&b);
6416 red = (int)(r*255.0);
6417 green = (int)(g*255.0);
6418 blue = (int)(b*255.0);
6421 colStr[1]=
hex[red>>4];
6422 colStr[2]=
hex[red&0xf];
6423 colStr[3]=
hex[green>>4];
6424 colStr[4]=
hex[green&0xf];
6425 colStr[5]=
hex[blue>>4];
6426 colStr[6]=
hex[blue&0xf];
6432 if (p<sl) result+=s.substr(p);
6460 int m1 = text.
find(marker);
6461 if (m1==-1)
return result;
6462 int m2 = text.
find(marker,m1+marker.
length());
6463 if (m2==-1)
return result;
6467 while (!found && (i=text.
find(
'\n',p))!=-1)
6469 found = (p<=m1 && m1<i);
6476 while ((i=text.
find(
'\n',p))!=-1)
6505 int m1 = text.
find(marker);
6506 if (m1==-1)
return result;
6509 while (!found && (i=text.
find(
'\n',p))!=-1)
6511 found = (p<=m1 && m1<i);
6564 return loc_url.
left(5)==
"http:" || loc_url.
left(6)==
"https:" ||
6565 loc_url.
left(4)==
"ftp:" || loc_url.
left(5)==
"ftps:" ||
6566 loc_url.
left(5)==
"sftp:" || loc_url.
left(5)==
"file:" ||
6567 loc_url.
left(5)==
"news:" || loc_url.
left(4)==
"irc:" ||
6568 loc_url.
left(5)==
"ircs:";
6591 (prot==
Private && extractPrivate) ||
6592 (prot==
Package && extractPackage);
6603 const char *p=s.
data();
6606 int minIndent=1000000;
6607 bool searchIndent=
TRUE;
6611 if (c==
'\t') indent+=tabSize - (indent%tabSize);
6612 else if (c==
'\n') indent=0,searchIndent=
TRUE;
6613 else if (c==
' ') indent++;
6614 else if (searchIndent)
6617 if (indent<minIndent) minIndent=indent;
6622 if (minIndent==0)
return s;
6635 else if (indent<minIndent)
6639 int newIndent = indent+tabSize-(indent%tabSize);
6659 return result.
str();
6665 if (indentationLevel <= 0 || doc.
isEmpty())
return;
6670 const char *src = doc.
data();
6672 bool insideIndent =
false;
6674 while ((c=*src++)!=0)
6681 insideIndent =
true;
6682 cnt = indentationLevel;
6693 insideIndent =
false;
6703 insideIndent =
false;
6717 return ( ((allExternals && fd->
isLinkable()) ||
6737 const int length = s.
length();
6738 if (idx >= length) {
return 0; }
6740 if ( c0 < 0xC2 || c0 >= 0xF8 )
6744 if (idx+1 >= length) {
return 0; }
6748 return ((c0 & 0x1f) << 6) | c1;
6750 if (idx+2 >= length) {
return 0; }
6754 return ((c0 & 0x0f) << 12) | (c1 << 6) | c2;
6756 if (idx+3 >= length) {
return 0; }
6759 return ((c0 & 0x07) << 18) | (c1 << 12) | (c2 << 6) | c3;
6773 const uint v = getUtf8Code( s, idx );
6774 return v < 0x7f ? tolower( v ) : v;
6788 const uint v = getUtf8Code( s, idx );
6789 return v < 0x7f ? toupper( v ) : v;
6803 std::string s = docs.
str();
6804 static const reg::Ex re(R
"(\[([ inout,]+)\])");
6809 const auto &
match = *it;
6810 size_t p =
match.position();
6811 size_t l =
match.length();
6815 std::string dir =
match[1].str();
6817 dir.erase(std::remove_if(dir.begin(),dir.end(),
6818 [](
const char c) { return c==
' ' || c==
','; }
6820 size_t inIndex, outIndex;
6821 unsigned char ioMask=0;
6822 if (( inIndex=dir.find(
"in"))!=std::string::npos) dir.erase( inIndex,2),ioMask|=(1<<0);
6823 if ((outIndex=dir.find(
"out"))!=std::string::npos) dir.erase(outIndex,3),ioMask|=(1<<1);
6824 if (dir.empty() && ioMask!=0)
6827 if (ioMask==((1<<0)|(1<<1)))
return "[in,out]";
6828 else if (ioMask==(1<<0))
return "[in]";
6829 else if (ioMask==(1<<1))
return "[out]";
6860 *outListType1=inListType;
7035 int i= imgExt.
find(
':');
7036 return i==-1 ? imgExt : imgExt.
left(i);
7041 assert(!f.is_open());
7042 bool fileOpened=
FALSE;
7043 bool writeToStdout=outFile==
"-";
7046 f.basic_ios<char>::rdbuf(std::cout.rdbuf());
7060 f.open(outFile.
str(),std::ofstream::out | std::ofstream::binary);
7061 fileOpened = f.is_open();
7070 if (!extraPackages.empty())
7072 t <<
"% Packages requested by user\n";
7073 for (
const auto &pkgName : extraPackages)
7075 if ((pkgName[0] ==
'[') || (pkgName[0] ==
'{'))
7076 t <<
"\\usepackage" << pkgName.c_str() <<
"\n";
7078 t <<
"\\usepackage{" << pkgName.c_str() <<
"}\n";
7086 unsigned char minus[4];
7087 char *pminus = (
char *)minus;
7088 unsigned char sup2[3];
7089 char *psup2 = (
char *)sup2;
7090 unsigned char sup3[3];
7091 char *psup3 = (
char *)sup3;
7103 t <<
"\\usepackage{newunicodechar}\n"
7104 " \\newunicodechar{" << pminus <<
"}{${}^{-}$}% Superscript minus\n"
7105 " \\newunicodechar{" << psup2 <<
"}{${}^{2}$}% Superscript two\n"
7106 " \\newunicodechar{" << psup3 <<
"}{${}^{3}$}% Superscript three\n"
7115 bool skipLine=
FALSE;
7140 if (column==1)
return TRUE;
7141 if (skipLine)
break;
7144 if (column>1 && column<7)
return FALSE;
7148 if (skipLine)
break;
7149 if (column>=7)
return TRUE;
7173 int beginLen = (int)
begin.length();
7174 int endLen = (int)
end.length();
7176 for (p=s.
data(); (q=strstr(p,
begin.data()))!=0; p=q+endLen)
7180 if ((q=strstr(p,
end.data()))==0)
7191 for (r=result.
rawData(), p=s.
data(); (q=strstr(p,
begin.data()))!=0; p=q+endLen)
7197 if ((q=strstr(p,
end.data()))==0)
7199 memcpy(r,
begin.data(),beginLen);
7219 begin =
"<!--BEGIN " + name +
"-->";
7220 end =
"<!--END " + name +
"-->";
7221 nobegin =
"<!--BEGIN !" + name +
"-->";
7222 noend =
"<!--END !" + name +
"-->";
7225 begin =
"%%BEGIN " + name;
7226 end =
"%%END " + name;
7227 nobegin =
"%%BEGIN !" + name;
7228 noend =
"%%END !" + name;
7254 const char *p=s.
data();
7263 while (*e==
' ' || *e==
'\t') e++;
7286 size_t prev = 0, pos = 0, len = s.length();
7289 pos = s.find(delimiter, prev);
7290 if (pos == std::string::npos) pos = len;
7291 if (pos>prev) result.push_back(s.substr(prev,pos-prev));
7292 prev = pos + delimiter.length();
7294 while (pos<len && prev<len);
7306 for ( ; iter !=
end; ++iter)
7308 const auto &
match = *iter;
7309 size_t i=
match.position();
7310 size_t l=
match.length();
7311 if (i>p) result.push_back(s.substr(p,i-p));
7314 if (p<s.length()) result.push_back(s.substr(p));
7321 auto it = std::find(sv.begin(),sv.end(),s);
7322 return it!=sv.end() ? (int)(it-sv.begin()) : -1;
7338 for (
const auto &s : sv)
7340 if (!first) result+=delimiter;
7354 while (residual > 0)
7356 modVal[0] = (upper ?
'A':
'a') + (residual-1)%26;
7357 result = modVal + result;
7358 residual = (residual-1) / 26;
7365 static const char *str_romans_upper[] = {
"M",
"CM",
"D",
"CD",
"C",
"XC",
"L",
"XL",
"X",
"IX",
"V",
"IV",
"I" };
7366 static const char *str_romans_lower[] = {
"m",
"cm",
"d",
"cd",
"c",
"xc",
"l",
"xl",
"x",
"ix",
"v",
"iv",
"i" };
7367 static const int values[] = { 1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1 };
7368 static const char **str_romans = upper ? str_romans_upper : str_romans_lower;
7373 for (
int i = 0; i < 13; ++i)
7375 while (residual - values[i] >= 0)
7377 result += str_romans[i];
7378 residual -= values[i];
QCString selectBlock(const QCString &s, const QCString &name, bool enable, OutputGenerator::OutputType o)
QCString getDotImageExtension()
RefQualifierType refQualifier() const
std::vector< std::string > StringVector
QCString trailingReturnType() const
void disableAllBut(OutputGenerator::OutputType o)
const char * latex(DocSymbol::SymType symb) const
Access routine to the LaTeX code of the HTML entity
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...
static std::unordered_map< std::string, std::string > g_tagMap
DocSymbol::SymType name2sym(const QCString &symName) const
Give code of the requested HTML entity name
static MemberDef * getMemberFromSymbol(const Definition *scope, const FileDef *fileScope, const QCString &n)
QCString integerToRoman(int n, bool upper)
virtual void setDocumentation(const QCString &d, const QCString &docFile, int docLine, bool stripWhiteSpace=TRUE)=0
size_t portable_iconv(void *cd, const char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft)
static void hsl2rgb(double h, double s, double l, double *pRed, double *pGreen, double *pBlue)
void writeMarkerList(OutputList &ol, const std::string &markerText, size_t numMarkers, std::function< void(size_t)> replaceFunc)
virtual bool isTypedef() const =0
static void stripIrrelevantString(QCString &target, const QCString &str)
OutputDocInterface & m_od
virtual QCString getOutputFileBase() const =0
This struct is used to capture the tag file information for an Entry.
QCString stripAnonymousNamespaceScope(const QCString &s)
FindFileCacheElem(FileDef *fd, bool ambig)
FileDef * findFileDef(const FileNameLinkedMap *fnMap, const QCString &n, bool &ambig)
QCString langToString(SrcLangExt lang)
Returns a string representation of lang.
GroupDef * toGroupDef(Definition *d)
QCString replaceAnonymousScopes(const QCString &s, const QCString &replacement)
virtual int docLine() const =0
FILE * popen(const QCString &name, const QCString &type)
QCString getTemplateSpec() const
In case a call to resolveClass() points to a template specialization, the template part is return via...
QCString latexFilterURL(const QCString &s)
bool fileSystemIsCaseSensitive()
bool findAndRemoveWord(QCString &sentence, const char *word)
removes occurrences of whole word from sentence, while keeps internal spaces and reducing multiple se...
bool leftScopeMatch(const QCString &scope, const QCString &name)
std::string replace(const std::string &str, const Ex &re, const std::string &replacement)
Searching in a given input string for parts that match regular expression re and replaces those parts...
@ MemberListType_priStaticMethods
bool getDefs(const QCString &scName, const QCString &mbName, const QCString &args, const MemberDef *&md, const ClassDef *&cd, const FileDef *&fd, const NamespaceDef *&nd, const GroupDef *&gd, bool forceEmptyScope, const FileDef *currentFile, bool checkCV)
bool resolveLink(const QCString &scName, const QCString &lr, bool, const Definition **resContext, QCString &resAnchor)
MemberDefMutable * toMemberDefMutable(Definition *d)
char * rawData()
Returns a writable pointer to the data.
@ MemberListType_priStaticAttribs
static std::unique_ptr< PageDef > mainPage
Protection
Protection level of members
Class representing all files with a certain base name
QCString stripExtensionGeneral(const QCString &fName, const QCString &ext)
virtual QCString argsString() const =0
virtual bool generateSourceFile() const =0
QCString stripFromIncludePath(const QCString &path)
static int findEndOfCommand(const char *s)
For a string s that starts with a command name, returns the character offset within that string repre...
static StringUnorderedMap namespaceAliasMap
The common base class of all entity definitions found in the sources.
virtual void writeNonBreakableSpace(int)=0
Data associated with a HSV colored image.
std::string extension(bool complete) const
bool remove(const std::string &path, bool acceptsAbsPath=true) const
QCString stripScope(const QCString &name)
QCString relativePathToRoot(const QCString &name)
virtual bool isStatic() const =0
An abstract interface of a namespace symbol.
Class representing a directory in the file system
virtual QCString getOutputFileBase() const =0
virtual bool isLinkable() const =0
Interface used for generating documentation.
bool generateLink(OutputDocInterface &od, const QCString &clName, const QCString &lr, bool inSeeBlock, const QCString <)
virtual int getMemberGroupId() const =0
QCString substituteTemplateArgumentsInString(const QCString &nm, const ArgumentList &formalArgs, const std::unique_ptr< ArgumentList > &actualArgs)
QCString replaceColorMarkers(const QCString &str)
Replaces any markers of the form ##AA in input string str by new markers of the form #AABBCC,...
int isAccessibleFromWithExpScope(const Definition *scope, const Definition *item, const QCString &explicitScopePart)
Check if symbol item is accessible from within scope, where it has to match the explicitScopePart.
Buffer used to store strings
uint length() const
Returns the length of the string, not counting the 0-terminator.
Marker(int p, int n, int s)
static StringMap tagDestinationMap
virtual void pushGeneratorState()=0
This class represents an function or template argument list.
static ConceptLinkedMap * conceptLinkedMap
Definition * definition() const
virtual bool isLinkableInProject() const =0
void startConstraintParam()
static std::tm getCurrentDateTime()
A model of a directory symbol.
int findRev(char c, int index=-1, bool cs=TRUE) const
QCString filterTitle(const QCString &title)
@ MemberListType_priAttribs
QCString generateMarker(int id)
void startConstraintType()
static Cache< std::string, FindFileCacheElem > g_findFileDefCache(5000)
bool isEmpty() const
Returns TRUE iff the string is empty
virtual void startPageRef()=0
bool match(const std::string &str, Match &match, const Ex &re)
Matches a given string str for a match against regular expression re.
virtual void setReference(const QCString &r)=0
virtual const Definition * findInnerCompound(const QCString &name) const =0
virtual const GroupDef * getGroupDef() const =0
static PageLinkedMap * pageLinkedMap
static IndexList * indexList
PageDef * createPageDef(const QCString &f, int l, const QCString &n, const QCString &d, const QCString &t)
void writeString(const QCString &text)
bool copyFile(const QCString &src, const QCString &dest)
Copies the contents of file with name src to the newly created file with name dest.
char * qstrcpy(char *dst, const char *src)
Implements TextGeneratorIntf for an OutputDocInterface stream.
Helper class to find a class definition or check if A symbol is accessible in a given scope.
This struct represents an item in the list of references.
void endConstraintParam()
static QCString stripDeclKeywords(const QCString &s)
QCString transcodeCharacterStringToUTF8(const QCString &input)
bool containsWord(const QCString &str, const char *word)
returns TRUE iff string s contains word w
@ MemberListType_pubTypes
MemberDef * toMemberDef(Definition *d)
SrcLangExt
Language as given by extension
@ MemberListType_priSlots
T * add(const char *k, Args &&... args)
Adds a new object to the ordered vector if it was not added already.
static QCString getCanonicalTypeForIdentifier(const Definition *d, const FileDef *fs, const QCString &word, QCString *tSpec, int count=0)
static NamespaceDefMutable * globalScope
void writeTypeConstraints(OutputList &ol, const Definition *d, const ArgumentList &al)
QCString stripTemplateSpecifiersFromScope(const QCString &fullName, bool parentOnly, QCString *pLastScopeStripped)
bool recognizeFixedForm(const QCString &contents, FortranFormat format)
void dropFromStart(uint bytes)
virtual QCString anchor() const =0
static StringMap aliasMap
static int nextUTF8CharPosition(const QCString &utf8Str, uint len, uint startPos)
virtual bool isLinkableInProject() const =0
returns TRUE iff a link is possible to this item within this project.
void startConstraintList(const QCString &header)
QCString correctURL(const QCString &url, const QCString &relPath)
Corrects URL url according to the relative path relPath.
@ Wildcard
simple globbing pattern.
virtual bool isLinkableInProject() const =0
void err(const char *fmt,...)
virtual bool isLinkable() const =0
char & at(size_t i)
Returns a reference to the character at index i.
Text streaming class that buffers data.
static DirLinkedMap * dirLinkedMap
void * portable_iconv_open(const char *tocode, const char *fromcode)
void addStr(const QCString &s)
int find(char c, int index=0, bool cs=TRUE) const
@ MemberListType_proAttribs
QCString extractAliasArgs(const QCString &args, size_t pos)
@ MemberListType_pubMethods
bool isURL(const QCString &url)
Checks whether the given url starts with a supported protocol
NamespaceDef * getResolvedNamespace(const QCString &name)
ClassDef * getClass(const QCString &n)
bool volatileSpecifier() const
int qstrncmp(const char *str1, const char *str2, size_t len)
virtual FileDef * getFileDef() const =0
Returns the namespace this compound is in, or 0 if it has a global scope.
bool patternMatch(const FileInfo &fi, const StringVector &patList)
static HtmlEntityMapper * instance()
Returns the one and only instance of the HTML entity mapper
virtual QCString docFile() const =0
virtual QCString getReference() const =0
static CharAroundSpace g_charAroundSpace
bool rightScopeMatch(const QCString &scope, const QCString &name)
bool protectionLevelVisible(Protection prot)
QCString getCanonicalTemplateSpec(const Definition *d, const FileDef *fs, const QCString &spec)
void warn(const QCString &file, int line, const char *fmt,...)
SectionInfo * replace(const QCString &label, const QCString &fileName, int lineNr, const QCString &title, SectionType type, int level, const QCString &ref=QCString())
Replace an existing section with a new one Return a non-owning pointer to the newly added section
DirIterator begin(DirIterator it) noexcept
virtual SrcLangExt getLanguage() const =0
Returns the programming language this definition was written in.
Ordered dictionary of FileName objects.
virtual void popGeneratorState()=0
QCString getOverloadDocs()
static struct Lang2ExtMap g_lang2extMap[]
Iterator class to iterator through matches.
static QCString replaceAliasArguments(StringUnorderedSet &aliasesProcessed, const QCString &aliasValue, const QCString &argList)
Replaces the markers in an alias definition aliasValue with the corresponding values found in the com...
bool hasParameters() const
static SymbolMap< Definition > * symbolMap
QCString getenv(const QCString &variable)
static bool getScopeDefs(const QCString &docScope, const QCString &scope, ClassDef *&cd, NamespaceDef *&nd)
QCString convertToLaTeX(const QCString &s, bool insideTabbing, bool keepSpaces)
Class representing a string buffer optimised for growing.
DirIterator end(const DirIterator &) noexcept
std::pair< const_iterator, const_iterator > find(const QCString &name) const
Find the list of symbols stored under key name Returns a pair of iterators pointing to the start and ...
virtual bool isLinkable() const =0
std::unordered_set< std::string > StringUnorderedSet
virtual bool isStrongEnumValue() const =0
A model of a page symbol.
A model of a group of symbols.
static FileNameLinkedMap * inputNameLinkedMap
static int transcodeCharacterBuffer(const QCString &fileName, BufStr &srcBuf, int size, const QCString &inputEncoding, const QCString &outputEncoding)
virtual QCString anchor() const =0
virtual void endPageRef(const QCString &, const QCString &)=0
Class representing a list of output generators that are written to in parallel.
QCString rtfFormatBmkStr(const QCString &name)
virtual QCString qualifiedName() const =0
static const char constScope[]
QCString extractBlock(const QCString &text, const QCString &marker)
Returns the section of text, in between a pair of markers.
QCString addHtmlExtensionIfMissing(const QCString &fName)
A model of a class/file/namespace member symbol.
QCString dateToString(bool includeTime)
static bool isdigit(char c)
void warn_uncond(const char *fmt,...)
QCString removeEmptyLines(const QCString &s)
static bool matchArgument2(const Definition *srcScope, const FileDef *srcFileScope, Argument &srcA, const Definition *dstScope, const FileDef *dstFileScope, Argument &dstA)
bool pureSpecifier() const
QCString argListToString(const ArgumentList &al, bool useCanonicalType, bool showDefVals)
@ MemberListType_pubSlots
QCString clearBlock(const QCString &s, const QCString &begin, const QCString &end)
Clear a text block s from begin to end markers
bool rename(const std::string &orgName, const std::string &newName, bool acceptsAbsPath=true) const
A abstract class representing of a compound symbol.
QCString stripWhiteSpace() const
returns a copy of this string with leading and trailing whitespace removed
#define Config_getInt(name)
static bool isspace(char c)
static QCString extractCanonicalArgType(const Definition *d, const FileDef *fs, const Argument &arg)
static MemberNameLinkedMap * functionNameLinkedMap
void disable(OutputGenerator::OutputType o)
@ MemberListType_proStaticMethods
QCString left(size_t len) const
void startConstraintDocs()
bool fileVisibleInIndex(const FileDef *fd, bool &genSourceFile)
QCString unescapeCharsInString(const QCString &s)
virtual QCString trOverloadText()=0
virtual QCString name() const =0
virtual bool isDefine() const =0
virtual bool isVariable() const =0
virtual const MemberVector & enumFieldList() const =0
void addImageFile(const QCString &name)
static ParserManager * parserManager
QCString & insert(size_t index, const QCString &s)
virtual void writeLink(const QCString &extRef, const QCString &file, const QCString &anchor, const QCString &text) const =0
static QCString expandAliasRec(StringUnorderedSet &aliasesProcessed, const QCString &s, bool allowRecursion=FALSE)
virtual QCString getOutputFileBase() const =0
Returns the unique base name (without extension) of the class's file on disk
StringVector split(const std::string &s, const std::string &delimiter)
split input string s by string delimiter delimiter. returns a vector of non-empty strings that are be...
static QCString escapeCommas(const QCString &s)
virtual const BaseClassList & baseClasses() const =0
Returns the list of base classes from which this class directly inherits.
static void print(DebugMask mask, int prio, const char *fmt,...)
bool updateLanguageMapping(const QCString &extension, const QCString &language)
virtual bool isReference() const =0
QCString simplifyWhiteSpace() const
return a copy of this string with leading and trailing whitespace removed and multiple whitespace cha...
QCString removeRedundantWhiteSpace(const QCString &s)
static bool isalnum(char c)
int qstricmp(const char *str1, const char *str2)
virtual void lineBreak(const QCString &style)=0
void initDefaultExtensionMapping()
Translator * theTranslator
virtual bool isReference() const =0
Ordered dictionary of MemberName objects.
int isAccessibleFrom(const Definition *scope, const Definition *item)
Checks if symbol item is accessible from within scope.
virtual QCString name() const =0
static GroupLinkedMap * groupLinkedMap
FortranFormat convertFileNameFortranParserCode(QCString fn)
#define Config_getEnumAsString(name)
QCString resolveTypeDef(const Definition *context, const QCString &qualifiedName, const Definition **typedefContext)
This class contains the information about the argument of a function or template
QCString parseCommentAsText(const Definition *scope, const MemberDef *md, const QCString &doc, const QCString &fileName, int lineNr)
Abstract interface for a hyperlinked text fragment.
virtual MemberDef * resolveAlias()=0
virtual const ClassDef * getClassDef() const =0
QCString extractDirection(QCString &docs)
Strip the direction part from docs and return it as a string in canonical form The input docs string ...
QCString stripPath(const QCString &s)
void addCodeOnlyMappings()
DocRoot * validatingParseDoc(IDocParser &parserIntf, const QCString &fileName, int startLine, const Definition *ctx, const MemberDef *md, const QCString &input, bool indexWords, bool isExample, const QCString &exampleName, bool singleLine, bool linkFromIndex, bool markdownSupport)
static std::mutex g_usedNamesMutex
static MemberGroupInfoMap memberGroupInfoMap
virtual QCString trPageAbbreviation()=0
virtual void setNestingLevel(int)=0
QCString latexEscapeLabelName(const QCString &s)
QCString getLanguageSpecificSeparator(SrcLangExt lang, bool classScope)
Returns the scope separator to use given the programming language lang
int computeQualifiedIndex(const QCString &name)
PageDef * addRelatedPage(const QCString &name, const QCString &ptitle, const QCString &doc, const QCString &fileName, int docLine, int startLine, const RefItemVector &sli, GroupDef *gd, const TagInfo *tagInfo, bool xref, SrcLangExt lang)
void addMembersToMemberGroup(MemberList *ml, MemberGroupList *pMemberGroups, const Definition *context)
int minClassDistance(const ClassDef *cd, const ClassDef *bcd, int level)
QCString fileName() const
virtual void setLanguage(SrcLangExt lang)=0
Token literal values and constants.
QCString fileToString(const QCString &name, bool filter, bool isSourceCode)
Object representing the matching results.
void linkifyText(const TextGeneratorIntf &out, const Definition *scope, const FileDef *fileScope, const Definition *self, const QCString &text, bool autoBreak, bool external, bool keepSpaces, int indentLevel)
SrcLangExt getLanguageFromFileName(const QCString &fileName, SrcLangExt defLang)
QCString showFileDefMatches(const FileNameLinkedMap *fnMap, const QCString &n)
bool checkIfTypedef(const Definition *scope, const FileDef *fileScope, const QCString &n)
virtual QCString getOutputFileBase() const =0
virtual int getStartBodyLine() const =0
virtual const NamespaceDef * getNamespaceDef() const =0
int extractClassNameFromType(const QCString &type, int &pos, QCString &name, QCString &templSpec, SrcLangExt lang)
virtual void setPageScope(Definition *)=0
QCString tempArgListToString(const ArgumentList &al, SrcLangExt lang, bool includeDefault)
int toInt(bool *ok=0, int base=10) const
QCString integerToAlpha(int n, bool upper)
QCString normalizeNonTemplateArgumentsInString(const QCString &name, const Definition *context, const ArgumentList &formalArgs)
const MemberDef * getTypedef() const
In case a call to resolveClass() resolves to a type member (e.g.
virtual bool hasTitle() const =0
virtual QCString getPath() const =0
bool constSpecifier() const
int lineBlock(const QCString &text, const QCString &marker)
Returns the line number of the line following the line with the marker.
void writeExamples(OutputList &ol, const ExampleList &list)
const T * find(const std::string &key) const
Find an object given the key.
std::string str() const
Return the contents of the buffer as a std::string object
virtual const GroupList & partOfGroups() const =0
virtual QCString trTypeConstraints()=0
QCString getResolvedType() const
In case a call to resolveClass() points to a typedef or using declaration.
ConceptDef * getConcept(const QCString &n)
std::string join(const StringVector &sv, const std::string &delimiter)
create a string where the string in the vector are joined by the given delimiter
static const char volatileScope[]
QCString insertTemplateSpecifierInScope(const QCString &scope, const QCString &templ)
static bool isLowerCase(QCString &s)
virtual void setTitle(const QCString &title)=0
virtual bool isStrong() const =0
void writeLatexSpecialFormulaChars(TextStream &t)
std::string filePath() const
bool isEmpty(const std::string subdir) const
SectionInfo * add(const SectionInfo &si)
Add a new section given the data of an existing section.
@ MemberListType_priTypes
void addRefItem(const RefItemVector &sli, const QCString &key, const QCString &prefix, const QCString &name, const QCString &title, const QCString &args, const Definition *scope)
void addArray(const char *a, uint len)
virtual DefType definitionType() const =0
typename Vec::iterator iterator
@ MemberListType_pubStaticAttribs
QCString linkToText(SrcLangExt lang, const QCString &link, bool isFileName)
void mergeArguments(ArgumentList &srcAl, ArgumentList &dstAl, bool forceNameOverwrite)
virtual bool isLinkable() const =0
void clearSubDirs(const Dir &d)
QCString externalLinkTarget(const bool parent)
virtual bool isForeign() const =0
void writeString(const QCString &s, bool keepSpaces) const
virtual void setFileName(const QCString &name)=0
void stripIrrelevantConstVolatile(QCString &s)
int getPrefixIndex(const QCString &name)
QCString & setNum(short n)
@ MemberListType_proMethods
Various UTF8 related helper functions.
void writeExtraLatexPackages(TextStream &t)
uint8_t getUTF8CharNumBytes(char c)
Returns the number of bytes making up a single UTF8 character given the first byte in the sequence.
virtual bool isLinkable() const =0
void generateFileRef(OutputDocInterface &od, const QCString &name, const QCString &text)
@ MemberListType_proTypes
virtual QCString getReference() const =0
virtual QCString qualifiedName() const =0
static const char virtualScope[]
static QCString g_nextTag("AAAAAAAAAA")
QCString stripIndentation(const QCString &s)
QCString mid(size_t index, size_t len=static_cast< size_t >(-1)) const
QCString substitute(const QCString &s, const QCString &src, const QCString &dst)
substitute all occurrences of src in s by dst
virtual bool isLinkableInProject() const =0
@ MemberListType_proStaticAttribs
void extractNamespaceName(const QCString &scopeName, QCString &className, QCString &namespaceName, bool allowEmptyClass)
void writePageRef(OutputDocInterface &od, const QCString &cn, const QCString &mn)
bool readInputFile(const QCString &fileName, BufStr &inBuf, bool filter, bool isSourceCode)
read a file name fileName and optionally filter and transcode it
QCString resolveAliasCmd(const QCString &aliasCmd)
std::vector< RefItem * > RefItemVector
virtual QCString getOutputFileBase() const =0
void setTitle(const QCString &t)
static std::mutex g_findFileDefMutex
static std::unordered_map< std::string, int > g_usedNames
static MemberNameLinkedMap * memberNameLinkedMap
virtual bool isLinkable() const =0
virtual bool isDocumentationFile() const =0
QCString & remove(size_t index, size_t len)
QCString substituteKeywords(const QCString &s, const QCString &title, const QCString &projName, const QCString &projNum, const QCString &projBrief)
#define Config_getBool(name)
QCString & append(char c)
virtual QCString getOutputFileBase() const =0
static std::unordered_map< std::string, int > g_extLookup
static QCString htmlFileExtension
static QCString getFilterFromList(const QCString &name, const StringVector &filterList, bool &found)
static void findMembersWithSpecificName(const MemberName *mn, const QCString &args, bool checkStatics, const FileDef *currentFile, bool checkCV, std::vector< const MemberDef * > &members)
virtual const MemberDef * getEnumScope() const =0
virtual void writeBreak(int indent) const =0
static SectionManager & instance()
returns a reference to the singleton
virtual bool isLinkable() const =0
virtual void writeObjectLink(const QCString &ref, const QCString &file, const QCString &anchor, const QCString &name)=0
Class representing a regular expression.
Class representing a bitmap image colored based on hue/sat/gamma settings.
virtual bool isEnumerate() const =0
virtual QCString getReference() const =0
If this class originated from a tagfile, this will return the tag file reference
virtual void docify(const QCString &s)=0
QCString escapeCharsInString(const QCString &name, bool allowDots, bool allowUnderscore)
@ MemberListType_priMethods
SrcLangExt getLanguageFromCodeLang(QCString &fileName)
Routine to handle the language attribute of the \code command
static bool insideTable(DocNode *n)
void term(const char *fmt,...)
virtual Definition * getOuterScope() const =0
@ MemberListType_proSlots
bool startsWith(const char *s) const
static QCString extractCanonicalType(const Definition *d, const FileDef *fs, QCString type)
void parseText(const QCString &textStr)
Minimal replacement for QFileInfo.
void convertProtectionLevel(MemberListType inListType, Protection inProt, int *outListType1, int *outListType2)
Computes for a given list type inListType, which are the the corresponding list type(s) in the base c...
void writeLink(const QCString &extRef, const QCString &file, const QCString &anchor, const QCString &text) const
std::string absFilePath() const
int countAliasArguments(const QCString &argList)
const char * qPrint(const char *s)
QCString stripLeadingAndTrailingEmptyLines(const QCString &s, int &docLine)
Special version of QCString::stripWhiteSpace() that only strips completely blank lines.
bool save(const QCString &fileName)
virtual const FileDef * getFileDef() const =0
#define Config_getString(name)
virtual void setBodySegment(int defLine, int bls, int ble)=0
class that provide information about a section.
void insertMember(const MemberDef *md)
virtual void setRefItems(const RefItemVector &sli)=0
void generateDoc(const QCString &fileName, int startLine, const Definition *ctx, const MemberDef *md, const QCString &docStr, bool indexWords, bool isExample, const QCString &exampleName, bool singleLine, bool linkFromIndex, bool markdownSupport)
void addGroupListToTitle(OutputList &ol, const Definition *d)
void writeBreak(int indent) const
QCString convertToDocBook(const QCString &s)
virtual const ArgumentList & argumentList() const =0
bool resolveRef(const QCString &scName, const QCString &name, bool inSeeBlock, const Definition **resContext, const MemberDef **resMember, bool lookForSpecialization, const FileDef *currentFile, bool checkScope)
QCString convertNameToFile(const QCString &name, bool allowDots, bool allowUnderscore)
@ MemberListType_pubAttribs
virtual void setMemberGroup(MemberGroup *grp)=0
QCString convertCharEntitiesToUTF8(const QCString &str)
static const char operatorScope[]
static NamespaceLinkedMap * namespaceLinkedMap
QCString removeAnonymousScopes(const QCString &str)
int findParameterList(const QCString &name)
Returns the position in the string where a function parameter list begins, or -1 if one is not found.
void pushGeneratorState()
QCString getFileNameExtension(const QCString &fn)
const char * data() const
Returns a pointer to the contents of the string in the form of a 0-terminated C string
Cache element for the file name to FileDef mapping cache.
QCString convertToXML(const QCString &s, bool keepEntities)
static int g_usedNamesCount
A model of a file symbol.
QCString convertToJSString(const QCString &s)
A class representing a group of members.
virtual QCString title() const =0
QCString mergeScopes(const QCString &leftScope, const QCString &rightScope)
const int maxInheritanceDepth
void trimBaseClassScope(const BaseClassList &bcl, QCString &s, int level=0)
static QCString stripFromPath(const QCString &path, const StringVector &l)
QCString stripExtension(const QCString &fName)
uint64 toUInt64(bool *ok=0, int base=10) const
void writeObjectLink(const QCString &ref, const QCString &file, const QCString &anchor, const QCString &name)
bool checkExtension(const QCString &fName, const QCString &ext)
bool rmdir(const std::string &path, bool acceptsAbsPath=true) const
std::string fileName() const
static int filterCRLF(char *buf, int len)
std::string expandAlias(const std::string &aliasName, const std::string &aliasValue)
Portable versions of functions that are platform dependent.
bool search(const std::string &str, Match &match, const Ex &re, size_t pos)
Search in a given string str starting at position pos for a match against regular expression re.
const ClassDef * resolveClass(const Definition *scope, const QCString &name, bool maybeUnlinkable=false, bool mayBeHidden=false)
Find the class definition matching name within the scope set.
QCString latexEscapePDFString(const QCString &s)
int portable_iconv_close(void *cd)
QCString getParserName(const QCString &extension)
Gets the name of the parser associated with given extension.
void filterLatexString(TextStream &t, const QCString &str, bool insideTabbing, bool insidePre, bool insideItem, bool insideTable, bool keepSpaces)
QCString externalRef(const QCString &relPath, const QCString &ref, bool href)
int getScopeFragment(const QCString &s, int p, int *l)
virtual QCString getOutputFileBase() const =0
bool mkdir(const std::string &path, bool acceptsAbsPath=true) const
virtual bool isRelated() const =0
int guessSection(const QCString &name)
A bunch of utility functions.
virtual QCString qualifiedNameWithTemplateParameters(const ArgumentLists *actualParams=0, uint *actualParamIndex=0) const =0
void createSubDirs(const Dir &d)
QCString getFileFilter(const QCString &name, bool isSourceCode)
void replaceNamespaceAliases(QCString &scope, int i)
TextGeneratorOLImpl(OutputDocInterface &od)
virtual QCString typeString() const =0
std::vector< BaseClassDef > BaseClassList
virtual QCString localName() const =0
@ MemberListType_pubStaticMethods
virtual void disable(OutputGenerator::OutputType o)=0
static std::string cleanDirPath(const std::string &path)
QCString latexEscapeIndexChars(const QCString &s)
virtual bool isLinkable() const =0
return TRUE iff a link to this class is possible (either within this project, or as a cross-reference...
QCString convertToId(const QCString &s)
virtual QCString trDateTime(int year, int month, int day, int dayOfWeek, int hour, int minutes, int seconds, bool includeTime)=0
std::unique_ptr< ArgumentList > stringToArgumentList(SrcLangExt lang, const QCString &argsString, QCString *extraTypeChars=0)
static std::mutex g_rtfFormatMutex
A list of MemberDef objects as shown in documentation sections.
bool stripPrefix(const QCString &prefix)
bool matchArguments2(const Definition *srcScope, const FileDef *srcFileScope, const ArgumentList *srcAl, const Definition *dstScope, const FileDef *dstFileScope, const ArgumentList *dstAl, bool checkCV)
QCString convertToPSString(const QCString &s)
QCString right(size_t len) const
QCString & prepend(const char *s)
bool resize(size_t newlen)
Resizes the string to hold newlen characters (this value should also count the 0-terminator).
uint qstrlen(const char *str)
bool openOutputFile(const QCString &outFile, std::ofstream &f)
QCString correctId(const QCString &s)
reverse_iterator rbegin()
virtual void addPage(const PageDef *def)=0
QCString & sprintf(const char *format,...)
QCString convertToHtml(const QCString &s, bool keepEntities)
virtual void setShowLineNo(bool)=0
virtual const ArgumentList & templateArguments() const =0
Returns the template arguments of this class
virtual const GroupDef * getGroupDef() const =0
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
std::unique_ptr< IDocParser > createDocParser()
virtual bool isUsedOnly() const =0
#define Config_getList(name)
virtual QCString trWriteList(int numEntries)=0
virtual bool isTemplate() const =0
Returns TRUE if this class is a template
bool recursivelyAddGroupListToTitle(OutputList &ol, const Definition *d, bool root)
static PageLinkedMap * exampleLinkedMap
virtual QCString anchor() const =0
This is an alternative implementation of QCString.
virtual void writeString(const QCString &, bool) const =0