25#include <unordered_set>
81#define ENABLE_TRACINGSUPPORT 0
83#if defined(__APPLE__) && ENABLE_TRACINGSUPPORT
95#define REL_PATH_TO_ROOT "../../"
97static const char *
hex =
"0123456789ABCDEF";
109 if (s.empty())
return;
117 m_ol.writeNonBreakableSpace(1);
121 m_ol.docify(std::string_view(&c, 1));
133 m_ol.lineBreak(
"typebreak");
134 for (
int i = 0; i < indent; ++i)
m_ol.writeNonBreakableSpace(3);
138 const QCString &anchor,std::string_view text
142 m_ol.writeObjectLink(extRef,file,anchor,text);
165 if (str.
isEmpty())
return result;
168 auto startsWithColon = [](
const std::string &del)
170 for (
size_t i=0;i<del.size();i++)
172 if (del[i]==
'@')
return false;
173 else if (del[i]==
':')
return true;
179 auto endsWithColon = [](
const std::string &del)
181 for (
int i=
static_cast<int>(del.size())-1;i>=0;i--)
183 if (del[i]==
'@')
return false;
184 else if (del[i]==
':')
return true;
189 static const reg::Ex re(R
"([\s:]*@\d+[\s:]*)");
190 std::string s = str.str();
194 size_t sl=s.length();
195 bool needsSeparator=
false;
196 for ( ; iter!=
end ; ++iter)
198 const auto &match = *iter;
199 size_t i = match.position();
202 if (needsSeparator) result+=
"::";
203 needsSeparator=
false;
204 result+=s.substr(p,i-p);
206 std::string delim = match.str();
207 needsSeparator = needsSeparator || (startsWithColon(delim) && endsWithColon(delim));
208 p = match.position()+match.length();
212 if (needsSeparator) result+=
"::";
222 static const reg::Ex marker(R
"(@\d+)");
224 !replacement.isEmpty() ? replacement.data() : "__anonymous__");
235 int sl =
static_cast<int>(s.
length());
243 if (!newScope.
isEmpty()) newScope+=
"::";
244 newScope+=s.
mid(i,l);
249 if (!newScope.
isEmpty()) newScope+=
"::";
250 newScope+=s.
right(sl-i);
282 const int maxMarkerStrLen = 20;
283 char result[maxMarkerStrLen];
284 qsnprintf(result,maxMarkerStrLen,
"@%d",
id);
305 for (
const auto &s : l)
308 if (
prefix.length() > length &&
315 if (length>0)
return potential;
342 static const std::unordered_set<std::string> sourceExt = {
343 "c",
"cc",
"cxx",
"cpp",
"c++",
"cppm",
"ccm",
"cxxm",
"c++m",
347 "ii",
"ixx",
"ipp",
"i++",
"inl",
350 static const std::unordered_set<std::string> headerExt = {
351 "h",
"hh",
"hxx",
"hpp",
"h++",
"ixx",
352 "idl",
"ddl",
"pidl",
"ice"
358 if (sourceExt.find(extension.
str())!=sourceExt.end())
360 return EntryType::makeSource();
362 if (headerExt.find(extension.
str())!=headerExt.end())
364 return EntryType::makeHeader();
371 return EntryType::makeEmpty();
377 AUTO_TRACE(
"context='{}' qualifiedName='{}'",context?context->
name():
"",qualifiedName);
386 if (typedefContext) *typedefContext=context;
389 if (qualifiedName.
find(
'<')!=-1)
394 int scopeIndex = qualifiedName.
findRev(
"::");
398 resName=qualifiedName.
right(qualifiedName.
length()-scopeIndex-2);
406 while (mContext && md==
nullptr)
422 if (!tmp.
isEmpty()) qualScopePart=tmp;
425 if (resScope==
nullptr)
break;
437 bool searchRelated=
false;
438 bool mustBeRelated=
false;
449 if (mn==0 && searchRelated)
457 for (
const auto &tmd_p : *mn)
460 AUTO_TRACE_ADD(
"found candidate member '{}' isTypeDef={}' isRelated={} mustBeRelated={}",
475 if (dist!=-1 && (md==
nullptr || dist<minDist))
497 if (args.
find(
")(")!=-1)
501 else if (args.
find(
'[')!=-1)
521static const char constScope[] = {
'c',
'o',
'n',
's',
't',
':' };
522static const char volatileScope[] = {
'v',
'o',
'l',
'a',
't',
'i',
'l',
'e',
':' };
523static const char virtualScope[] = {
'v',
'i',
'r',
't',
'u',
'a',
'l',
':' };
524static const char operatorScope[] = {
'o',
'p',
'e',
'r',
'a',
't',
'o',
'r',
'?',
'?',
'?' };
580 if (s.
length()*3>growBufLen)
582 growBufLen = s.
length()*3;
583 growBuf =
static_cast<char *
>(realloc(growBuf,growBufLen+1));
585 if (growBuf==
nullptr)
return s;
587 const char *src=s.
data();
598 while (i<l && isspace(
static_cast<uint8_t
>(src[i])))
605 char nc=i+1<l ? src[i+1] :
' ';
607 auto searchForKeyword = [&](
const char *kw,
size_t &matchLen,
size_t totalLen)
609 if (matchLen<=totalLen && c==kw[matchLen] &&
644 if (c==
'\\' && i+1<l)
668 if (i>0 && !isspace(
static_cast<uint8_t
>(pc)) &&
669 (
isId(pc) || pc==
'*' || pc==
'&' || pc==
'.' || pc==
'>') &&
670 (osp<8 || (osp==8 && pc!=
'-'))
676 if (i+1<l && (nc==
'-' || nc==
'&'))
683 if (i>0 && !isspace(
static_cast<uint8_t
>(pc)) &&
684 ((i+1<l && (
isId(nc) || nc==
'[')) ||
685 (i+2<l && nc==
'$' &&
isId(src[i+2])) ||
686 (i+3<l && nc==
'&' && src[i+2]==
'$' &&
isId(src[i+3]))
696 if (cliSupport && i+1<l && (
isId(nc) || nc==
'-'))
703 if (i+1<l && (
isId(nc) || nc==
'-'))
709 if (i>0 && pc!=
' ' && pc!=
'\t' && pc!=
':' &&
710 pc!=
'*' && pc!=
'&' && pc!=
'(' && pc!=
'/' && pc!=
'[' &&
720 if (i>0 &&
isId(pc) && osp<9)
740 if (i>0 && i+1<l && pc!=
'=' && pc!=
':' && !isspace(
static_cast<uint8_t
>(pc)) &&
771 !(pc==
',' && nc==
'.') &&
772 (osp<8 || (osp>=8 &&
isId(pc) &&
isId(nc)))
780 else if ((pc==
'*' || pc==
'&' || pc==
'.') && nc==
'>')
788 auto correctKeywordAllowedInsideScope = [&](
char cc,
size_t &matchLen,
size_t totalLen) {
789 if (c==cc && matchLen==totalLen)
791 if ((i+2<l && src[i+1] ==
':' && src[i+2] ==
':') ||
792 ((i>matchLen && src[i-matchLen] ==
':' && src[i-matchLen-1] ==
':'))
796 correctKeywordAllowedInsideScope(
't',csp, 5);
797 correctKeywordAllowedInsideScope(
'e',vosp,8);
798 correctKeywordAllowedInsideScope(
'l',vsp, 7);
800 auto correctKeywordNotPartOfScope = [&](
char cc,
size_t &matchLen,
size_t totalLen)
802 if (c==cc && matchLen==totalLen && i+1<l &&
810 correctKeywordNotPartOfScope(
't',csp, 5);
811 correctKeywordNotPartOfScope(
'e',vosp,8);
812 correctKeywordNotPartOfScope(
'l',vsp, 7);
832 if (templateDepth > 0)
834 int nextOpenPos=name.
findRev(
'>', pos);
835 int nextClosePos=name.
findRev(
'<', pos);
836 if (nextOpenPos!=-1 && nextOpenPos>nextClosePos)
841 else if (nextClosePos!=-1)
853 int lastAnglePos=name.
findRev(
'>', pos);
854 int bracePos=name.
findRev(
'(', pos);
855 if (lastAnglePos!=-1 && lastAnglePos>bracePos)
862 int bp = bracePos>0 ? name.
findRev(
'(',bracePos-1) : -1;
864 return bp==-1 || (bp>=8 && name.
mid(bp-8,10)==
"operator()") ? bracePos : bp;
875 return (name==scope ||
876 (scope.
right(nl)==name &&
877 sl>1+nl && scope.
at(sl-nl-1)==
':' && scope.
at(sl-nl-2)==
':'
886 return (name==scope ||
887 (name.
left(sl)==scope &&
888 nl>sl+1 && name.
at(sl)==
':' && name.
at(sl+1)==
':'
896 const QCString &text,
bool autoBreak,
bool external,
897 bool keepSpaces,
int indentLevel,
size_t breakThreshold)
899 AUTO_TRACE(
"scope={} fileScope={} text={} autoBreak={} external={} keepSpaces={} indentLevel={}",
900 scope?scope->
name():
"",fileScope?fileScope->
name():
"",
901 text,autoBreak,external,keepSpaces,indentLevel);
904 std::string_view txtStr=text.
view();
905 size_t strLen = txtStr.length();
906 if (strLen==0)
return;
908 static const reg::Ex regExp(R
"((::)?\a[\w~!\\.:$"]*)");
918 size_t floatingIndex=0;
919 for (; it!=
end ; ++it)
921 const auto &match = *it;
922 size_t newIndex = match.position();
923 size_t matchLen = match.length();
924 floatingIndex+=newIndex-skipIndex+matchLen;
925 if (newIndex>0 && txtStr.at(newIndex-1)==
'0')
927 std::string_view part = txtStr.substr(skipIndex,newIndex+matchLen-skipIndex);
929 skipIndex=index=newIndex+matchLen;
934 bool insideString=
FALSE;
935 for (
size_t i=index;i<newIndex;i++)
937 if (txtStr.at(i)==
'"') insideString=!insideString;
938 if (txtStr.at(i)==
'\\') i++;
942 if (strLen>breakThreshold+5 && floatingIndex>breakThreshold && autoBreak)
944 std::string_view splitText = txtStr.substr(skipIndex,newIndex-skipIndex);
945 size_t splitLength = splitText.length();
947 size_t i = splitText.find(
',');
948 if (i==std::string::npos) { i=splitText.find(
'<');
if (i!=std::string::npos) offset=0; }
949 if (i==std::string::npos) { i=splitText.find(
"||");
if (i!=std::string::npos) offset=2; }
950 if (i==std::string::npos) { i=splitText.find(
"&&");
if (i!=std::string::npos) offset=2; }
951 if (i==std::string::npos) { i=splitText.find(
">>");
if (i!=std::string::npos) offset=2; }
952 if (i==std::string::npos) i=splitText.find(
'>');
953 if (i==std::string::npos) i=splitText.find(
' ');
955 if (i!=std::string::npos)
957 std::string_view part1 = splitText.substr(0,i+offset);
959 out.
writeBreak(indentLevel==0 ? 0 : indentLevel+1);
960 std::string_view part2 = splitText.substr(i+offset);
962 floatingIndex=splitLength-i-offset+matchLen;
972 std::string_view part = txtStr.substr(skipIndex,newIndex-skipIndex);
976 std::string_view word=txtStr.substr(newIndex,matchLen);
1006 auto writeCompoundName = [&](
const auto *cd_) {
1007 if (external ? cd_->isLinkable() : cd_->isLinkableInProject())
1012 out.
writeLink(cd_->getReference(),cd_->getOutputFileBase(),cd_->anchor(),word);
1024 writeCompoundName(cd);
1026 else if ((cd=
getClass(matchWord+
"-p")))
1028 writeCompoundName(cd);
1032 writeCompoundName(cnd);
1036 writeCompoundName(d);
1043 int m = matchWord.
findRev(
"::");
1051 scopeName=scope->
name();
1055 scopeName = matchWord.
left(m);
1056 matchWord = matchWord.
mid(m+2);
1065 if (result.
found && result.
md &&
1072 if (result.
md!=self && (self==
nullptr || result.
md->
name()!=self->
name()))
1101 skipIndex=index=newIndex+matchLen;
1105 std::string_view lastPart = txtStr.substr(skipIndex);
1110 std::function<
void(
size_t)> replaceFunc)
1112 static const reg::Ex marker(R
"(@(\d+))");
1116 for ( ; it!=
end ; ++it)
1118 const auto &match = *it;
1119 size_t newIndex = match.position();
1120 size_t matchLen = match.length();
1121 ol.
parseText(markerText.substr(index,newIndex-index));
1122 unsigned long entryIndex = std::stoul(match[1].str());
1123 if (entryIndex<
static_cast<unsigned long>(numMarkers))
1125 replaceFunc(entryIndex);
1127 index=newIndex+matchLen;
1133 std::function<
QCString(
size_t)> replaceFunc)
1136 static const reg::Ex marker(R
"(@(\d+))");
1140 for ( ; it!=
end ; ++it)
1142 const auto &match = *it;
1143 size_t newIndex = match.position();
1144 size_t matchLen = match.length();
1145 result += markerText.substr(index,newIndex-index);
1146 unsigned long entryIndex = std::stoul(match[1].str());
1147 if (entryIndex<
static_cast<unsigned long>(numMarkers))
1149 result+=replaceFunc(entryIndex);
1151 index=newIndex+matchLen;
1153 if (index<markerText.size())
1155 result += markerText.substr(index);
1162 auto replaceFunc = [&list,&ol](
size_t entryIndex)
1164 const auto &e = list[entryIndex];
1196 if (a.hasDocumentation())
1200 paramDocs+=
" \\ilinebr @param"+direction+
" "+a.name+
" "+docsWithoutDir;
1214 if (!a.docs.isEmpty())
1216 if (!a.name.isEmpty())
1218 paramDocs+=
" \\ilinebr @tparam "+a.name+
" "+a.docs;
1220 else if (!a.type.isEmpty())
1226 paramDocs+=
" \\ilinebr @tparam "+type+
" "+a.docs;
1239 for (
auto it = al.
begin() ; it!=al.
end() ;)
1244 int i=type1.
find(
")(");
1248 type1=type1.
left(i);
1256 result+= type1+
" "+a.
name+type2+a.
array;
1260 result+= type1+type2;
1267 if (it!=al.
end()) result+=
", ";
1282 if (al.
empty())
return result;
1285 for (
const auto &a : al)
1287 if (a.defval.isEmpty() || includeDefault)
1289 if (!first) result+=
", ";
1290 if (!a.name.isEmpty())
1292 if (lang==SrcLangExt::Java || lang==SrcLangExt::CSharp)
1300 int i =
static_cast<int>(a.type.length())-1;
1301 while (i>=0 &&
isId(a.type.at(i))) i--;
1304 result+=a.type.
right(a.type.length()-i-1);
1305 if (a.type.find(
"...")!=-1)
1315 if (!a.typeConstraint.isEmpty() && lang==SrcLangExt::Java)
1317 result+=
" extends ";
1318 result+=a.typeConstraint;
1339 size_t len = contents.length();
1343 char c = contents[src++];
1347 if (src<len && contents[src] ==
'\n')
1352 else if ( c ==
'\0' && src<len-1)
1356 contents[dest++] = c;
1358 contents.resize(dest);
1365 for (
const auto &filterStr : filterList)
1368 int i_equals=fs.
find(
'=');
1375 filterPattern = filterPattern.
lower();
1376 input = input.
lower();
1383 if (filterName.
find(
' ')!=-1)
1385 filterName=
"\""+filterName+
"\"";
1405 if (name.
isEmpty())
return "";
1412 if (isSourceCode && !filterSrcList.empty())
1416 if (!found && filterName.
isEmpty())
1427 if (filterName.
length()>=2 && filterName[0]==
'"' && filterName[
static_cast<int>(filterName.
length())-1]==
'"')
1429 filterName = filterName.
mid(1,filterName.
length()-2);
1438 const char *outputEncoding =
"UTF-8";
1439 if (inputEncoding==
nullptr ||
qstricmp(inputEncoding,outputEncoding)==0)
return true;
1440 size_t inputSize=input.length();
1441 size_t outputSize=inputSize*4;
1444 if (cd==
reinterpret_cast<void *
>(-1))
1449 size_t iLeft=inputSize;
1450 size_t oLeft=outputSize;
1451 const char *inputPtr = input.data();
1452 char *outputPtr = output.
rawData();
1455 outputSize-=
static_cast<int>(oLeft);
1456 output.
resize(outputSize);
1457 output.
at(outputSize)=
'\0';
1477 bool fileOpened=
false;
1478 if (name[0]==
'-' && name[1]==0)
1480 std::string contents;
1482 while (getline(std::cin,line))
1484 contents+=line+
'\n';
1493 err(
"file '{}' not found\n",name);
1506 err(
"cannot open file '{}' for reading\n",name);
1514 for (
const auto &bcd : bcl)
1535 AUTO_TRACE(
"target='{}' str='{}'",target,str);
1536 if (target==str) { target.
clear();
return; }
1538 int l=
static_cast<int>(str.
length());
1541 while ((i=target.
find(str,p))!=-1)
1543 for (
int q=p;q<i;q++)
1545 if (target[q]==
'<') sharpCount++;
1546 else if (target[q]==
'>' && sharpCount>0) sharpCount--;
1548 bool isMatch = (i==0 || !
isId(target.
at(i-1))) &&
1549 (i+l==
static_cast<int>(target.
length()) || !
isId(target.
at(i+l))) &&
1550 !insideTemplate && sharpCount==0;
1553 int i1=target.
find(
'*',i+l);
1554 int i2=target.
find(
'&',i+l);
1555 if (i1==-1 && i2==-1)
1562 else if ((i1!=-1 && i<i1) || (i2!=-1 && i<i2))
1605 int i=s.
find(
" class ");
1606 if (i!=-1)
return s.
left(i)+s.
mid(i+6);
1607 i=s.
find(
" typename ");
1608 if (i!=-1)
return s.
left(i)+s.
mid(i+9);
1609 i=s.
find(
" union ");
1610 if (i!=-1)
return s.
left(i)+s.
mid(i+6);
1611 i=s.
find(
" struct ");
1612 if (i!=-1)
return s.
left(i)+s.
mid(i+7);
1625 if (!templSpec.
isEmpty() && templSpec.
at(0) ==
'<')
1632 templSpec = resolvedType;
1644 if (count>10)
return word;
1646 QCString symName,result,templSpec,tmpName;
1647 if (tSpec && !tSpec->
isEmpty())
1650 AUTO_TRACE(
"d='{}' fs='{}' word='{}' templSpec='{}'",d?d->
name():
"",fs?fs->
name():
"",word,templSpec);
1668 bool isTemplInst = cd && !templSpec.
isEmpty();
1669 if (!cd && !templSpec.
isEmpty())
1680 cd?cd->
name():
"",mType?mType->
name():
"",ts,resolvedType);
1703 if (cd==d && tSpec) *tSpec=
"";
1707 result = resolvedType+ts;
1715 if (tSpec) *tSpec=
"";
1729 result=cd->
name()+templSpec;
1779 resolvedType = lang==SrcLangExt::Java ? word :
resolveTypeDef(d,word);
1787 result = resolvedType;
1820 if (i>pp) canType += type.
mid(pp,i-pp);
1841 std::string ts = templSpec.
str();
1842 static const reg::Ex re(R
"(\a\w*)");
1849 for (; it!=
end ; ++it)
1851 const auto &match = *it;
1852 size_t ti = match.position();
1853 size_t tl = match.length();
1854 std::string matchStr = match.str();
1855 canType += ts.substr(tp,ti-tp);
1859 canType+=ts.substr(tp);
1875 if ((type==
"const" || type==
"volatile") && !name.
isEmpty())
1880 if (name==
"const" || name==
"volatile")
1882 if (!type.
isEmpty()) type+=
" ";
1900#define MATCH AUTO_TRACE_EXIT("match at line {}",__LINE__);
1901#define NOMATCH AUTO_TRACE_EXIT("no match at line {}",__LINE__);
1908 AUTO_TRACE(
"srcType='{}' dstType='{}'",srcType,dstType);
1909 if (srcType==dstType)
return true;
1912 int i1=srcType.
find(
")(");
1913 if (i1==-1)
return false;
1914 int i2=dstType.
find(
")(");
1915 if (i1!=i2)
return false;
1918 int j1=srcType.
find(
"(");
1919 if (j1==-1 || j1>i1)
return false;
1920 int j2=dstType.
find(
"(");
1921 if (j2!=j1)
return false;
1922 if (srcType.
left(j1)!=dstType.
left(j2))
return false;
1931 dstScope,dstFileScope,dstType.
left(j2),dstAl.get(),
1941 AUTO_TRACE(
"src: scope={} type={} name={} canType={}, dst: scope={} type={} name={} canType={}",
1960 srcA.
type+=sSrcName;
1964 else if (sDstName==srcType.
right(sDstName.
length()))
1966 dstA.
type+=sDstName;
1982 dstScope,dstFileScope,dstA.
canType,
2005 ASSERT(srcScope!=
nullptr && dstScope!=
nullptr);
2007 AUTO_TRACE(
"srcScope='{}' dstScope='{}' srcArgs='{}' dstArgs='{}' checkCV={} lang={}",
2010 if (srcAl==
nullptr || dstAl==
nullptr)
2012 bool match = srcAl==dstAl;
2043 if (srcAl->
size() != dstAl->
size())
2077 auto srcIt = srcAl->
begin();
2078 auto dstIt = dstAl->
begin();
2079 for (;srcIt!=srcAl->
end() && dstIt!=dstAl->
end();++srcIt,++dstIt)
2084 dstScope,dstFileScope,dstA,
2103 AUTO_TRACE(
"srcAl='{}',dstAl='{}',forceNameOverwrite={}",
2111 auto srcIt=srcAl.
begin();
2112 auto dstIt=dstAl.
begin();
2113 while (srcIt!=srcAl.
end() && dstIt!=dstAl.
end())
2118 AUTO_TRACE_ADD(
"before merge: src=[type='{}',name='{}',def='{}'] dst=[type='{}',name='{}',def='{}']",
2134 if (srcA.
name==
"const" || srcA.
name==
"volatile")
2139 if (dstA.
name==
"const" || dstA.
name==
"volatile")
2165 if (forceNameOverwrite)
2208 j1=
static_cast<int>(srcA.
type.
length())-i1-2,
2209 j2=
static_cast<int>(dstA.
type.
length())-i2-2;
2217 else if (i1==-1 && i2!=-1 && dstA.
type.
right(j2)==srcA.
type)
2237 AUTO_TRACE_ADD(
"after merge: src=[type='{}',name='{}',def='{}'] dst=[type='{}',name='{}',def='{}']",
2253 auto isUnconstraintTemplate = [](
const QCString &type)
2255 return type==
"typename" || type==
"class" || type.startsWith(
"typename ") || type.startsWith(
"class ");
2257 auto srcIt = srcAl.
begin();
2258 auto dstIt = dstAl.
begin();
2259 while (srcIt!=srcAl.
end() && dstIt!=dstAl.
end())
2263 if ((!isUnconstraintTemplate(srcA.
type) || !isUnconstraintTemplate(dstA.
type)) && srcA.
type!=dstA.
type)
2282 AUTO_TRACE(
"scopeName={},memberName={},forceEmptyScope={}",
2308 result.
found =
true;
2313 result.
found =
true;
2318 result.
found =
true;
2323 result.
found =
true;
2328 result.
found =
true;
2360 bool explicitGlobalScope=
FALSE;
2361 if (scopeName.
at(0)==
':' && scopeName.
at(1)==
':')
2364 explicitGlobalScope=
TRUE;
2372 int scopeOffset=explicitGlobalScope ? 0 :
static_cast<int>(docScopeName.
length());
2377 if (scopeOffset>0) fullName.
prepend(docScopeName.
left(scopeOffset)+
"::");
2401 else if ((scopeOffset=docScopeName.
findRev(
"::",scopeOffset-1))==-1)
2405 }
while (scopeOffset>=0);
2413 const char *p=s.
data();
2415 while ((c=
static_cast<uint8_t
>(*p++)))
if (!islower(c))
return false;
2428 bool lookForSpecialization,
2433 AUTO_TRACE(
"scope={} name={} inSeeBlock={} lang={} lookForSpecialization={} currentFile={} checkScope={}",
2434 scName,name,inSeeBlock,lang,lookForSpecialization,currentFile ? currentFile->
name() :
"", checkScope);
2439 if (fullName.
find(
"anonymous_namespace{")==-1)
2449 if (lang==SrcLangExt::CSharp && (templStartPos=fullName.
find(
'<'))!=-1)
2451 int templEndPos = fullName.
findRev(
'>');
2452 if (templEndPos!=-1)
2460 int endNamePos=bracePos!=-1 ? bracePos :
static_cast<int>(fullName.
length());
2461 int scopePos=fullName.
findRev(
"::",endNamePos);
2462 bool explicitScope = fullName.
startsWith(
"::") &&
2467 bool allowTypeOnly=
false;
2470 *resContext=
nullptr;
2477 if (!inSeeBlock && scopePos==-1 &&
isLowerCase(tsName))
2491 if (scName!=fullName &&
getScopeDefs(scName,fullName,cd,cnd,nd,modd))
2514 else if (scName==fullName || (!inSeeBlock && scopePos==-1))
2533 if (explicitScope) nameStr=nameStr.
mid(2);
2538 if (bracePos!=-1) argsStr=fullName.
right(fullName.
length()-bracePos);
2542 int templPos=nameStr.
find(
'<');
2543 bool tryUnspecializedVersion =
FALSE;
2544 if (templPos!=-1 && nameStr.
find(
"operator")==-1)
2546 int endTemplPos=nameStr.
findRev(
'>');
2547 if (endTemplPos!=-1)
2549 if (!lookForSpecialization)
2551 nameStr=nameStr.
left(templPos)+nameStr.
right(nameStr.
length()-endTemplPos-1);
2555 tryUnspecializedVersion =
TRUE;
2563 nameStr=nameStr.
mid(scopeStr.
length()+2);
2589 *resContext=
nullptr;
2599 *resMember=result.
md;
2600 *resContext=result.
md;
2604 *resContext=
nullptr;
2610 else if (result.
cd) *resContext=result.
cd;
2611 else if (result.
nd) *resContext=result.
nd;
2612 else if (result.
fd) *resContext=result.
fd;
2613 else if (result.
gd) *resContext=result.
gd;
2614 else if (result.
cnd) *resContext=result.
cnd;
2615 else if (result.
modd) *resContext=result.
modd;
2618 *resContext=
nullptr; *resMember=
nullptr;
2645 else if (tsName.
find(
'.')!=-1)
2657 if (tryUnspecializedVersion)
2659 bool b =
resolveRef(scName,name,inSeeBlock,resContext,resMember,lang,
FALSE,
nullptr,checkScope);
2687 if (!isFileName && result.
find(
'<')==-1) result=
substitute(result,
".",
"::",3);
2689 if (result.
at(0)==
':' && result.
at(1)==
':')
2713 *resContext=
nullptr;
2716 if (lang==SrcLangExt::CSharp)
2721 AUTO_TRACE(
"scName='{}',ref='{}'",scName,lr);
2726 const DirDef *dir =
nullptr;
2744 if (si) resAnchor = si->
label();
2756 resAnchor = si->
label();
2763 resAnchor = si->
label();
2793 else if (lang==SrcLangExt::Java &&
2794 (cd=
getClass(linkRefWithoutTemplates)))
2801 else if ((cd=
getClass(linkRef+
"-p")))
2818 resAnchor=modd->
anchor();
2839 if (md) resAnchor=md->
anchor();
2877 if (n.
isEmpty())
return nullptr;
2880 const int maxAddrSize = 20;
2881 char addr[maxAddrSize];
2882 qsnprintf(addr,maxAddrSize,
"%p:",
reinterpret_cast<const void*
>(fnMap));
2891 ambig = cachedResult->
isAmbig;
2902 if (name.
isEmpty())
return nullptr;
2909 if (name.
isEmpty())
return nullptr;
2916 const std::unique_ptr<FileDef> &fd = fn->front();
2918 fd->getPath().right(path.
length())==path :
2920 if (path.
isEmpty() || isSamePath)
2922 cachedResult->
fileDef = fd.get();
2931 for (
const auto &fd_p : *fn)
2945 cachedResult->
isAmbig = ambig;
2946 cachedResult->
fileDef = lastMatch;
2976 for (
const auto &s : examplePathList)
3018 for (
const auto &fd_p : *fn)
3026 if (!first) result +=
"\n";
3040 std::string substRes;
3042 const char *p = s.
data();
3046 substRes.reserve(s.
length()+1024);
3053 for (
const auto &kw : keywords)
3055 size_t keyLen =
qstrlen(kw.keyword);
3056 if (
qstrncmp(p,kw.keyword,keyLen)==0)
3058 const char *startArg = p+keyLen;
3059 bool expectParam = std::holds_alternative<KeywordSubstitution::GetValueWithParam>(kw.getValueVariant);
3061 if (expectParam && *startArg==
'(')
3064 const char *endArg =
nullptr;
3065 while ((c=*(startArg+j)) && c!=
')' && c!=
'\n' && c!=0) j++;
3066 if (c==
')') endArg=startArg+j;
3070 auto &&getValue = std::get<KeywordSubstitution::GetValueWithParam>(kw.getValueVariant);
3071 substRes+=getValue(value).str();
3078 warn(file,line,
"Missing argument for '{}'",kw.keyword);
3082 else if (!expectParam)
3084 auto &&getValue = std::get<KeywordSubstitution::GetValue>(kw.getValueVariant);
3085 substRes+=getValue().str();
3092 warn(file,line,
"Expected arguments for '{}' but none were specified",kw.keyword);
3102 if (c==
'\n') line++;
3130 int wi = projectLogo.
find(
" width=");
3133 projectLogo = projectLogo.
left(wi);
3135 int hi = projectLogo.
find(
" height=");
3138 projectLogo = projectLogo.
left(hi);
3151 auto extractDimension = [&projectLogo](
const char *startMarker,
size_t startPos,
size_t endPos) ->
QCString
3154 if (result.
length()>=2 && result.
at(0)!=
'"' && result.
at(result.
length()-1)!=
'"')
3156 result=
"\""+result+
"\"";
3162 int wi = projectLogo.
find(
" width=");
3163 int hi = projectLogo.
find(
" height=");
3164 if (wi!=-1 && hi!=-1)
3168 sizeVal = extractDimension(
" width=", wi+7, hi) +
" "
3169 + extractDimension(
" height=", hi+8, projectLogo.
length());
3173 sizeVal = extractDimension(
" height=", hi+8, wi) +
" "
3174 + extractDimension(
" width=", wi+7, projectLogo.
length());
3179 sizeVal = extractDimension(
" width=", wi+7, projectLogo.
length());
3183 sizeVal = extractDimension(
" height=", hi+8, projectLogo.
length());
3196 {
"$title", [&]() {
return !title.
isEmpty() ? title : projName; } },
3197 {
"$doxygenversion", [&]() {
return getDoxygenVersion(); } },
3198 {
"$projectname", [&]() {
return projName; } },
3199 {
"$projectnumber", [&]() {
return projNum; } },
3200 {
"$projectbrief", [&]() {
return projBrief; } },
3204 {
"$langISO", [&]() {
return theTranslator->trISOLang(); } },
3219 for (
const auto &s : sl)
3221 const char *ps=s.c_str();
3222 const char *pd=name.
data();
3224 while (*ps!=0 && *pd!=0 && *ps==*pd)
3230 if (*ps==0 && *pd!=0)
3246int getUtf8Char(
const char *input,
char ids[MAX_UTF8_CHAR_SIZE],CaseModifier modifier)
3249 const unsigned char uc = (
unsigned char)*input;
3250 bool validUTF8Char =
false;
3253 const char* pt = input+1;
3255 if ((uc&0x80)==0x00)
3259 case CaseModifier::None: ids[0]=*input;
break;
3260 case CaseModifier::ToUpper: ids[0]=(char)toupper(*input);
break;
3261 case CaseModifier::ToLower: ids[0]=(char)tolower(*input);
break;
3268 if ((uc&0xE0)==0xC0)
3272 if ((uc&0xF0)==0xE0)
3276 if ((uc&0xF8)==0xF0)
3281 validUTF8Char = l>0;
3282 for (
int m=1; m<l && validUTF8Char; ++m)
3284 unsigned char ct = (
unsigned char)*pt;
3285 if (ct==0 || (ct&0xC0)!=0x80)
3287 validUTF8Char=
false;
3308 if (caseSenseNames == CASE_SENSE_NAMES_t::YES)
return true;
3309 else if (caseSenseNames == CASE_SENSE_NAMES_t::NO)
return false;
3315 if (name.
isEmpty())
return name;
3321 const char *p=name.
data();
3326 case '_':
if (allowUnderscore) result+=
'_';
else result+=
"__";
break;
3327 case '-': result+=
'-';
break;
3328 case ':': result+=
"_1";
break;
3329 case '/': result+=
"_2";
break;
3330 case '<': result+=
"_3";
break;
3331 case '>': result+=
"_4";
break;
3332 case '*': result+=
"_5";
break;
3333 case '&': result+=
"_6";
break;
3334 case '|': result+=
"_7";
break;
3335 case '.':
if (allowDots) result+=
'.';
else result+=
"_8";
break;
3336 case '!': result+=
"_9";
break;
3337 case ',': result+=
"_00";
break;
3338 case ' ': result+=
"_01";
break;
3339 case '{': result+=
"_02";
break;
3340 case '}': result+=
"_03";
break;
3341 case '?': result+=
"_04";
break;
3342 case '^': result+=
"_05";
break;
3343 case '%': result+=
"_06";
break;
3344 case '(': result+=
"_07";
break;
3345 case ')': result+=
"_08";
break;
3346 case '+': result+=
"_09";
break;
3347 case '=': result+=
"_0a";
break;
3348 case '$': result+=
"_0b";
break;
3349 case '\\': result+=
"_0c";
break;
3350 case '@': result+=
"_0d";
break;
3351 case ']': result+=
"_0e";
break;
3352 case '[': result+=
"_0f";
break;
3353 case '#': result+=
"_0g";
break;
3354 case '"': result+=
"_0h";
break;
3355 case '~': result+=
"_0i";
break;
3356 case '\'': result+=
"_0j";
break;
3357 case ';': result+=
"_0k";
break;
3358 case '`': result+=
"_0l";
break;
3362 bool doEscape =
true;
3363 if (allowUnicodeNames)
3376 unsigned char id =
static_cast<unsigned char>(c);
3385 else if (caseSenseNames || !isupper(c))
3392 result+=
static_cast<char>(tolower(c));
3406 const char *p = s.
data();
3416 case '_': result+=c; p++;
break;
3417 case '1': result+=
':'; p++;
break;
3418 case '2': result+=
'/'; p++;
break;
3419 case '3': result+=
'<'; p++;
break;
3420 case '4': result+=
'>'; p++;
break;
3421 case '5': result+=
'*'; p++;
break;
3422 case '6': result+=
'&'; p++;
break;
3423 case '7': result+=
'|'; p++;
break;
3424 case '8': result+=
'.'; p++;
break;
3425 case '9': result+=
'!'; p++;
break;
3429 case '0': result+=
','; p+=2;
break;
3430 case '1': result+=
' '; p+=2;
break;
3431 case '2': result+=
'{'; p+=2;
break;
3432 case '3': result+=
'}'; p+=2;
break;
3433 case '4': result+=
'?'; p+=2;
break;
3434 case '5': result+=
'^'; p+=2;
break;
3435 case '6': result+=
'%'; p+=2;
break;
3436 case '7': result+=
'('; p+=2;
break;
3437 case '8': result+=
')'; p+=2;
break;
3438 case '9': result+=
'+'; p+=2;
break;
3439 case 'a': result+=
'='; p+=2;
break;
3440 case 'b': result+=
'$'; p+=2;
break;
3441 case 'c': result+=
'\\'; p+=2;
break;
3442 case 'd': result+=
'@'; p+=2;
break;
3443 case 'e': result+=
']'; p+=2;
break;
3444 case 'f': result+=
'['; p+=2;
break;
3445 case 'g': result+=
'#'; p+=2;
break;
3446 case 'h': result+=
'"'; p+=2;
break;
3447 case 'i': result+=
'~'; p+=2;
break;
3448 case 'j': result+=
'\''; p+=2;
break;
3449 case 'k': result+=
';'; p+=2;
break;
3450 case 'l': result+=
'`'; p+=2;
break;
3457 if (!caseSenseNames && c>=
'a' && c<=
'z')
3459 result+=
static_cast<char>(toupper(*p));
3490 if (name.
isEmpty())
return name;
3513 size_t resultLen = result.
length();
3517 uint8_t md5_sig[16];
3519 MD5Buffer(result.
data(),
static_cast<unsigned int>(resultLen),md5_sig);
3520 MD5SigToString(md5_sig,sigStr);
3521 result=result.
left(128-32)+sigStr;
3526 int l1Dir=0,l2Dir=0;
3527 int createSubdirsLevel =
Config_getInt(CREATE_SUBDIRS_LEVEL);
3528 int createSubdirsBitmaskL2 = (1<<createSubdirsLevel)-1;
3531 uint8_t md5_sig[16];
3532 MD5Buffer(result.
data(),
static_cast<unsigned int>(result.
length()),md5_sig);
3533 l1Dir = md5_sig[14] & 0xf;
3534 l2Dir = md5_sig[15] & createSubdirsBitmaskL2;
3545 const int sig_size=16;
3546 uint8_t md5_sig[sig_size];
3547 MD5Buffer(fn.
data(),
static_cast<unsigned int>(fn.
length()),md5_sig);
3548 char result[sig_size*3+2];
3551 for (
int i=0;i<sig_size;i++)
3553 static const char oct[]=
"01234567";
3554 uint8_t
byte = md5_sig[i];
3555 *p++=oct[(
byte>>6)&7];
3556 *p++=oct[(
byte>>3)&7];
3557 *p++=oct[(
byte>>0)&7];
3587 QCString absIncFileName = incFileName;
3597 else if (searchIncludes)
3600 for (
const auto &incPath : includePath)
3619 return absIncFileName;
3629 int createSubdirsLevelPow2 = 1 <<
Config_getInt(CREATE_SUBDIRS_LEVEL);
3630 for (
int l1=0; l1<16; l1++)
3636 term(
"Failed to create output directory '{}'\n",subdir);
3638 for (
int l2=0; l2<createSubdirsLevelPow2; l2++)
3641 subsubdir.
sprintf(
"d%x/d%02x",l1,l2);
3644 term(
"Failed to create output directory '{}'\n",subsubdir);
3656 int createSubdirsLevelPow2 = 1 <<
Config_getInt(CREATE_SUBDIRS_LEVEL);
3657 for (
int l1=0;l1<16;l1++)
3661 for (
int l2=0; l2 < createSubdirsLevelPow2; l2++)
3664 subsubdir.
sprintf(
"d%x/d%02x",l1,l2);
3683 bool allowEmptyClass)
3690 namespaceName=nd->
name();
3694 p=
static_cast<int>(clName.
length())-2;
3695 while (p>=0 && (i=clName.
findRev(
"::",p))!=-1)
3702 namespaceName=nd->
name();
3711 className=scopeName;
3712 namespaceName.
clear();
3715 if (className.
isEmpty() && !namespaceName.
isEmpty() && !allowEmptyClass)
3718 className=namespaceName;
3719 namespaceName.
clear();
3725 className = className.
left(className.
length()-2);
3766 int l =
static_cast<int>(result.
length());
3769 bool skipBracket=
FALSE;
3776 while (p>=0 && count>=0)
3778 char c=result.
at(p);
3784 if (p>0 && result.
at(p-1)==
':' && (count==0 || skipBracket))
3786 return result.
right(l-p-1);
3797 if (p>0 && result.
at(p-1)==
'>')
3805 bool foundMatch=
false;
3806 while (p>=0 && !foundMatch)
3818 if (round==0) count++;
3825 if (result.
at(p-1) ==
'<')
3832 foundMatch = count==0;
3847 done = count==0 || skipBracket;
3861 const char *p = s.
data();
3867 if ((c>=
'0' && c<=
'9') || (c>=
'a' && c<=
'z') || (c>=
'A' && c<=
'Z') || c==
'-')
3869 if (first && c>=
'0' && c<=
'9') result+=
'a';
3875 encChar[1]=
hex[
static_cast<unsigned char>(c)>>4];
3876 encChar[2]=
hex[
static_cast<unsigned char>(c)&0xF];
3901 const char *p = s.
data();
3907 case '<': result+=
"<";
break;
3908 case '>': result+=
">";
break;
3909 case '&':
if (keepEntities)
3915 if (ce==
';' || (!(
isId(ce) || ce==
'#')))
break;
3921 while (p<e) result+=*p++;
3933 case '\'': result+=
"'";
break;
3934 case '"': result+=
""";
break;
3935 case 1:
case 2:
case 3:
case 4:
case 5:
case 6:
case 7:
case 8:
3936 case 11:
case 12:
case 13:
case 14:
case 15:
case 16:
case 17:
case 18:
3937 case 19:
case 20:
case 21:
case 22:
case 23:
case 24:
case 25:
case 26:
3938 case 27:
case 28:
case 29:
case 30:
case 31:
3940 default: result+=c;
break;
3952 const char *p=s.
data();
3958 case '<': result+=
"<";
break;
3959 case '>': result+=
">";
break;
3960 case '&':
if (keepEntities)
3966 if (ce==
';' || (!(
isId(ce) || ce==
'#')))
break;
3972 while (p<e) result+=*p++;
3984 case '\'': result+=
"'";
break;
3985 case '"': result+=
""";
break;
3988 uint8_t uc =
static_cast<uint8_t
>(c);
3989 if (uc<32 && !isspace(c))
3993 result+=
hex[uc&0xF];
4012 const char *p=s.
data();
4018 case '"':
if (!singleQuotes) result+=
"\\\"";
else result+=c;
4020 case '\'':
if (singleQuotes) result+=
"\\\'";
else result+=c;
4022 case '\\':
if (*p==
'u' && *(p+1)==
'{') result+=
"\\";
4023 else result+=
"\\\\";
4025 default: result+=c;
break;
4035 std::string s = str.
data();
4036 static const reg::Ex re(R
"(&\a\w*;)");
4042 size_t p=0, i=0, l=0;
4043 for (; it!=
end ; ++it)
4045 const auto &match = *it;
4046 p = match.position();
4050 result+=s.substr(i,p-i);
4054 const char *code=
nullptr;
4065 result+=s.substr(i);
4085 ASSERT(context!=
nullptr);
4087 if (ml==
nullptr)
return;
4089 struct MoveMemberInfo
4092 : memberDef(md), memberGroup(mg), sli(rv) {}
4097 std::vector<MoveMemberInfo> movedMembers;
4099 for (
const auto &md : *ml)
4101 if (md->isEnumerate())
4103 for (
const auto &fmd : md->enumFieldList())
4105 int groupId=fmd->getMemberGroupId();
4111 const auto &info = it->second;
4112 auto mg_it = std::find_if(pMemberGroups->begin(),
4113 pMemberGroups->end(),
4114 [&groupId](
const auto &g)
4115 { return g->groupId()==groupId; }
4118 if (mg_it==pMemberGroups->end())
4120 auto mg = std::make_unique<MemberGroup>(
4129 pMemberGroups->push_back(std::move(mg));
4133 mg_ptr = (*mg_it).get();
4145 int groupId=md->getMemberGroupId();
4151 const auto &info = it->second;
4152 auto mg_it = std::find_if(pMemberGroups->begin(),
4153 pMemberGroups->end(),
4154 [&groupId](
const auto &g)
4155 { return g->groupId()==groupId; }
4158 if (mg_it==pMemberGroups->end())
4160 auto mg = std::make_unique<MemberGroup>(
4169 pMemberGroups->push_back(std::move(mg));
4173 mg_ptr = (*mg_it).get();
4175 movedMembers.emplace_back(md,mg_ptr,info->m_sli);
4181 for (
const auto &mmi : movedMembers)
4183 ml->
remove(mmi.memberDef);
4184 mmi.memberGroup->insertMember(mmi.memberDef->resolveAlias());
4185 mmi.memberGroup->setRefItems(mmi.sli);
4201 AUTO_TRACE(
"type='{}' name='{}' lang={}",type,name,lang);
4202 static const reg::Ex re_norm(R
"(\a[\w:]*)");
4203 static const reg::Ex re_fortran(R
"(\a[\w:()=]*)");
4213 size_t typeLen=type.
length();
4216 if (lang == SrcLangExt::Fortran)
4228 std::string s = type.
str();
4234 const auto &match = *it;
4235 size_t i = match.position();
4236 size_t l = match.length();
4241 while (ts<typeLen && type[
static_cast<uint32_t
>(ts)]==
' ') { ts++; tl++; }
4242 if (ts<typeLen && type[
static_cast<uint32_t
>(ts)]==
'<')
4247 while (te<typeLen && brCount!=0)
4249 if (type[
static_cast<uint32_t
>(te)]==
'<')
4251 if (te<typeLen-1 && type[
static_cast<uint32_t
>(te)+1]==
'<') te++;
else brCount++;
4253 if (type[
static_cast<uint32_t
>(te)]==
'>')
4255 if (te<typeLen-1 && type[
static_cast<uint32_t
>(te)+1]==
'>') te++;
else brCount--;
4265 pos=
static_cast<int>(i+l+tl);
4269 pos=
static_cast<int>(i+l);
4274 return static_cast<int>(i);
4277 pos =
static_cast<int>(typeLen);
4290 int p=name.
find(
'<');
4291 if (p==-1)
return name;
4295 std::string s = name.
mid(p).
str();
4296 static const reg::Ex re(R
"([\a:][\w:]*)");
4301 for (; it!=
end ; ++it)
4303 const auto &match = *it;
4304 size_t i = match.position();
4305 size_t l = match.length();
4306 result += s.substr(pi,i-pi);
4309 for (
const Argument &formArg : formalArgs)
4311 if (formArg.name == n)
4337 result+=s.substr(pi);
4355 if (formalArgs.
empty())
return nm;
4358 static const reg::Ex re(R
"(\a\w*)");
4359 std::string name = nm.str();
4364 for (; it!=
end ; ++it)
4366 const auto &match = *it;
4367 size_t i = match.position();
4368 size_t l = match.length();
4369 if (i>p) result += name.substr(p,i-p);
4374 actIt = actualArgs->
begin();
4381 for (
auto formIt = formalArgs.
begin();
4382 formIt!=formalArgs.
end() && !found;
4388 if (actualArgs && actIt!=actualArgs->
end())
4395 formArg.
type =
"class";
4400 formArg.
type =
"typename";
4404 formArg.
name +=
"...";
4409 formArg.
name +=
"...";
4416 if (formArg.
name==n && actualArgs && actIt!=actualArgs->
end() && !actArg.
type.
isEmpty())
4423 ii = subst.find(
'<');
4425 if (ii!=-1 &&
static_cast<int>(
prefix.length())>=ii+2 &&
prefix.mid(
prefix.length()-ii-2,ii+1)==subst.left(ii+1))
4430 while ((ii=subst.find(nameArg,pp))!=-1)
4432 bool beforeNonWord = ii==0 || !
isId(subst.at(ii-1));
4433 bool afterNonWord = subst.length()==ii+nameArg.length() || !
isId(subst.at(ii+nameArg.length()));
4434 if (beforeNonWord && afterNonWord)
4438 pp=ii+
static_cast<int>(nameArg.length());
4443 AUTO_TRACE_ADD(
"result={} n={} type={} hasRecursion={}",result,n,actArg.
type,hasRecursion(result,n,actArg.
type));
4444 if (!hasRecursion(result,n,actArg.
type))
4456 result += actArg.
type;
4462 result += actArg.
type+
" "+actArg.
name;
4467 else if (formArg.
name==n &&
4468 (actualArgs==
nullptr || actIt==actualArgs->
end()) &&
4477 else if (formArg.
name==n &&
4478 (actualArgs==
nullptr || actIt==actualArgs->
end()) &&
4486 if (actualArgs && actIt!=actualArgs->
end())
4497 result+=name.substr(p);
4515 bool allowArtificial)
4518 int i=fullName.
find(
'<');
4519 if (i==-1)
return fullName;
4522 int l=
static_cast<int>(fullName.
length());
4529 while (e<l && count>0)
4531 char c=fullName.
at(e++);
4534 case '(': round++;
break;
4535 case ')':
if (round>0) round--;
break;
4536 case '<':
if (round==0) count++;
break;
4537 case '>':
if (round==0) count--;
break;
4542 int si= fullName.
find(
"::",e);
4544 if (parentOnly && si==-1)
break;
4547 result+=fullName.
mid(p,i-p);
4550 if (cd!=
nullptr && (allowArtificial || !cd->
isArtificial()))
4552 result+=fullName.
mid(i,e-i);
4555 else if (pLastScopeStripped)
4558 *pLastScopeStripped=fullName.
mid(i,e-i);
4561 i=fullName.
find(
'<',p);
4563 result+=fullName.
right(l-p);
4580 AUTO_TRACE(
"leftScope='{}' rightScope='{}'",leftScope,rightScope);
4588 int i=0,p=
static_cast<int>(leftScope.
length());
4593 while ((i=leftScope.
findRev(
"::",p))>0)
4597 result = leftScope.
left(i+2)+rightScope;
4625 int sl=
static_cast<int>(s.
length());
4629 if (sp>=sl)
return -1;
4653 while (sp<sl && !done)
4659 case '<': count++;
break;
4660 case '>': count--;
if (count==0) done=
true;
break;
4693 bool newPage =
true;
4698 warn(fileName,startLine,
"multiple use of page label '{}' with different titles, (other occurrence: {}, line: {})",
4782 else if (si->
lineNr() != -1)
4784 warn(orgFile,line,
"multiple use of section label '{}', (first occurrence: {}, line {})",pd->
name(),si->
fileName(),si->
lineNr());
4788 warn(orgFile,line,
"multiple use of section label '{}', (first occurrence: {})",pd->
name(),si->
fileName());
4813 if (!key.
isEmpty() && key[0]!=
'@')
4818 item->setScope(scope);
4819 item->setName(name);
4820 item->setTitle(title);
4821 item->setArgs(args);
4822 item->setGroup(key);
4870 if (!first) { ol.
writeString(
" | "); }
else first=
false;
4882 if (!first) { ol.
writeString(
" | "); }
else first=
false;
4908 int i_fs = fName.
findRev(
'/');
4909 int i_bs = fName.
findRev(
'\\');
4910 int i = fName.
find(
'.',std::max({ i_fs, i_bs ,0}));
4938 result=result.
mid(i+1);
4943 result=result.
mid(i+1);
4956 if (str.
isEmpty() || word==
nullptr)
return false;
4957 static const reg::Ex re(R
"(\a+)");
4958 std::string s = str.str();
4961 if (it->str()==word)
return true;
4972 static reg::Ex re(R
"(\s*(<\a+>)\s*)");
4973 std::string s = sentence.str();
4979 for ( ; it!=
end ; ++it)
4981 const auto match = *it;
4982 std::string part = match[1].str();
4985 size_t i = match.position();
4986 size_t l = match.length();
4987 result+=s.substr(p,i-p);
4988 result+=match.str();
4994 size_t i = match[1].position();
4995 size_t l = match[1].length();
4996 result+=s.substr(p,i-p);
5000 result+=s.substr(p);
5016 const char *p = s.
data();
5019 int i=0,li=-1,l=
static_cast<int>(s.
length());
5023 if (c==
' ' || c==
'\t' || c==
'\r') { i++; p++; }
5024 else if (c==
'\\' &&
literal_at(p,
"\\ilinebr")) { i+=8; li=i; p+=8; }
5025 else if (c==
'\n') { i++; li=i; docLine++; p++; }
5035 if (c==
' ' || c==
'\t' || c==
'\r') { b--; p--; }
5036 else if (c==
'r' && b>=7 &&
literal_at(p-7,
"\\ilinebr")) { bi=b-7; b-=8; p-=8; }
5037 else if (c==
'>' && b>=11 &&
literal_at(p-11,
"\\ilinebr<br>")) { bi=b-11; b-=12; p-=12; }
5038 else if (c==
'\n') { bi=b; b--; p--; }
5043 if (li==-1 && bi==-1)
return s;
5050 return s.
mid(li,bi-li);
5068 {
"idl",
"c", SrcLangExt::IDL,
".idl" },
5069 {
"java",
"c", SrcLangExt::Java,
".java"},
5070 {
"javascript",
"c", SrcLangExt::JS,
".js" },
5071 {
"csharp",
"c", SrcLangExt::CSharp,
".cs" },
5072 {
"d",
"c", SrcLangExt::D,
".d" },
5073 {
"php",
"c", SrcLangExt::PHP,
".php" },
5074 {
"objective-c",
"c", SrcLangExt::ObjC,
".m" },
5075 {
"c",
"c", SrcLangExt::Cpp,
".c" },
5076 {
"c++",
"c", SrcLangExt::Cpp,
".cpp" },
5077 {
"slice",
"c", SrcLangExt::Slice,
".ice" },
5078 {
"python",
"python", SrcLangExt::Python,
".py" },
5079 {
"fortran",
"fortran", SrcLangExt::Fortran,
".f" },
5080 {
"fortranfree",
"fortranfree", SrcLangExt::Fortran,
".f90" },
5081 {
"fortranfixed",
"fortranfixed", SrcLangExt::Fortran,
".f" },
5082 {
"vhdl",
"vhdl", SrcLangExt::VHDL,
".vhdl"},
5083 {
"xml",
"xml", SrcLangExt::XML,
".xml" },
5084 {
"sql",
"sql", SrcLangExt::SQL,
".sql" },
5085 {
"md",
"md", SrcLangExt::Markdown,
".md" },
5086 {
"lex",
"lex", SrcLangExt::Lex,
".l" },
5093 [&langName](
const auto &info) { return info.langName==langName; });
5100 if (extName.
at(0)!=
'.') extName.
prepend(
".");
5110 err(
"Failed to assign extension {} to parser {} for language {}\n",
5111 extName.
data(),it1->parserName,language);
5199 if (extName.
isEmpty()) extName=
".no_extension";
5200 if (extName.
at(0)!=
'.') extName.
prepend(
".");
5216 if (lang == SrcLangExt::Unknown)
5220 if (langName.
at(0)==
'.') langName = langName.
mid(1);
5222 [&langName](
const auto &info) { return info.langName==langName; });
5225 lang = it->parserId;
5226 fileName = it->defExt;
5230 return SrcLangExt::Cpp;
5239 int lastDot = fn.
findRev(
'.');
5240 if (lastDot!=-1)
return fn.
mid(lastDot);
5249 if (scope==
nullptr ||
5269 if (qualifierIndex!=-1)
5271 explicitScopePart = name.
left(qualifierIndex);
5273 name = name.
mid(qualifierIndex+2);
5277 int minDistance = 10000;
5286 if (distance!=-1 && distance<minDistance)
5288 minDistance = distance;
5302 if (bestMatch && bestMatch->
isTypedef())
5310 if (startPos>=len)
return len;
5311 uint8_t c =
static_cast<uint8_t
>(utf8Str[startPos]);
5316 int (*matcher)(int) =
nullptr;
5317 c =
static_cast<uint8_t
>(utf8Str[startPos+bytes]);
5321 c =
static_cast<uint8_t
>(utf8Str[startPos+bytes]);
5325 matcher = std::isxdigit;
5329 matcher = std::isdigit;
5332 else if (std::isalnum(c))
5335 matcher = std::isalnum;
5339 while ((c =
static_cast<uint8_t
>(utf8Str[startPos+bytes]))!=0 && matcher(c))
5349 return startPos+bytes;
5366 .setAutolinkSupport(
false))
5368 auto astImpl =
dynamic_cast<const DocNodeAST*
>(ast.get());
5372 std::visit(visitor,astImpl->root);
5377 int l=
static_cast<int>(result.
length());
5381 if (charCnt>=80)
break;
5388 if (result.
at(i)==
',' ||
5389 result.
at(i)==
'.' ||
5390 result.
at(i)==
'!' ||
5391 result.
at(i)==
'?' ||
5399 if ( i < l) result=result.
left(i)+
"...";
5400 return result.
data();
5419 auto astImpl =
dynamic_cast<const DocNodeAST*
>(ast.get());
5427 std::visit(visitor,astImpl->root);
5444 if (al.
empty())
return;
5461 .setIndexWords(
true));
5471#ifdef TRACINGSUPPORT
5472 void *backtraceFrames[128];
5473 int frameCount = backtrace(backtraceFrames, 128);
5474 const size_t cmdLen = 40960;
5475 static char cmd[cmdLen];
5477 p +=
qsnprintf(p,cmdLen,
"/usr/bin/atos -p %d ", (
int)getpid());
5478 for (
int x = 0; x < frameCount; x++)
5480 p +=
qsnprintf(p,cmdLen,
"%p ", backtraceFrames[x]);
5482 fprintf(stderr,
"========== STACKTRACE START ==============\n");
5486 while (
size_t len = fread(resBuf, 1,
sizeof(resBuf), fp))
5488 fwrite(resBuf, 1, len, stderr);
5492 fprintf(stderr,
"============ STACKTRACE END ==============\n");
5501 if (
qstricmp(inputEncoding,outputEncoding)==0)
return;
5503 if (cd==
reinterpret_cast<void *
>(-1))
5505 term(
"unsupported character conversion: '{}'->'{}': {}\n"
5506 "Check the INPUT_ENCODING setting in the config file!\n",
5507 inputEncoding,outputEncoding,strerror(errno));
5509 size_t iLeft = contents.size();
5510 const char *srcPtr = contents.data();
5511 size_t tmpBufSize = contents.size()*4+1;
5512 size_t oLeft = tmpBufSize;
5514 tmpBuf.resize(tmpBufSize);
5515 char *dstPtr = tmpBuf.data();
5519 newSize = tmpBufSize-oLeft;
5520 tmpBuf.resize(newSize);
5521 std::swap(contents,tmpBuf);
5526 term(
"{}: failed to translate characters from {} to {}: check INPUT_ENCODING\n",
5527 fileName,inputEncoding,outputEncoding);
5539 if (filterName.
isEmpty() || !filter)
5544 err(
"could not open file {}\n",fileName);
5548 auto fileSize = fi.
size();
5549 contents.resize(fileSize);
5550 f.read(contents.data(),fileSize);
5553 err(
"problems while reading file {}\n",fileName);
5559 QCString cmd=filterName+
" \""+fileName+
"\"";
5564 err(
"could not execute filter {}\n",filterName);
5567 const int bufSize=4096;
5570 while ((numRead=
static_cast<int>(fread(buf,1,bufSize,f)))>0)
5573 contents.append(buf,numRead);
5580 if (contents.size()>=2 &&
5581 static_cast<uint8_t
>(contents[0])==0xFF &&
5582 static_cast<uint8_t
>(contents[1])==0xFE
5587 else if (contents.size()>=2 &&
5588 static_cast<uint8_t
>(contents[0])==0xFE &&
5589 static_cast<uint8_t
>(contents[1])==0xFF
5594 else if (contents.size()>=3 &&
5595 static_cast<uint8_t
>(contents[0])==0xEF &&
5596 static_cast<uint8_t
>(contents[1])==0xBB &&
5597 static_cast<uint8_t
>(contents[2])==0xBF
5600 contents.erase(0,3);
5616 std::string t = title.
str();
5617 static const reg::Ex re(R
"(%[a-z_A-Z]+)");
5621 for (; it!=
end ; ++it)
5623 const auto &match = *it;
5624 size_t i = match.position();
5625 size_t l = match.length();
5626 if (i>p) tf+=t.substr(p,i-p);
5627 tf+=match.str().substr(1);
5636template<
class PatternList,
class PatternElem,
typename PatternGet = QCString(*)(const PatternElem &)>
5638 const PatternList &patList,
5645 if (!patList.empty())
5651 for (
const auto &li : patList)
5653 std::string pattern = getter(li).str();
5654 if (!pattern.empty())
5656 size_t i=pattern.find(
'=');
5657 if (i!=std::string::npos) pattern=pattern.substr(0,i);
5659 if (!caseSenseNames)
5690 auto getter = [](std::string s) ->
QCString {
return s; };
5711 if (extLinksInWindow)
5712 return "target=\"_blank\" ";
5714 return "target=\"_parent\" ";
5731 if (!targetFileName.
isEmpty())
5736 if (!anchor.
isEmpty() && isLocalFile)
5764 result = it->second;
5765 size_t l = result.
length();
5766 if (!relPath.
isEmpty() && l>0 && result.
at(0)==
'.')
5771 if (l>0 && result.
at(l-1)!=
'/') result+=
'/';
5772 if (!href) result.
append(
"\" ");
5795 if (!img.
save(fileName))
5797 fprintf(stderr,
"Warning: Cannot open file %s for writing\n",data->
name);
5813 std::string s=str.
str();
5814 static const reg::Ex re(R
"(##[0-9A-Fa-f][0-9A-Fa-f])");
5820 size_t sl=s.length();
5822 for (; it!=
end ; ++it)
5824 const auto &match = *it;
5825 size_t i = match.position();
5826 size_t l = match.length();
5827 if (i>p) result+=s.substr(p,i-p);
5828 std::string lumStr = match.str().substr(2);
5829#define HEXTONUM(x) (((x)>='0' && (x)<='9') ? ((x)-'0') : \
5830 ((x)>='a' && (x)<='f') ? ((x)-'a'+10) : \
5831 ((x)>='A' && (x)<='F') ? ((x)-'A'+10) : 0)
5833 double r = 0,g = 0,b = 0;
5836 pow(level/255.0,gamma/100.0),&r,&g,&b);
5837 int red =
static_cast<int>(r*255.0);
5838 int green =
static_cast<int>(g*255.0);
5839 int blue =
static_cast<int>(b*255.0);
5842 colStr[1]=
hex[red>>4];
5843 colStr[2]=
hex[red&0xf];
5844 colStr[3]=
hex[green>>4];
5845 colStr[4]=
hex[green&0xf];
5846 colStr[5]=
hex[blue>>4];
5847 colStr[6]=
hex[blue&0xf];
5853 if (p<sl) result+=s.substr(p);
5864 err(
"could not copy file {} to {}\n",src,dest);
5878 int m1 = text.
find(marker);
5879 if (m1==-1)
return result;
5884 while (!found && (i=text.
find(
'\n',p))!=-1)
5886 found = (p<=m1 && m1<i);
5902 if (lang==SrcLangExt::Java || lang==SrcLangExt::CSharp || lang==SrcLangExt::VHDL || lang==SrcLangExt::Python)
5906 else if (lang==SrcLangExt::PHP && !classScope)
5918 static const std::unordered_set<std::string> schemes = {
5919 "http",
"https",
"ftp",
"ftps",
"sftp",
"file",
"news",
"irc",
"ircs"
5922 int colonPos = loc_url.
find(
':');
5923 return colonPos!=-1 && schemes.find(loc_url.
left(colonPos).
str())!=schemes.end();
5945 return (prot!=Protection::Private && prot!=Protection::Package) ||
5946 (prot==Protection::Private && extractPrivate) ||
5947 (prot==Protection::Package && extractPackage);
5958 const char *p=s.
data();
5961 int minIndent=1000000;
5962 bool searchIndent=
true;
5964 bool skipFirst = skipFirstLine;
5967 if (c==
'\t') { indent+=tabSize - (indent%tabSize); }
5968 else if (c==
'\n') { indent=0; searchIndent=
true; skipFirst=
false; }
5969 else if (c==
' ') { indent++; }
5970 else if (searchIndent && !skipFirst)
5973 if (indent<minIndent) minIndent=indent;
5978 if (minIndent==0)
return substitute(s,
"@ilinebr",
"\\ilinebr");
5984 skipFirst=skipFirstLine;
5993 else if (indent<minIndent && !skipFirst)
5997 int newIndent = indent+tabSize-(indent%tabSize);
6011 else if (c==
'\\' &&
literal_at(p,
"ilinebr "))
6014 result <<
"\\ilinebr ";
6017 for (
int j=0;j<minIndent;j++)
if (*(p+j)==
' ') skipAmount++;
6018 if (skipAmount==minIndent)
6025 result <<
"\\ilinebr";
6036 return result.
str();
6044 if (indentationLevel <= 0 || doc.
isEmpty())
return;
6049 const char *src = doc.
data();
6051 bool insideIndent = !skipFirstLine;
6053 if (!skipFirstLine) cnt = indentationLevel;
6061 insideIndent =
true;
6062 cnt = indentationLevel;
6073 insideIndent =
false;
6083 insideIndent =
false;
6088 doc.
resize(
static_cast<uint32_t
>(dst-doc.
data()));
6097 return ( ((allExternals && fd->
isLinkable()) ||
6115uint32_t getUtf8Code(
const QCString& s,
int idx )
6117 const int length = s.
length();
6118 if (idx >= length) {
return 0; }
6119 const uint32_t c0 = (uint8_t)s.
at(idx);
6120 if ( c0 < 0xC2 || c0 >= 0xF8 )
6124 if (idx+1 >= length) {
return 0; }
6125 const uint32_t c1 = ((uint8_t)s.
at(idx+1)) & 0x3f;
6128 return ((c0 & 0x1f) << 6) | c1;
6130 if (idx+2 >= length) {
return 0; }
6131 const uint32_t c2 = ((uint8_t)s.
at(idx+2)) & 0x3f;
6134 return ((c0 & 0x0f) << 12) | (c1 << 6) | c2;
6136 if (idx+3 >= length) {
return 0; }
6138 const uint32_t c3 = ((uint8_t)s.
at(idx+3)) & 0x3f;
6139 return ((c0 & 0x07) << 18) | (c1 << 12) | (c2 << 6) | c3;
6151uint32_t getUtf8CodeToLower(
const QCString& s,
int idx )
6153 const uint32_t v = getUtf8Code( s, idx );
6154 return v < 0x7f ? tolower( v ) : v;
6166uint32_t getUtf8CodeToUpper(
const QCString& s,
int idx )
6168 const uint32_t v = getUtf8Code( s, idx );
6169 return v < 0x7f ? toupper( v ) : v;
6183 std::string s = docs.
str();
6184 static const reg::Ex re(R
"(\[([ inout,]+)\])");
6189 const auto &match = *it;
6190 size_t p = match.position();
6191 size_t l = match.length();
6195 std::string dir = match[1].str();
6197 dir.erase(std::remove_if(dir.begin(),dir.end(),
6198 [](
const char c) { return c==
' ' || c==
','; }
6200 unsigned char ioMask=0;
6201 size_t inIndex = dir.find(
"in");
6202 if ( inIndex!=std::string::npos) { dir.erase( inIndex,2); ioMask|=(1<<0); }
6203 size_t outIndex = dir.find(
"out");
6204 if (outIndex!=std::string::npos) { dir.erase(outIndex,3); ioMask|=(1<<1); }
6205 if (dir.empty() && ioMask!=0)
6208 if (ioMask==((1<<0)|(1<<1)))
return "[in,out]";
6209 else if (ioMask==(1<<0))
return "[in]";
6210 else if (ioMask==(1<<1))
return "[out]";
6242 *outListType1=inListType;
6245 if (inProt==Protection::Public)
6252 else if (inProt==Protection::Protected)
6260 *outListType2=inListType.
toPublic();
6263 else if (inProt==Protection::Private)
6273 *outListType1=inListType.
toPublic();
6295 int i= imgExt.
find(
':');
6296 return i==-1 ? imgExt : imgExt.
left(i);
6301 assert(!f.is_open());
6302 bool fileOpened=
FALSE;
6303 bool writeToStdout=outFile==
"-";
6306 f.basic_ios<char>::rdbuf(std::cout.rdbuf());
6321 fileOpened = f.is_open();
6328 static const std::unordered_set<std::string> fortran_C_keywords = {
6329 "character",
"call",
"close",
"common",
"continue",
6330 "case",
"contains",
"cycle",
"class",
"codimension",
6331 "concurrent",
"contiguous",
"critical"
6334 if (*contents !=
'c' && *contents !=
'C')
return false;
6336 const char *c = contents;
6338 while (*c && *c !=
' ') {keyword += *c; c++;}
6339 keyword = keyword.
lower();
6341 return (fortran_C_keywords.find(keyword.
str()) != fortran_C_keywords.end());
6349 bool skipLine=
FALSE;
6355 size_t sizCont = contents.
length();
6356 for (
size_t i=0;i<sizCont;i++)
6360 switch(contents.
at(i))
6367 column += tabSize-1;
6384 if (column==1)
return TRUE;
6385 if (skipLine)
break;
6388 if (column!=6) skipLine=
TRUE;
6391 if (skipLine)
break;
6392 if (column>=7)
return TRUE;
6417 auto skipBlock = [&markerInfo](
const char *p,
const SelectionBlock &blk)
6424 size_t len = markerInfo.
endLen;
6425 bool negate = *(p+markerInfo.
endLen)==
'!';
6427 size_t blkNameLen =
qstrlen(blk.name);
6428 if (
qstrncmp(p+len,blk.name,blkNameLen)==0 &&
6432 return p+len+blkNameLen+markerInfo.
closeLen;
6449 const char *p = s.
data();
6459 bool negate = *(p+len)==
'!';
6461 for (
const auto &blk : blockList)
6463 size_t blkNameLen =
qstrlen(blk.name);
6464 if (
qstrncmp(p+len,blk.name,blkNameLen)==0 &&
6467 bool blockEnabled = blk.enabled!=negate;
6469 p+=len+blkNameLen+markerInfo.
closeLen;
6488 size_t len = markerInfo.
endLen;
6489 bool negate = *(p+len)==
'!';
6491 for (
const auto &blk : blockList)
6493 size_t blkNameLen =
qstrlen(blk.name);
6494 if (
qstrncmp(p+len,blk.name,blkNameLen)==0 &&
6498 p+=len+blkNameLen+markerInfo.
closeLen;
6529 const char *p = s.
data();
6538 bool negate = *(p+len)==
'!';
6544 if (markerInfo.
closeLen==0 && *p==
'\n')
6546 warn(fileName,-1,
"Remaining begin replacement with marker '{}'",marker);
6552 warn(fileName,-1,
"Remaining begin replacement with marker '{}'",marker);
6561 size_t len = markerInfo.
endLen;
6562 bool negate = *(p+len)==
'!';
6568 if (markerInfo.
closeLen==0 && *p==
'\n')
6570 warn(fileName,-1,
"Remaining end replacement with marker '{}'",marker);
6576 warn(fileName,-1,
"Remaining end replacement with marker '{}'",marker);
6593 const char *p=s.
data();
6602 while (*e==
' ' || *e==
'\t') e++;
6624 size_t prev = 0, pos = 0, len = s.length();
6627 pos = s.find(delimiter, prev);
6628 if (pos == std::string::npos) pos = len;
6629 if (pos>prev) result.push_back(s.substr(prev,pos-prev));
6630 prev = pos + delimiter.length();
6632 while (pos<len && prev<len);
6644 for ( ; iter !=
end; ++iter)
6646 const auto &match = *iter;
6647 size_t i=match.position();
6648 size_t l=match.length();
6649 if (i>p) result.push_back(s.substr(p,i-p));
6652 if (p<s.length()) result.push_back(s.substr(p));
6659 auto it = std::find(sv.begin(),sv.end(),s);
6660 return it!=sv.end() ?
static_cast<int>(it-sv.begin()) : -1;
6668 return reg::search(s,match,re) ?
static_cast<int>(match.position()) : -1;
6676 for (
const auto &s : sv)
6678 if (!first) result+=delimiter;
6692 while (residual > 0)
6694 modVal[0] = (upper ?
'A':
'a') + (residual-1)%26;
6695 result = modVal + result;
6696 residual = (residual-1) / 26;
6703 static const char *str_romans_upper[] = {
"M",
"CM",
"D",
"CD",
"C",
"XC",
"L",
"XL",
"X",
"IX",
"V",
"IV",
"I" };
6704 static const char *str_romans_lower[] = {
"m",
"cm",
"d",
"cd",
"c",
"xc",
"l",
"xl",
"x",
"ix",
"v",
"iv",
"i" };
6705 static const int values[] = { 1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1 };
6706 static const char **str_romans = upper ? str_romans_upper : str_romans_lower;
6711 for (
int i = 0; i < 13; ++i)
6713 while (residual - values[i] >= 0)
6715 result += str_romans[i];
6716 residual -= values[i];
6726 size_t size = s.
length();
6729 const char *data = s.
data();
6732 constexpr auto doxy_nbsp =
"&_doxy_nbsp;";
6733 const int maxIndent=1000000;
6734 int minIndent=maxIndent;
6743 int stop = tabSize - (col%tabSize);
6746 while (stop--) result+=
' ';
6750 if (data[i] ==
'\\')
6756 else if (i+5<size &&
literal_at(data+i,
"iskip"))
6761 else if (i+8<size &&
literal_at(data+i,
"endiskip"))
6793 for (
int j=0;j<bytes-1 && c;j++)
6805 if (!skip && col<minIndent) minIndent=col;
6809 if (minIndent!=maxIndent) refIndent=minIndent;
else refIndent=0;
6818 uint8_t md5_sig[16];
6820 MD5Buffer(projectCookie.
data(),
static_cast<unsigned int>(projectCookie.
length()),md5_sig);
6821 MD5SigToString(md5_sig,sigStr);
6822 sigStr[32]=
'_'; sigStr[33]=0;
6829 int l =
static_cast<int>(name.
length());
6830 int lastSepPos = -1;
6831 const char *p = name.
data();
6840 if (sharpCount==0 && p[i+1]==
':' && p[i+2]==
':')
6854 if (ts==-1) ts=0;
else p+=++ts;
6855 for (i=ts;i<l-1;i++)
6858 if (c==
':' && *p==
':') lastSepPos=i;
6893 case '\t': col+=tabSize - (col%tabSize);
6902 for (
int i=0;i<numBytes-1 && (c=*s++);i++) {}
6903 if (c==0)
return col;
6918 int idx = name.
find(
'<');
6931 int idx = result.
find(
'-');
6932 result = result.
left(idx)+templArgs;
6940 int i = text.
find(
'"');
6964 uint8_t md5_sig[16];
6966 MD5Buffer(content.
data(),
static_cast<unsigned int>(content.
length()),md5_sig);
6967 MD5SigToString(md5_sig,sigStr);
6969 QCString fileName = baseName + sigStr + extension;
6979 file.write( content.
data(), content.
length() );
6984 err(
"Could not open file {} for writing\n",fileName);
This class represents an function or template argument list.
RefQualifierType refQualifier() const
bool pureSpecifier() const
bool hasParameters() const
bool hasDocumentation() const
QCString trailingReturnType() const
typename Vec::const_iterator const_iterator
bool constSpecifier() const
bool hasTemplateDocumentation() const
bool volatileSpecifier() const
A abstract class representing of a compound symbol.
virtual const ArgumentList & templateArguments() const =0
Returns the template arguments of this class.
virtual bool isTemplate() const =0
Returns TRUE if this class is a template.
virtual const BaseClassList & baseClasses() const =0
Returns the list of base classes from which this class directly inherits.
virtual QCString qualifiedNameWithTemplateParameters(const ArgumentLists *actualParams=nullptr, uint32_t *actualParamIndex=nullptr) const =0
virtual FileDef * getFileDef() const =0
Returns the namespace this compound is in, or 0 if it has a global scope.
virtual bool isUsedOnly() const =0
Class representing a bitmap image colored based on hue/sat/gamma settings.
static void hsl2rgb(double h, double s, double l, double *pRed, double *pGreen, double *pBlue)
bool save(const QCString &fileName)
virtual const FileDef * getFileDef() const =0
static void print(DebugMask mask, int prio, fmt::format_string< Args... > fmt, Args &&... args)
The common base class of all entity definitions found in the sources.
virtual QCString docFile() const =0
virtual SrcLangExt getLanguage() const =0
Returns the programming language this definition was written in.
virtual int docLine() const =0
virtual bool isLinkable() const =0
virtual DefType definitionType() const =0
virtual QCString anchor() const =0
virtual bool isLinkableInProject() const =0
virtual const Definition * findInnerCompound(const QCString &name) const =0
virtual QCString getReference() const =0
virtual const GroupList & partOfGroups() const =0
virtual QCString qualifiedName() const =0
virtual QCString displayName(bool includeScope=TRUE) const =0
virtual bool isArtificial() const =0
virtual QCString getOutputFileBase() const =0
virtual Definition * getOuterScope() const =0
virtual int getStartBodyLine() const =0
virtual bool isReference() const =0
virtual const QCString & name() const =0
virtual void setBodySegment(int defLine, int bls, int ble)=0
virtual void setDocumentation(const QCString &d, const QCString &docFile, int docLine, bool stripWhiteSpace=TRUE)=0
virtual void setLanguage(SrcLangExt lang)=0
virtual void setReference(const QCString &r)=0
virtual void setRefItems(const RefItemVector &sli)=0
A model of a directory symbol.
Class representing a directory in the file system.
bool mkdir(const std::string &path, bool acceptsAbsPath=true) const
bool remove(const std::string &path, bool acceptsAbsPath=true) const
bool isEmpty(const std::string &subdir) const
bool rmdir(const std::string &path, bool acceptsAbsPath=true) const
bool rename(const std::string &orgName, const std::string &newName, bool acceptsAbsPath=true) const
static std::string cleanDirPath(const std::string &path)
Class representing the abstract syntax tree of a documentation block.
static NamespaceLinkedMap * namespaceLinkedMap
static ConceptLinkedMap * conceptLinkedMap
static std::unique_ptr< PageDef > mainPage
static FileNameLinkedMap * inputNameLinkedMap
static ParserManager * parserManager
static InputFileEncodingList inputFileEncodingList
static MemberNameLinkedMap * functionNameLinkedMap
static PageLinkedMap * exampleLinkedMap
static NamespaceDefMutable * globalScope
static MemberGroupInfoMap memberGroupInfoMap
static IndexList * indexList
static StringMap tagDestinationMap
static QCString htmlFileExtension
static PageLinkedMap * pageLinkedMap
static DirLinkedMap * dirLinkedMap
static MemberNameLinkedMap * memberNameLinkedMap
static SymbolMap< Definition > * symbolMap
static FileNameLinkedMap * exampleNameLinkedMap
static GroupLinkedMap * groupLinkedMap
Wrapper class for the Entry type.
A model of a file symbol.
virtual ModuleDef * getModuleDef() const =0
virtual QCString getPath() const =0
virtual bool generateSourceFile() const =0
virtual QCString absFilePath() const =0
virtual bool isDocumentationFile() const =0
Minimal replacement for QFileInfo.
std::string extension(bool complete) const
std::string fileName() const
std::string dirPath(bool absPath=true) const
std::string filePath() const
std::string absFilePath() const
Class representing all files with a certain base name.
Ordered dictionary of FileName objects.
A model of a group of symbols.
virtual void addPage(PageDef *def)=0
Generator for HTML code fragments.
Concrete visitor implementation for HTML output.
static HtmlEntityMapper & instance()
Returns the one and only instance of the HTML entity mapper.
SymType name2sym(const QCString &symName) const
Give code of the requested HTML entity name.
const T * find(const std::string &key) const
A model of a class/file/namespace member symbol.
virtual QCString typeString() const =0
virtual bool isRelated() const =0
virtual const ClassDef * getClassDef() const =0
virtual bool hasReferencesRelation() const =0
virtual GroupDef * getGroupDef()=0
virtual bool isTypedef() const =0
virtual bool hasCallGraph() const =0
virtual const FileDef * getFileDef() const =0
virtual bool isStrongEnumValue() const =0
virtual bool hasInlineSource() const =0
virtual bool hasEnumValues() const =0
virtual const NamespaceDef * getNamespaceDef() const =0
virtual bool hasCallerGraph() const =0
virtual void setMemberGroup(MemberGroup *grp)=0
virtual bool isEnumerate() const =0
virtual bool hasReferencedByRelation() const =0
virtual bool isVariable() const =0
virtual QCString argsString() const =0
virtual void overrideReferencesRelation(bool e)=0
virtual void overrideReferencedByRelation(bool e)=0
virtual void overrideCallGraph(bool e)=0
virtual void overrideInlineSource(bool e)=0
virtual void overrideEnumValues(bool e)=0
virtual void overrideCallerGraph(bool e)=0
A class representing a group of members.
void insertMember(MemberDef *md)
A list of MemberDef objects as shown in documentation sections.
MemberListContainer container() const
Wrapper class for the MemberListType type.
constexpr bool isPrivate() const noexcept
constexpr MemberListType toPublic() const noexcept
static constexpr MemberListType Invalid() noexcept
constexpr MemberListType toProtected() const noexcept
constexpr bool isProtected() const noexcept
ML_TYPES constexpr bool isPublic() const noexcept
Ordered dictionary of MemberName objects.
void remove(const MemberDef *md)
static ModuleManager & instance()
An abstract interface of a namespace symbol.
Class representing a list of different code generators.
void add(OutputCodeIntfPtr &&p)
Class representing a list of output generators that are written to in parallel.
void endPageRef(const QCString &c, const QCString &a)
void writeString(const QCString &text)
void disable(OutputType o)
void writeObjectLink(const QCString &ref, const QCString &file, const QCString &anchor, const QCString &name)
void startConstraintParam()
void docify(const QCString &s)
void generateDoc(const QCString &fileName, int startLine, const Definition *ctx, const MemberDef *md, const QCString &docStr, const DocOptions &options)
void startConstraintDocs()
void startConstraintType()
void pushGeneratorState()
void disableAllBut(OutputType o)
void endConstraintParam()
void startConstraintList(const QCString &header)
void parseText(const QCString &textStr)
A model of a page symbol.
virtual void setTitle(const QCString &title)=0
virtual void setNestingLevel(int)=0
virtual bool hasTitle() const =0
virtual void setFileName(const QCString &name)=0
virtual void setShowLineNo(bool)=0
virtual QCString title() const =0
virtual void setPageScope(Definition *)=0
virtual const GroupDef * getGroupDef() const =0
This is an alternative implementation of QCString.
int find(char c, int index=0, bool cs=TRUE) const
QCString & prepend(const char *s)
size_t length() const
Returns the length of the string, not counting the 0-terminator.
bool startsWith(const char *s) const
QCString mid(size_t index, size_t len=static_cast< size_t >(-1)) const
bool endsWith(const char *s) const
char & at(size_t i)
Returns a reference to the character at index i.
char * rawData()
Returns a writable pointer to the data.
bool isEmpty() const
Returns TRUE iff the string is empty.
QCString stripWhiteSpace() const
returns a copy of this string with leading and trailing whitespace removed
void resize(size_t newlen)
const std::string & str() const
QCString & setNum(short n)
QCString simplifyWhiteSpace() const
return a copy of this string with leading and trailing whitespace removed and multiple whitespace cha...
QCString & append(char c)
QCString right(size_t len) const
void reserve(size_t size)
Reserve space for size bytes without changing the string contents.
QCString & sprintf(const char *format,...)
int findRev(char c, int index=-1, bool cs=TRUE) const
const char * data() const
Returns a pointer to the contents of the string in the form of a 0-terminated C string.
std::string_view view() const
QCString left(size_t len) const
int contains(char c, bool cs=TRUE) const
bool stripPrefix(const QCString &prefix)
This struct represents an item in the list of references.
class that provide information about a section.
Definition * definition() const
QCString fileName() const
void setTitle(const QCString &t)
SectionInfo * replace(const QCString &label, const QCString &fileName, int lineNr, const QCString &title, SectionType type, int level, const QCString &ref=QCString())
SectionInfo * add(const SectionInfo &si)
static SectionManager & instance()
returns a reference to the singleton
static constexpr int Page
int isAccessibleFrom(const Definition *scope, const Definition *item)
Checks if symbol item is accessible from within scope.
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.
QCString getResolvedType() const
In case a call to resolveClass() points to a typedef or using declaration.
const Definition * resolveSymbol(const Definition *scope, const QCString &name, const QCString &args=QCString(), bool checkCV=false, bool insideCode=false, bool onlyLinkable=false)
Find the symbool definition matching name within the scope set.
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 getTemplateSpec() const
In case a call to resolveClass() points to a template specialization, the template part is return via...
void setFileScope(const FileDef *fd)
Sets or updates the file scope using when resolving symbols.
const MemberDef * getTypedef() const
In case a call to resolveClass() resolves to a type member (e.g.
Concrete visitor implementation for TEXT output.
Abstract interface for a hyperlinked text fragment.
virtual void writeString(std::string_view, bool) const =0
virtual void writeBreak(int indent) const =0
virtual void writeLink(const QCString &extRef, const QCString &file, const QCString &anchor, std::string_view text) const =0
Implements TextGeneratorIntf for an OutputDocInterface stream.
TextGeneratorOLImpl(OutputList &ol)
void writeBreak(int indent) const override
void writeLink(const QCString &extRef, const QCString &file, const QCString &anchor, std::string_view text) const override
void writeString(std::string_view s, bool keepSpaces) const override
Text streaming class that buffers data.
std::string str() const
Return the contents of the buffer as a std::string object.
ClassDef * getClass(const QCString &n)
ClassDef * toClassDef(Definition *d)
std::vector< BaseClassDef > BaseClassList
Class representing a regular expression.
@ Wildcard
simple globbing pattern.
Class to iterate through matches.
Object representing the matching results.
ConceptDef * toConceptDef(Definition *d)
ConceptDef * getConcept(const QCString &n)
#define Config_getInt(name)
#define Config_getList(name)
#define Config_getEnumAsString(name)
#define Config_getBool(name)
#define Config_getString(name)
#define Config_getEnum(name)
std::unordered_set< std::string > StringUnorderedSet
std::vector< std::string > StringVector
QCString formatDateTime(const QCString &format, const std::tm &dt, int &formatUsed)
Return a string representation for a given std::tm value that is formatted according to the pattern g...
QCString dateTimeFromString(const QCString &spec, std::tm &dt, int &format)
Returns the filled in std::tm for a given string representing a date and/or time.
std::unique_ptr< ArgumentList > stringToArgumentList(SrcLangExt lang, const QCString &argsString, QCString *extraTypeChars=nullptr)
DirIterator end(const DirIterator &) noexcept
static constexpr auto hex
#define AUTO_TRACE_ADD(...)
#define AUTO_TRACE_EXIT(...)
constexpr DocNodeVariant * parent(DocNodeVariant *n)
returns the parent node of a given node n or nullptr if the node has no parent.
IDocNodeASTPtr validatingParseDoc(IDocParser &parserIntf, const QCString &fileName, int startLine, const Definition *ctx, const MemberDef *md, const QCString &input, const DocOptions &options)
IDocParserPtr createDocParser()
factory function to create a parser
IDocNodeASTPtr validatingParseTitle(IDocParser &parserIntf, const QCString &fileName, int lineNr, const QCString &input)
static void addMembersToMemberGroup()
FileDef * toFileDef(Definition *d)
Translator * theTranslator
MemberDefMutable * toMemberDefMutable(Definition *d)
MemberDef * toMemberDef(Definition *d)
#define warn(file, line, fmt,...)
ModuleDef * toModuleDef(Definition *d)
std::ifstream openInputStream(const QCString &name, bool binary=false, bool openAtEnd=false)
FILE * popen(const QCString &name, const QCString &type)
std::ofstream openOutputStream(const QCString &name, bool append=false)
bool fileSystemIsCaseSensitive()
void replaceNamespaceAliases(QCString &name)
NamespaceDef * getResolvedNamespace(const QCString &name)
NamespaceDef * toNamespaceDef(Definition *d)
bool search(std::string_view 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.
std::string replace(std::string_view str, const Ex &re, std::string_view replacement)
Searching in a given input string for parts that match regular expression re and replaces those parts...
bool match(std::string_view str, Match &match, const Ex &re)
Matches a given string str for a match against regular expression re.
Token literal values and constants.
std::unique_ptr< PageDef > createPageDef(const QCString &f, int l, const QCString &n, const QCString &d, const QCString &t)
Portable versions of functions that are platform dependent.
int portable_iconv_close(void *cd)
size_t portable_iconv(void *cd, const char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft)
void * portable_iconv_open(const char *tocode, const char *fromcode)
int qstricmp(const char *s1, const char *s2)
QCString substitute(const QCString &s, const QCString &src, const QCString &dst)
substitute all occurrences of src in s by dst
int qstrncmp(const char *str1, const char *str2, size_t len)
const char * qPrint(const char *s)
uint32_t qstrlen(const char *str)
Returns the length of string str, or 0 if a null pointer is passed.
std::vector< RefItem * > RefItemVector
Web server based search engine.
Some helper functions for std::string.
void addTerminalCharIfMissing(std::string &s, char c)
bool literal_at(const char *data, const char(&str)[N])
returns TRUE iff data points to a substring that matches string literal str
This class contains the information about the argument of a function or template.
Data associated with a HSV colored image.
const unsigned char * content
const unsigned char * alpha
Cache element for the file name to FileDef mapping cache.
FindFileCacheElem(FileDef *fd, bool ambig)
This struct is used to capture the tag file information for an Entry.
static constexpr const char * to_string(Protection prot) noexcept
int isUTF8NonBreakableSpace(const char *input)
Check if the first character pointed at by input is a non-breakable whitespace character.
uint8_t getUTF8CharNumBytes(char c)
Returns the number of bytes making up a single UTF8 character given the first byte in the sequence.
Various UTF8 related helper functions.
QCString writeFileContents(const QCString &baseName, const QCString &extension, const QCString &content, bool &exists)
Thread-safe function to write a string to a file.
QCString externalRef(const QCString &relPath, const QCString &ref, bool href)
bool matchArguments2(const Definition *srcScope, const FileDef *srcFileScope, const QCString &srcReturnType, const ArgumentList *srcAl, const Definition *dstScope, const FileDef *dstFileScope, const QCString &dstReturnType, const ArgumentList *dstAl, bool checkCV, SrcLangExt lang)
QCString removeRedundantWhiteSpace(const QCString &s)
QCString extractDirection(QCString &docs)
Strip the direction part from docs and return it as a string in canonical form The input docs string ...
QCString mergeScopes(const QCString &leftScope, const QCString &rightScope)
QCString findFilePath(const QCString &file, bool &ambig)
QCString normalizeNonTemplateArgumentsInString(const QCString &name, const Definition *context, const ArgumentList &formalArgs)
QCString linkToText(SrcLangExt lang, const QCString &link, bool isFileName)
QCString convertToJSString(const QCString &s, bool keepEntities, bool singleQuotes)
size_t updateColumnCount(const char *s, size_t col)
static std::mutex writeFileContents_lock
void trimBaseClassScope(const BaseClassList &bcl, QCString &s, int level=0)
SrcLangExt getLanguageFromFileName(const QCString &fileName, SrcLangExt defLang)
QCString insertTemplateSpecifierInScope(const QCString &scope, const QCString &templ)
bool protectionLevelVisible(Protection prot)
QCString generateAnonymousAnchor(const QCString &fileName, int count)
static std::unordered_map< std::string, QCString > g_docCache
QCString parseCommentAsHtml(const Definition *scope, const MemberDef *member, const QCString &doc, const QCString &fileName, int lineNr)
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
bool matchTemplateArguments(const ArgumentList &srcAl, const ArgumentList &dstAl)
int lineBlock(const QCString &text, const QCString &marker)
Returns the line number of the line following the line with the marker.
void addCodeOnlyMappings()
QCString convertToHtml(const QCString &s, bool keepEntities)
QCString substituteTemplateArgumentsInString(const QCString &nm, const ArgumentList &formalArgs, const ArgumentList *actualArgs)
static int g_usedNamesCount
static void filterCRLF(std::string &contents)
bool resolveRef(const QCString &scName, const QCString &name, bool inSeeBlock, const Definition **resContext, const MemberDef **resMember, SrcLangExt lang, bool lookForSpecialization, const FileDef *currentFile, bool checkScope)
QCString stripIndentation(const QCString &s, bool skipFirstLine)
QCString parseCommentAsText(const Definition *scope, const MemberDef *md, const QCString &doc, const QCString &fileName, int lineNr)
int extractClassNameFromType(const QCString &type, int &pos, QCString &name, QCString &templSpec, SrcLangExt lang)
QCString integerToRoman(int n, bool upper)
void checkBlocks(const QCString &s, const QCString fileName, const SelectionMarkerInfo &markerInfo)
void stripIndentationVerbatim(QCString &doc, const int indentationLevel, bool skipFirstLine)
void writeTypeConstraints(OutputList &ol, const Definition *d, const ArgumentList &al)
bool leftScopeMatch(const QCString &scope, const QCString &name)
QCString correctURL(const QCString &url, const QCString &relPath)
Corrects URL url according to the relative path relPath.
QCString stripAnonymousNamespaceScope(const QCString &s)
QCString stripPath(const QCString &s)
QCString stripFromIncludePath(const QCString &path)
static Cache< std::string, FindFileCacheElem > g_findFileDefCache(5000)
QCString removeEmptyLines(const QCString &s)
QCString extractEndRawStringDelimiter(const char *rawEnd)
static const char constScope[]
static bool recursivelyAddGroupListToTitle(OutputList &ol, const Definition *d, bool root)
bool containsWord(const QCString &str, const char *word)
returns TRUE iff string s contains word w
bool checkIfTypedef(const Definition *scope, const FileDef *fileScope, const QCString &n)
bool readInputFile(const QCString &fileName, std::string &contents, bool filter, bool isSourceCode)
read a file name fileName and optionally filter and transcode it
bool transcodeCharacterStringToUTF8(std::string &input, const char *inputEncoding)
static bool matchCanonicalTypes(const Definition *srcScope, const FileDef *srcFileScope, const QCString &srcType, const Definition *dstScope, const FileDef *dstFileScope, const QCString &dstType, SrcLangExt lang)
bool patternMatch(const FileInfo &fi, const StringVector &patList)
void generateFileRef(OutputList &ol, const QCString &name, const QCString &text)
QCString generateMarker(int id)
QCString selectBlocks(const QCString &s, const SelectionBlockList &blockList, const SelectionMarkerInfo &markerInfo)
remove disabled blocks and all block markers from s and return the result as a string
static std::mutex g_findFileDefMutex
QCString escapeCharsInString(const QCString &name, bool allowDots, bool allowUnderscore)
static std::unordered_map< std::string, SrcLangExt > g_extLookup
static QCString stripDeclKeywords(const QCString &s)
bool recognizeFixedForm(const QCString &contents, FortranFormat format)
bool openOutputFile(const QCString &outFile, std::ofstream &f)
QCString substituteKeywords(const QCString &file, const QCString &s, const KeywordSubstitutionList &keywords)
static MemberDef * getMemberFromSymbol(const Definition *scope, const FileDef *fileScope, const QCString &n)
QCString tempArgListToString(const ArgumentList &al, SrcLangExt lang, bool includeDefault)
static ModuleDef * findModuleDef(const Definition *d)
void addRefItem(const RefItemVector &sli, const QCString &key, const QCString &prefix, const QCString &name, const QCString &title, const QCString &args, const Definition *scope)
void addGroupListToTitle(OutputList &ol, const Definition *d)
QCString relativePathToRoot(const QCString &name)
SrcLangExt getLanguageFromCodeLang(QCString &fileName)
Routine to handle the language attribute of the \code command.
QCString integerToAlpha(int n, bool upper)
void writePageRef(OutputList &ol, const QCString &cn, const QCString &mn)
void clearSubDirs(const Dir &d)
static void transcodeCharacterBuffer(const QCString &fileName, std::string &contents, const QCString &inputEncoding, const QCString &outputEncoding)
QCString showFileDefMatches(const FileNameLinkedMap *fnMap, const QCString &n)
QCString demangleCSharpGenericName(const QCString &name, const QCString &templArgs)
QCString fileToString(const QCString &name, bool filter, bool isSourceCode)
QCString stripExtensionGeneral(const QCString &fName, const QCString &ext)
QCString filterTitle(const QCString &title)
QCString unescapeCharsInString(const QCString &s)
QCString removeAnonymousScopes(const QCString &str)
void createSubDirs(const Dir &d)
bool fileVisibleInIndex(const FileDef *fd, bool &genSourceFile)
QCString stripScope(const QCString &name)
QCString resolveTypeDef(const Definition *context, const QCString &qualifiedName, const Definition **typedefContext)
bool checkExtension(const QCString &fName, const QCString &ext)
bool isURL(const QCString &url)
Checks whether the given url starts with a supported protocol.
QCString inlineTemplateArgListToDoc(const ArgumentList &al)
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, size_t breakThreshold)
bool resolveLink(const QCString &scName, const QCString &lr, bool, const Definition **resContext, QCString &resAnchor, SrcLangExt lang, const QCString &prefix)
int computeQualifiedIndex(const QCString &name)
Return the index of the last :: in the string name that is still before the first <.
QCString stripExtension(const QCString &fName)
void initDefaultExtensionMapping()
bool findAndRemoveWord(QCString &sentence, const char *word)
removes occurrences of whole word from sentence, while keeps internal spaces and reducing multiple se...
static QCString stripFromPath(const QCString &p, const StringVector &l)
QCString convertNameToFile(const QCString &name, bool allowDots, bool allowUnderscore)
static bool isLowerCase(QCString &s)
static const char virtualScope[]
QCString convertToXML(const QCString &s, bool keepEntities)
QCString langToString(SrcLangExt lang)
Returns a string representation of lang.
QCString determineAbsoluteIncludeName(const QCString &curFile, const QCString &incFileName)
QCString detab(const QCString &s, size_t &refIndent)
EntryType guessSection(const QCString &name)
void extractNamespaceName(const QCString &scopeName, QCString &className, QCString &namespaceName, bool allowEmptyClass)
static StringUnorderedSet writeFileContents_set
void convertProtectionLevel(MemberListType inListType, Protection inProt, MemberListType *outListType1, MemberListType *outListType2)
Computes for a given list type inListType, which are the the corresponding list type(s) in the base c...
static const char volatileScope[]
QCString argListToString(const ArgumentList &al, bool useCanonicalType, bool showDefVals)
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
static void stripIrrelevantString(QCString &target, const QCString &str, bool insideTemplate)
QCString removeLongPathMarker(QCString path)
QCString correctId(const QCString &s)
static QCString extractCanonicalArgType(const Definition *d, const FileDef *fs, const Argument &arg, SrcLangExt lang)
QCString getLanguageSpecificSeparator(SrcLangExt lang, bool classScope)
Returns the scope separator to use given the programming language lang.
void mergeMemberOverrideOptions(MemberDefMutable *md1, MemberDefMutable *md2)
static int nextUTF8CharPosition(const QCString &utf8Str, uint32_t len, uint32_t startPos)
QCString getDotImageExtension()
static QCString extractCanonicalType(const Definition *d, const FileDef *fs, QCString type, SrcLangExt lang, bool insideTemplate)
static QCString getCanonicalTypeForIdentifier(const Definition *d, const FileDef *fs, const QCString &word, SrcLangExt lang, QCString *tSpec, int count=0)
QCString mangleCSharpGenericName(const QCString &name)
GetDefResult getDefs(const GetDefInput &input)
QCString makeBaseName(const QCString &name, const QCString &ext)
QCString projectLogoFile()
static std::mutex g_usedNamesMutex
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)
static bool matchArgument2(const Definition *srcScope, const FileDef *srcFileScope, Argument &srcA, const Definition *dstScope, const FileDef *dstFileScope, Argument &dstA, SrcLangExt lang)
void mergeArguments(ArgumentList &srcAl, ArgumentList &dstAl, bool forceNameOverwrite)
StringVector split(const std::string &s, const std::string &delimiter)
split input string s by string delimiter delimiter.
QCString getEncoding(const FileInfo &fi)
static std::mutex g_docCacheMutex
static bool keyWordsFortranC(const char *contents)
FortranFormat convertFileNameFortranParserCode(QCString fn)
static QCString getCanonicalTemplateSpec(const Definition *d, const FileDef *fs, const QCString &spec, SrcLangExt lang)
bool genericPatternMatch(const FileInfo &fi, const PatternList &patList, PatternElem &elem, PatternGet getter)
QCString stripLeadingAndTrailingEmptyLines(const QCString &s, int &docLine)
Special version of QCString::stripWhiteSpace() that only strips completely blank lines.
int findParameterList(const QCString &name)
Returns the position in the string where a function parameter list begins, or -1 if one is not found.
bool copyFile(const QCString &src, const QCString &dest)
Copies the contents of file with name src to the newly created file with name dest.
QCString externalLinkTarget(const bool parent)
QCString getFileFilter(const QCString &name, bool isSourceCode)
void stripIrrelevantConstVolatile(QCString &s, bool insideTemplate)
QCString extractBeginRawStringDelimiter(const char *rawStart)
QCString stripTemplateSpecifiersFromScope(const QCString &fullName, bool parentOnly, QCString *pLastScopeStripped, QCString scopeName, bool allowArtificial)
QCString getOverloadDocs()
static QCString getFilterFromList(const QCString &name, const StringVector &filterList, bool &found)
static QCString projectLogoSize()
void cleanupInlineGraph()
static QCString showDate(const QCString &fmt)
int getPrefixIndex(const QCString &name)
bool rightScopeMatch(const QCString &scope, const QCString &name)
void writeMarkerList(OutputList &ol, const std::string &markerText, size_t numMarkers, std::function< void(size_t)> replaceFunc)
static bool getScopeDefs(const QCString &docScope, const QCString &scope, ClassDef *&cd, ConceptDef *&cnd, NamespaceDef *&nd, ModuleDef *&modd)
bool updateLanguageMapping(const QCString &extension, const QCString &language)
QCString inlineArgListToDoc(const ArgumentList &al)
static std::unordered_map< std::string, int > g_usedNames
static CharAroundSpace g_charAroundSpace
QCString replaceColorMarkers(const QCString &str)
Replaces any markers of the form ##AA in input string str by new markers of the form #AABBCC,...
QCString getFileNameExtension(const QCString &fn)
QCString convertToId(const QCString &s)
void writeExamples(OutputList &ol, const ExampleList &list)
static std::mutex g_matchArgsMutex
QCString replaceAnonymousScopes(const QCString &s, const QCString &replacement)
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 const char operatorScope[]
FileDef * findFileDef(const FileNameLinkedMap *fnMap, const QCString &n, bool &ambig)
QCString convertCharEntitiesToUTF8(const QCString &str)
static std::vector< Lang2ExtMap > g_lang2extMap
int getScopeFragment(const QCString &s, int p, int *l)
void addHtmlExtensionIfMissing(QCString &fName)
QCString createHtmlUrl(const QCString &relPath, const QCString &ref, bool href, bool isLocalFile, const QCString &targetFileName, const QCString &anchor)
A bunch of utility functions.
std::vector< KeywordSubstitution > KeywordSubstitutionList
std::vector< SelectionBlock > SelectionBlockList