25#include <unordered_set>
82#define ENABLE_TRACINGSUPPORT 0
84#if defined(__APPLE__) && ENABLE_TRACINGSUPPORT
96#define REL_PATH_TO_ROOT "../../"
98static const char *
hex =
"0123456789ABCDEF";
110 if (s.empty())
return;
118 m_ol.writeNonBreakableSpace(1);
122 m_ol.docify(std::string_view(&c, 1));
134 m_ol.lineBreak(
"typebreak");
135 for (
int i = 0; i < indent; ++i)
m_ol.writeNonBreakableSpace(3);
139 const QCString &anchor,std::string_view text
143 m_ol.writeObjectLink(extRef,file,anchor,text);
166 if (str.
isEmpty())
return result;
169 auto startsWithColon = [](
const std::string &del)
171 for (
size_t i=0;i<del.size();i++)
173 if (del[i]==
'@')
return false;
174 else if (del[i]==
':')
return true;
180 auto endsWithColon = [](
const std::string &del)
182 for (
int i=
static_cast<int>(del.size())-1;i>=0;i--)
184 if (del[i]==
'@')
return false;
185 else if (del[i]==
':')
return true;
190 static const reg::Ex re(R
"([\s:]*@\d+[\s:]*)");
191 std::string s = str.str();
195 size_t sl=s.length();
196 bool needsSeparator=
false;
197 for ( ; iter!=
end ; ++iter)
199 const auto &match = *iter;
200 size_t i = match.position();
203 if (needsSeparator) result+=
"::";
204 needsSeparator=
false;
205 result+=s.substr(p,i-p);
207 std::string delim = match.str();
208 needsSeparator = needsSeparator || (startsWithColon(delim) && endsWithColon(delim));
209 p = match.position()+match.length();
213 if (needsSeparator) result+=
"::";
223 static const reg::Ex marker(R
"(@\d+)");
225 !replacement.isEmpty() ? replacement.data() : "__anonymous__");
236 int sl =
static_cast<int>(s.
length());
244 if (!newScope.
isEmpty()) newScope+=
"::";
245 newScope+=s.
mid(i,l);
250 if (!newScope.
isEmpty()) newScope+=
"::";
251 newScope+=s.
right(sl-i);
283 const int maxMarkerStrLen = 20;
284 char result[maxMarkerStrLen];
285 qsnprintf(result,maxMarkerStrLen,
"@%d",
id);
306 for (
const auto &s : l)
309 if (
prefix.length() > length &&
316 if (length>0)
return potential;
343 static const std::unordered_set<std::string> sourceExt = {
344 "c",
"cc",
"cxx",
"cpp",
"c++",
"cppm",
"ccm",
"cxxm",
"c++m",
348 "ii",
"ixx",
"ipp",
"i++",
"inl",
351 static const std::unordered_set<std::string> headerExt = {
352 "h",
"hh",
"hxx",
"hpp",
"h++",
"ixx",
353 "idl",
"ddl",
"pidl",
"ice"
359 if (sourceExt.find(extension.
str())!=sourceExt.end())
361 return EntryType::makeSource();
363 if (headerExt.find(extension.
str())!=headerExt.end())
365 return EntryType::makeHeader();
372 return EntryType::makeEmpty();
378 AUTO_TRACE(
"context='{}' qualifiedName='{}'",context?context->
name():
"",qualifiedName);
387 if (typedefContext) *typedefContext=context;
390 if (qualifiedName.
find(
'<')!=-1)
395 int scopeIndex = qualifiedName.
findRev(
"::");
399 resName=qualifiedName.
right(qualifiedName.
length()-scopeIndex-2);
407 while (mContext && md==
nullptr)
423 if (!tmp.
isEmpty()) qualScopePart=tmp;
426 if (resScope==
nullptr)
break;
438 bool searchRelated=
false;
439 bool mustBeRelated=
false;
450 if (mn==0 && searchRelated)
458 for (
const auto &tmd_p : *mn)
461 AUTO_TRACE_ADD(
"found candidate member '{}' isTypeDef={}' isRelated={} mustBeRelated={}",
476 if (dist!=-1 && (md==
nullptr || dist<minDist))
498 if (args.
find(
")(")!=-1)
502 else if (args.
find(
'[')!=-1)
522static const char constScope[] = {
'c',
'o',
'n',
's',
't',
':' };
523static const char volatileScope[] = {
'v',
'o',
'l',
'a',
't',
'i',
'l',
'e',
':' };
524static const char virtualScope[] = {
'v',
'i',
'r',
't',
'u',
'a',
'l',
':' };
525static const char operatorScope[] = {
'o',
'p',
'e',
'r',
'a',
't',
'o',
'r',
'?',
'?',
'?' };
581 if (s.
length()*3>growBufLen)
583 growBufLen = s.
length()*3;
584 growBuf =
static_cast<char *
>(realloc(growBuf,growBufLen+1));
586 if (growBuf==
nullptr)
return s;
588 const char *src=s.
data();
599 while (i<l && isspace(
static_cast<uint8_t
>(src[i])))
606 char nc=i+1<l ? src[i+1] :
' ';
608 auto searchForKeyword = [&](
const char *kw,
size_t &matchLen,
size_t totalLen)
610 if (matchLen<=totalLen && c==kw[matchLen] &&
645 if (c==
'\\' && i+1<l)
669 if (i>0 && !isspace(
static_cast<uint8_t
>(pc)) &&
670 (
isId(pc) || pc==
'*' || pc==
'&' || pc==
'.' || pc==
'>') &&
671 (osp<8 || (osp==8 && pc!=
'-'))
677 if (i+1<l && (nc==
'-' || nc==
'&'))
684 if (i>0 && !isspace(
static_cast<uint8_t
>(pc)) &&
685 ((i+1<l && (
isId(nc) || nc==
'[')) ||
686 (i+2<l && nc==
'$' &&
isId(src[i+2])) ||
687 (i+3<l && nc==
'&' && src[i+2]==
'$' &&
isId(src[i+3]))
697 if (cliSupport && i+1<l && (
isId(nc) || nc==
'-'))
704 if (i+1<l && (
isId(nc) || nc==
'-'))
710 if (i>0 && pc!=
' ' && pc!=
'\t' && pc!=
':' &&
711 pc!=
'*' && pc!=
'&' && pc!=
'(' && pc!=
'/' &&
721 if (i>0 &&
isId(pc) && osp<9)
741 if (i>0 && i+1<l && pc!=
'=' && pc!=
':' && !isspace(
static_cast<uint8_t
>(pc)) &&
772 !(pc==
',' && nc==
'.') &&
773 (osp<8 || (osp>=8 &&
isId(pc) &&
isId(nc)))
781 else if ((pc==
'*' || pc==
'&' || pc==
'.') && nc==
'>')
789 auto correctKeywordAllowedInsideScope = [&](
char cc,
size_t &matchLen,
size_t totalLen) {
790 if (c==cc && matchLen==totalLen)
792 if ((i+2<l && src[i+1] ==
':' && src[i+2] ==
':') ||
793 ((i>matchLen && src[i-matchLen] ==
':' && src[i-matchLen-1] ==
':'))
797 correctKeywordAllowedInsideScope(
't',csp, 5);
798 correctKeywordAllowedInsideScope(
'e',vosp,8);
799 correctKeywordAllowedInsideScope(
'l',vsp, 7);
801 auto correctKeywordNotPartOfScope = [&](
char cc,
size_t &matchLen,
size_t totalLen)
803 if (c==cc && matchLen==totalLen && i+1<l &&
811 correctKeywordNotPartOfScope(
't',csp, 5);
812 correctKeywordNotPartOfScope(
'e',vosp,8);
813 correctKeywordNotPartOfScope(
'l',vsp, 7);
833 if (templateDepth > 0)
835 int nextOpenPos=name.
findRev(
'>', pos);
836 int nextClosePos=name.
findRev(
'<', pos);
837 if (nextOpenPos!=-1 && nextOpenPos>nextClosePos)
842 else if (nextClosePos!=-1)
854 int lastAnglePos=name.
findRev(
'>', pos);
855 int bracePos=name.
findRev(
'(', pos);
856 if (lastAnglePos!=-1 && lastAnglePos>bracePos)
863 int bp = bracePos>0 ? name.
findRev(
'(',bracePos-1) : -1;
865 return bp==-1 || (bp>=8 && name.
mid(bp-8,10)==
"operator()") ? bracePos : bp;
876 return (name==scope ||
877 (scope.
right(nl)==name &&
878 sl>1+nl && scope.
at(sl-nl-1)==
':' && scope.
at(sl-nl-2)==
':'
887 return (name==scope ||
888 (name.
left(sl)==scope &&
889 nl>sl+1 && name.
at(sl)==
':' && name.
at(sl+1)==
':'
897 const QCString &text,
bool autoBreak,
bool external,
898 bool keepSpaces,
int indentLevel)
900 AUTO_TRACE(
"scope={} fileScope={} text={} autoBreak={} external={} keepSpaces={} indentLevel={}",
901 scope?scope->
name():
"",fileScope?fileScope->
name():
"",
902 text,autoBreak,external,keepSpaces,indentLevel);
905 std::string_view txtStr=text.
view();
906 size_t strLen = txtStr.length();
907 if (strLen==0)
return;
909 static const reg::Ex regExp(R
"((::)?\a[\w~!\\.:$"]*)");
919 size_t floatingIndex=0;
920 for (; it!=
end ; ++it)
922 const auto &match = *it;
923 size_t newIndex = match.position();
924 size_t matchLen = match.length();
925 floatingIndex+=newIndex-skipIndex+matchLen;
926 if (newIndex>0 && txtStr.at(newIndex-1)==
'0')
928 std::string_view part = txtStr.substr(skipIndex,newIndex+matchLen-skipIndex);
930 skipIndex=index=newIndex+matchLen;
935 bool insideString=
FALSE;
936 for (
size_t i=index;i<newIndex;i++)
938 if (txtStr.at(i)==
'"') insideString=!insideString;
939 if (txtStr.at(i)==
'\\') i++;
943 if (strLen>35 && floatingIndex>30 && autoBreak)
945 std::string_view splitText = txtStr.substr(skipIndex,newIndex-skipIndex);
946 size_t splitLength = splitText.length();
948 size_t i = splitText.find(
',');
949 if (i==std::string::npos) { i=splitText.find(
'<');
if (i!=std::string::npos) offset=0; }
950 if (i==std::string::npos) i=splitText.find(
'>');
951 if (i==std::string::npos) i=splitText.find(
' ');
953 if (i!=std::string::npos)
955 std::string_view part1 = splitText.substr(0,i+offset);
957 out.
writeBreak(indentLevel==0 ? 0 : indentLevel+1);
958 std::string_view part2 = splitText.substr(i+offset);
960 floatingIndex=splitLength-i-offset+matchLen;
970 std::string_view part = txtStr.substr(skipIndex,newIndex-skipIndex);
974 std::string_view word=txtStr.substr(newIndex,matchLen);
1003 auto writeCompoundName = [&](
const auto *cd_) {
1004 if (external ? cd_->isLinkable() : cd_->isLinkableInProject())
1009 out.
writeLink(cd_->getReference(),cd_->getOutputFileBase(),cd_->anchor(),word);
1016 writeCompoundName(cd);
1018 else if ((cd=
getClass(matchWord+
"-p")))
1020 writeCompoundName(cd);
1024 writeCompoundName(cnd);
1028 writeCompoundName(d);
1035 int m = matchWord.
findRev(
"::");
1043 scopeName=scope->
name();
1047 scopeName = matchWord.
left(m);
1048 matchWord = matchWord.
mid(m+2);
1057 if (result.
found && result.
md &&
1064 if (result.
md!=self && (self==
nullptr || result.
md->
name()!=self->
name()))
1093 skipIndex=index=newIndex+matchLen;
1097 std::string_view lastPart = txtStr.substr(skipIndex);
1102 std::function<
void(
size_t)> replaceFunc)
1104 static const reg::Ex marker(R
"(@(\d+))");
1109 for ( ; it!=
end ; ++it)
1111 const auto &match = *it;
1112 size_t newIndex = match.position();
1113 size_t matchLen = match.length();
1114 ol.
parseText(markerText.substr(index,newIndex-index));
1115 unsigned long entryIndex = std::stoul(match[1].str());
1116 if (entryIndex<
static_cast<unsigned long>(numMarkers))
1118 replaceFunc(entryIndex);
1120 index=newIndex+matchLen;
1127 auto replaceFunc = [&list,&ol](
size_t entryIndex)
1129 const auto &e = list[entryIndex];
1161 if (a.hasDocumentation())
1165 paramDocs+=
" \\ilinebr @param"+direction+
" "+a.name+
" "+docsWithoutDir;
1179 if (!a.docs.isEmpty())
1181 if (!a.name.isEmpty())
1183 paramDocs+=
" \\ilinebr @tparam "+a.name+
" "+a.docs;
1185 else if (!a.type.isEmpty())
1191 paramDocs+=
" \\ilinebr @tparam "+type+
" "+a.docs;
1204 for (
auto it = al.
begin() ; it!=al.
end() ;)
1209 int i=type1.
find(
")(");
1213 type1=type1.
left(i);
1221 result+= type1+
" "+a.
name+type2+a.
array;
1225 result+= type1+type2;
1232 if (it!=al.
end()) result+=
", ";
1247 if (al.
empty())
return result;
1250 for (
const auto &a : al)
1252 if (a.defval.isEmpty() || includeDefault)
1254 if (!first) result+=
", ";
1255 if (!a.name.isEmpty())
1257 if (lang==SrcLangExt::Java || lang==SrcLangExt::CSharp)
1265 int i =
static_cast<int>(a.type.length())-1;
1266 while (i>=0 &&
isId(a.type.at(i))) i--;
1269 result+=a.type.
right(a.type.length()-i-1);
1270 if (a.type.find(
"...")!=-1)
1280 if (!a.typeConstraint.isEmpty() && lang==SrcLangExt::Java)
1282 result+=
" extends ";
1283 result+=a.typeConstraint;
1304 size_t len = contents.length();
1308 char c = contents[src++];
1312 if (src<len && contents[src] ==
'\n')
1317 else if ( c ==
'\0' && src<len-1)
1321 contents[dest++] = c;
1323 contents.resize(dest);
1330 for (
const auto &filterStr : filterList)
1333 int i_equals=fs.
find(
'=');
1340 filterPattern = filterPattern.
lower();
1341 input = input.
lower();
1348 if (filterName.
find(
' ')!=-1)
1350 filterName=
"\""+filterName+
"\"";
1370 if (name.
isEmpty())
return "";
1377 if (isSourceCode && !filterSrcList.empty())
1381 if (!found && filterName.
isEmpty())
1392 if (filterName.
length()>=2 && filterName[0]==
'"' && filterName[
static_cast<int>(filterName.
length())-1]==
'"')
1394 filterName = filterName.
mid(1,filterName.
length()-2);
1403 const char *outputEncoding =
"UTF-8";
1404 if (inputEncoding==
nullptr ||
qstricmp(inputEncoding,outputEncoding)==0)
return true;
1405 size_t inputSize=input.length();
1406 size_t outputSize=inputSize*4;
1409 if (cd==
reinterpret_cast<void *
>(-1))
1414 size_t iLeft=inputSize;
1415 size_t oLeft=outputSize;
1416 const char *inputPtr = input.data();
1417 char *outputPtr = output.
rawData();
1420 outputSize-=
static_cast<int>(oLeft);
1421 output.
resize(outputSize);
1422 output.
at(outputSize)=
'\0';
1442 bool fileOpened=
false;
1443 if (name[0]==
'-' && name[1]==0)
1445 std::string contents;
1447 while (getline(std::cin,line))
1449 contents+=line+
'\n';
1458 err(
"file '{}' not found\n",name);
1471 err(
"cannot open file '{}' for reading\n",name);
1479 for (
const auto &bcd : bcl)
1500 AUTO_TRACE(
"target='{}' str='{}'",target,str);
1501 if (target==str) { target.
clear();
return; }
1503 int l=
static_cast<int>(str.
length());
1506 while ((i=target.
find(str,p))!=-1)
1508 for (
int q=p;q<i;q++)
1510 if (target[q]==
'<') sharpCount++;
1511 else if (target[q]==
'>' && sharpCount>0) sharpCount--;
1513 bool isMatch = (i==0 || !
isId(target.
at(i-1))) &&
1514 (i+l==
static_cast<int>(target.
length()) || !
isId(target.
at(i+l))) &&
1515 !insideTemplate && sharpCount==0;
1518 int i1=target.
find(
'*',i+l);
1519 int i2=target.
find(
'&',i+l);
1520 if (i1==-1 && i2==-1)
1527 else if ((i1!=-1 && i<i1) || (i2!=-1 && i<i2))
1570 int i=s.
find(
" class ");
1571 if (i!=-1)
return s.
left(i)+s.
mid(i+6);
1572 i=s.
find(
" typename ");
1573 if (i!=-1)
return s.
left(i)+s.
mid(i+9);
1574 i=s.
find(
" union ");
1575 if (i!=-1)
return s.
left(i)+s.
mid(i+6);
1576 i=s.
find(
" struct ");
1577 if (i!=-1)
return s.
left(i)+s.
mid(i+7);
1590 if (!templSpec.
isEmpty() && templSpec.
at(0) ==
'<')
1597 templSpec = resolvedType;
1609 if (count>10)
return word;
1611 QCString symName,result,templSpec,tmpName;
1612 if (tSpec && !tSpec->
isEmpty())
1615 AUTO_TRACE(
"d='{}' fs='{}' word='{}' templSpec='{}'",d?d->
name():
"",fs?fs->
name():
"",word,templSpec);
1633 bool isTemplInst = cd && !templSpec.
isEmpty();
1634 if (!cd && !templSpec.
isEmpty())
1645 cd?cd->
name():
"",mType?mType->
name():
"",ts,resolvedType);
1668 if (cd==d && tSpec) *tSpec=
"";
1672 result = resolvedType+ts;
1680 if (tSpec) *tSpec=
"";
1694 result=cd->
name()+templSpec;
1744 resolvedType = lang==SrcLangExt::Java ? word :
resolveTypeDef(d,word);
1752 result = resolvedType;
1785 if (i>pp) canType += type.
mid(pp,i-pp);
1806 std::string ts = templSpec.
str();
1807 static const reg::Ex re(R
"(\a\w*)");
1814 for (; it!=
end ; ++it)
1816 const auto &match = *it;
1817 size_t ti = match.position();
1818 size_t tl = match.length();
1819 std::string matchStr = match.str();
1820 canType += ts.substr(tp,ti-tp);
1824 canType+=ts.substr(tp);
1840 if ((type==
"const" || type==
"volatile") && !name.
isEmpty())
1845 if (name==
"const" || name==
"volatile")
1847 if (!type.
isEmpty()) type+=
" ";
1865#define MATCH AUTO_TRACE_EXIT("match at line {}",__LINE__);
1866#define NOMATCH AUTO_TRACE_EXIT("no match at line {}",__LINE__);
1873 AUTO_TRACE(
"srcType='{}' dstType='{}'",srcType,dstType);
1874 if (srcType==dstType)
return true;
1877 int i1=srcType.
find(
")(");
1878 if (i1==-1)
return false;
1879 int i2=dstType.
find(
")(");
1880 if (i1!=i2)
return false;
1883 int j1=srcType.
find(
"(");
1884 if (j1==-1 || j1>i1)
return false;
1885 int j2=dstType.
find(
"(");
1886 if (j2!=j1)
return false;
1887 if (srcType.
left(j1)!=dstType.
left(j2))
return false;
1896 dstScope,dstFileScope,dstType.
left(j2),dstAl.get(),
1906 AUTO_TRACE(
"src: scope={} type={} name={} canType={}, dst: scope={} type={} name={} canType={}",
1925 srcA.
type+=sSrcName;
1929 else if (sDstName==srcType.
right(sDstName.
length()))
1931 dstA.
type+=sDstName;
1947 dstScope,dstFileScope,dstA.
canType,
1970 ASSERT(srcScope!=
nullptr && dstScope!=
nullptr);
1972 AUTO_TRACE(
"srcScope='{}' dstScope='{}' srcArgs='{}' dstArgs='{}' checkCV={} lang={}",
1975 if (srcAl==
nullptr || dstAl==
nullptr)
1977 bool match = srcAl==dstAl;
2008 if (srcAl->
size() != dstAl->
size())
2042 auto srcIt = srcAl->
begin();
2043 auto dstIt = dstAl->
begin();
2044 for (;srcIt!=srcAl->
end() && dstIt!=dstAl->
end();++srcIt,++dstIt)
2049 dstScope,dstFileScope,dstA,
2068 AUTO_TRACE(
"srcAl='{}',dstAl='{}',forceNameOverwrite={}",
2076 auto srcIt=srcAl.
begin();
2077 auto dstIt=dstAl.
begin();
2078 while (srcIt!=srcAl.
end() && dstIt!=dstAl.
end())
2083 AUTO_TRACE_ADD(
"before merge: src=[type='{}',name='{}',def='{}'] dst=[type='{}',name='{}',def='{}']",
2099 if (srcA.
name==
"const" || srcA.
name==
"volatile")
2104 if (dstA.
name==
"const" || dstA.
name==
"volatile")
2130 if (forceNameOverwrite)
2173 j1=
static_cast<int>(srcA.
type.
length())-i1-2,
2174 j2=
static_cast<int>(dstA.
type.
length())-i2-2;
2182 else if (i1==-1 && i2!=-1 && dstA.
type.
right(j2)==srcA.
type)
2202 AUTO_TRACE_ADD(
"after merge: src=[type='{}',name='{}',def='{}'] dst=[type='{}',name='{}',def='{}']",
2218 auto isUnconstraintTemplate = [](
const QCString &type)
2220 return type==
"typename" || type==
"class" || type.startsWith(
"typename ") || type.startsWith(
"class ");
2222 auto srcIt = srcAl.
begin();
2223 auto dstIt = dstAl.
begin();
2224 while (srcIt!=srcAl.
end() && dstIt!=dstAl.
end())
2228 if ((!isUnconstraintTemplate(srcA.
type) || !isUnconstraintTemplate(dstA.
type)) && srcA.
type!=dstA.
type)
2247 AUTO_TRACE(
"scopeName={},memberName={},forceEmptyScope={}",
2273 result.
found =
true;
2278 result.
found =
true;
2283 result.
found =
true;
2288 result.
found =
true;
2293 result.
found =
true;
2325 bool explicitGlobalScope=
FALSE;
2326 if (scopeName.
at(0)==
':' && scopeName.
at(1)==
':')
2329 explicitGlobalScope=
TRUE;
2337 int scopeOffset=explicitGlobalScope ? 0 :
static_cast<int>(docScopeName.
length());
2342 if (scopeOffset>0) fullName.
prepend(docScopeName.
left(scopeOffset)+
"::");
2366 else if ((scopeOffset=docScopeName.
findRev(
"::",scopeOffset-1))==-1)
2370 }
while (scopeOffset>=0);
2378 const char *p=s.
data();
2380 while ((c=
static_cast<uint8_t
>(*p++)))
if (!islower(c))
return false;
2393 bool lookForSpecialization,
2398 AUTO_TRACE(
"scope={} name={} inSeeBlock={} lang={} lookForSpecialization={} currentFile={} checkScope={}",
2399 scName,name,inSeeBlock,lang,lookForSpecialization,currentFile ? currentFile->
name() :
"", checkScope);
2404 if (fullName.
find(
"anonymous_namespace{")==-1)
2414 if (lang==SrcLangExt::CSharp && (templStartPos=fullName.
find(
'<'))!=-1)
2416 int templEndPos = fullName.
findRev(
'>');
2417 if (templEndPos!=-1)
2425 int endNamePos=bracePos!=-1 ? bracePos :
static_cast<int>(fullName.
length());
2426 int scopePos=fullName.
findRev(
"::",endNamePos);
2427 bool explicitScope = fullName.
startsWith(
"::") &&
2432 bool allowTypeOnly=
false;
2435 *resContext=
nullptr;
2442 if (!inSeeBlock && scopePos==-1 &&
isLowerCase(tsName))
2456 if (scName!=fullName &&
getScopeDefs(scName,fullName,cd,cnd,nd,modd))
2479 else if (scName==fullName || (!inSeeBlock && scopePos==-1))
2498 if (explicitScope) nameStr=nameStr.
mid(2);
2503 if (bracePos!=-1) argsStr=fullName.
right(fullName.
length()-bracePos);
2507 int templPos=nameStr.
find(
'<');
2508 bool tryUnspecializedVersion =
FALSE;
2509 if (templPos!=-1 && nameStr.
find(
"operator")==-1)
2511 int endTemplPos=nameStr.
findRev(
'>');
2512 if (endTemplPos!=-1)
2514 if (!lookForSpecialization)
2516 nameStr=nameStr.
left(templPos)+nameStr.
right(nameStr.
length()-endTemplPos-1);
2520 tryUnspecializedVersion =
TRUE;
2528 nameStr=nameStr.
mid(scopeStr.
length()+2);
2554 *resContext=
nullptr;
2564 *resMember=result.
md;
2565 *resContext=result.
md;
2569 *resContext=
nullptr;
2575 else if (result.
cd) *resContext=result.
cd;
2576 else if (result.
nd) *resContext=result.
nd;
2577 else if (result.
fd) *resContext=result.
fd;
2578 else if (result.
gd) *resContext=result.
gd;
2579 else if (result.
cnd) *resContext=result.
cnd;
2580 else if (result.
modd) *resContext=result.
modd;
2583 *resContext=
nullptr; *resMember=
nullptr;
2610 else if (tsName.
find(
'.')!=-1)
2622 if (tryUnspecializedVersion)
2624 bool b =
resolveRef(scName,name,inSeeBlock,resContext,resMember,lang,
FALSE,
nullptr,checkScope);
2652 if (!isFileName && result.
find(
'<')==-1) result=
substitute(result,
".",
"::",3);
2654 if (result.
at(0)==
':' && result.
at(1)==
':')
2678 *resContext=
nullptr;
2681 if (lang==SrcLangExt::CSharp)
2686 AUTO_TRACE(
"scName='{}',ref='{}'",scName,lr);
2691 const DirDef *dir =
nullptr;
2709 if (si) resAnchor = si->
label();
2721 resAnchor = si->
label();
2728 resAnchor = si->
label();
2758 else if (lang==SrcLangExt::Java &&
2759 (cd=
getClass(linkRefWithoutTemplates)))
2766 else if ((cd=
getClass(linkRef+
"-p")))
2783 resAnchor=modd->
anchor();
2804 if (md) resAnchor=md->
anchor();
2842 if (n.
isEmpty())
return nullptr;
2845 const int maxAddrSize = 20;
2846 char addr[maxAddrSize];
2847 qsnprintf(addr,maxAddrSize,
"%p:",
reinterpret_cast<const void*
>(fnMap));
2856 ambig = cachedResult->
isAmbig;
2867 if (name.
isEmpty())
return nullptr;
2874 if (name.
isEmpty())
return nullptr;
2881 const std::unique_ptr<FileDef> &fd = fn->front();
2883 fd->getPath().right(path.
length())==path :
2885 if (path.
isEmpty() || isSamePath)
2887 cachedResult->
fileDef = fd.get();
2896 for (
const auto &fd_p : *fn)
2910 cachedResult->
isAmbig = ambig;
2911 cachedResult->
fileDef = lastMatch;
2941 for (
const auto &s : examplePathList)
2975 path=name.
left(slashPos+1);
2982 for (
const auto &fd : *fn)
2984 if (path.
isEmpty() || fd->getPath().right(path.
length())==path)
2986 if (!first) result +=
"\n";
2988 result+=
" "+fd->absFilePath();
2999 std::string substRes;
3001 const char *p = s.
data();
3005 substRes.reserve(s.
length()+1024);
3012 for (
const auto &kw : keywords)
3014 size_t keyLen =
qstrlen(kw.keyword);
3015 if (
qstrncmp(p,kw.keyword,keyLen)==0)
3017 const char *startArg = p+keyLen;
3018 bool expectParam = std::holds_alternative<KeywordSubstitution::GetValueWithParam>(kw.getValueVariant);
3020 if (expectParam && *startArg==
'(')
3023 const char *endArg =
nullptr;
3024 while ((c=*(startArg+j)) && c!=
')' && c!=
'\n' && c!=0) j++;
3025 if (c==
')') endArg=startArg+j;
3029 auto &&getValue = std::get<KeywordSubstitution::GetValueWithParam>(kw.getValueVariant);
3030 substRes+=getValue(value).str();
3037 warn(file,line,
"Missing argument for '{}'",kw.keyword);
3041 else if (!expectParam)
3043 auto &&getValue = std::get<KeywordSubstitution::GetValue>(kw.getValueVariant);
3044 substRes+=getValue().str();
3051 warn(file,line,
"Expected arguments for '{}' but none were specified",kw.keyword);
3061 if (c==
'\n') line++;
3089 int wi = projectLogo.
find(
" width=");
3092 projectLogo = projectLogo.
left(wi);
3094 int hi = projectLogo.
find(
" height=");
3097 projectLogo = projectLogo.
left(hi);
3110 auto extractDimension = [&projectLogo](
const char *startMarker,
size_t startPos,
size_t endPos) ->
QCString
3113 if (result.
length()>=2 && result.
at(0)!=
'"' && result.
at(result.
length()-1)!=
'"')
3115 result=
"\""+result+
"\"";
3121 int wi = projectLogo.
find(
" width=");
3122 int hi = projectLogo.
find(
" height=");
3123 if (wi!=-1 && hi!=-1)
3127 sizeVal = extractDimension(
" width=", wi+7, hi) +
" "
3128 + extractDimension(
" height=", hi+8, projectLogo.
length());
3132 sizeVal = extractDimension(
" height=", hi+8, wi) +
" "
3133 + extractDimension(
" width=", wi+7, projectLogo.
length());
3138 sizeVal = extractDimension(
" width=", wi+7, projectLogo.
length());
3142 sizeVal = extractDimension(
" height=", hi+8, projectLogo.
length());
3155 {
"$title", [&]() {
return !title.
isEmpty() ? title : projName; } },
3156 {
"$doxygenversion", [&]() {
return getDoxygenVersion(); } },
3157 {
"$projectname", [&]() {
return projName; } },
3158 {
"$projectnumber", [&]() {
return projNum; } },
3159 {
"$projectbrief", [&]() {
return projBrief; } },
3163 {
"$langISO", [&]() {
return theTranslator->trISOLang(); } },
3178 for (
const auto &s : sl)
3180 const char *ps=s.c_str();
3181 const char *pd=name.
data();
3183 while (*ps!=0 && *pd!=0 && *ps==*pd)
3189 if (*ps==0 && *pd!=0)
3205int getUtf8Char(
const char *input,
char ids[MAX_UTF8_CHAR_SIZE],CaseModifier modifier)
3208 const unsigned char uc = (
unsigned char)*input;
3209 bool validUTF8Char =
false;
3212 const char* pt = input+1;
3214 if ((uc&0x80)==0x00)
3218 case CaseModifier::None: ids[0]=*input;
break;
3219 case CaseModifier::ToUpper: ids[0]=(char)toupper(*input);
break;
3220 case CaseModifier::ToLower: ids[0]=(char)tolower(*input);
break;
3227 if ((uc&0xE0)==0xC0)
3231 if ((uc&0xF0)==0xE0)
3235 if ((uc&0xF8)==0xF0)
3240 validUTF8Char = l>0;
3241 for (
int m=1; m<l && validUTF8Char; ++m)
3243 unsigned char ct = (
unsigned char)*pt;
3244 if (ct==0 || (ct&0xC0)!=0x80)
3246 validUTF8Char=
false;
3267 if (caseSenseNames == CASE_SENSE_NAMES_t::YES)
return true;
3268 else if (caseSenseNames == CASE_SENSE_NAMES_t::NO)
return false;
3274 if (name.
isEmpty())
return name;
3279 const char *p=name.
data();
3284 case '_':
if (allowUnderscore) growBuf.
addChar(
'_');
else growBuf.
addStr(
"__");
break;
3285 case '-': growBuf.
addChar(
'-');
break;
3286 case ':': growBuf.
addStr(
"_1");
break;
3287 case '/': growBuf.
addStr(
"_2");
break;
3288 case '<': growBuf.
addStr(
"_3");
break;
3289 case '>': growBuf.
addStr(
"_4");
break;
3290 case '*': growBuf.
addStr(
"_5");
break;
3291 case '&': growBuf.
addStr(
"_6");
break;
3292 case '|': growBuf.
addStr(
"_7");
break;
3293 case '.':
if (allowDots) growBuf.
addChar(
'.');
else growBuf.
addStr(
"_8");
break;
3294 case '!': growBuf.
addStr(
"_9");
break;
3295 case ',': growBuf.
addStr(
"_00");
break;
3296 case ' ': growBuf.
addStr(
"_01");
break;
3297 case '{': growBuf.
addStr(
"_02");
break;
3298 case '}': growBuf.
addStr(
"_03");
break;
3299 case '?': growBuf.
addStr(
"_04");
break;
3300 case '^': growBuf.
addStr(
"_05");
break;
3301 case '%': growBuf.
addStr(
"_06");
break;
3302 case '(': growBuf.
addStr(
"_07");
break;
3303 case ')': growBuf.
addStr(
"_08");
break;
3304 case '+': growBuf.
addStr(
"_09");
break;
3305 case '=': growBuf.
addStr(
"_0a");
break;
3306 case '$': growBuf.
addStr(
"_0b");
break;
3307 case '\\': growBuf.
addStr(
"_0c");
break;
3308 case '@': growBuf.
addStr(
"_0d");
break;
3309 case ']': growBuf.
addStr(
"_0e");
break;
3310 case '[': growBuf.
addStr(
"_0f");
break;
3311 case '#': growBuf.
addStr(
"_0g");
break;
3312 case '"': growBuf.
addStr(
"_0h");
break;
3313 case '~': growBuf.
addStr(
"_0i");
break;
3314 case '\'': growBuf.
addStr(
"_0j");
break;
3315 case ';': growBuf.
addStr(
"_0k");
break;
3316 case '`': growBuf.
addStr(
"_0l");
break;
3320 bool doEscape =
true;
3321 if (allowUnicodeNames)
3326 growBuf.
addStr(p-1,charLen);
3334 unsigned char id =
static_cast<unsigned char>(c);
3343 else if (caseSenseNames || !isupper(c))
3350 growBuf.
addChar(
static_cast<char>(tolower(c)));
3356 return growBuf.
get();
3364 const char *p = s.
data();
3374 case '_': result+=c; p++;
break;
3375 case '1': result+=
':'; p++;
break;
3376 case '2': result+=
'/'; p++;
break;
3377 case '3': result+=
'<'; p++;
break;
3378 case '4': result+=
'>'; p++;
break;
3379 case '5': result+=
'*'; p++;
break;
3380 case '6': result+=
'&'; p++;
break;
3381 case '7': result+=
'|'; p++;
break;
3382 case '8': result+=
'.'; p++;
break;
3383 case '9': result+=
'!'; p++;
break;
3387 case '0': result+=
','; p+=2;
break;
3388 case '1': result+=
' '; p+=2;
break;
3389 case '2': result+=
'{'; p+=2;
break;
3390 case '3': result+=
'}'; p+=2;
break;
3391 case '4': result+=
'?'; p+=2;
break;
3392 case '5': result+=
'^'; p+=2;
break;
3393 case '6': result+=
'%'; p+=2;
break;
3394 case '7': result+=
'('; p+=2;
break;
3395 case '8': result+=
')'; p+=2;
break;
3396 case '9': result+=
'+'; p+=2;
break;
3397 case 'a': result+=
'='; p+=2;
break;
3398 case 'b': result+=
'$'; p+=2;
break;
3399 case 'c': result+=
'\\'; p+=2;
break;
3400 case 'd': result+=
'@'; p+=2;
break;
3401 case 'e': result+=
']'; p+=2;
break;
3402 case 'f': result+=
'['; p+=2;
break;
3403 case 'g': result+=
'#'; p+=2;
break;
3404 case 'h': result+=
'"'; p+=2;
break;
3405 case 'i': result+=
'~'; p+=2;
break;
3406 case 'j': result+=
'\''; p+=2;
break;
3407 case 'k': result+=
';'; p+=2;
break;
3408 case 'l': result+=
'`'; p+=2;
break;
3415 if (!caseSenseNames && c>=
'a' && c<=
'z')
3417 result+=
static_cast<char>(toupper(*p));
3448 if (name.
isEmpty())
return name;
3471 size_t resultLen = result.
length();
3475 uint8_t md5_sig[16];
3477 MD5Buffer(result.
data(),
static_cast<unsigned int>(resultLen),md5_sig);
3478 MD5SigToString(md5_sig,sigStr);
3479 result=result.
left(128-32)+sigStr;
3484 int l1Dir=0,l2Dir=0;
3485 int createSubdirsLevel =
Config_getInt(CREATE_SUBDIRS_LEVEL);
3486 int createSubdirsBitmaskL2 = (1<<createSubdirsLevel)-1;
3489 uint8_t md5_sig[16];
3490 MD5Buffer(result.
data(),
static_cast<unsigned int>(result.
length()),md5_sig);
3491 l1Dir = md5_sig[14] & 0xf;
3492 l2Dir = md5_sig[15] & createSubdirsBitmaskL2;
3503 const int sig_size=16;
3504 uint8_t md5_sig[sig_size];
3505 MD5Buffer(fn.
data(),
static_cast<unsigned int>(fn.
length()),md5_sig);
3506 char result[sig_size*3+2];
3509 for (
int i=0;i<sig_size;i++)
3511 static const char oct[]=
"01234567";
3512 uint8_t
byte = md5_sig[i];
3513 *p++=oct[(
byte>>6)&7];
3514 *p++=oct[(
byte>>3)&7];
3515 *p++=oct[(
byte>>0)&7];
3545 QCString absIncFileName = incFileName;
3555 else if (searchIncludes)
3558 for (
const auto &incPath : includePath)
3577 return absIncFileName;
3587 int createSubdirsLevelPow2 = 1 <<
Config_getInt(CREATE_SUBDIRS_LEVEL);
3588 for (
int l1=0; l1<16; l1++)
3594 term(
"Failed to create output directory '{}'\n",subdir);
3596 for (
int l2=0; l2<createSubdirsLevelPow2; l2++)
3599 subsubdir.
sprintf(
"d%x/d%02x",l1,l2);
3602 term(
"Failed to create output directory '{}'\n",subsubdir);
3614 int createSubdirsLevelPow2 = 1 <<
Config_getInt(CREATE_SUBDIRS_LEVEL);
3615 for (
int l1=0;l1<16;l1++)
3619 for (
int l2=0; l2 < createSubdirsLevelPow2; l2++)
3622 subsubdir.
sprintf(
"d%x/d%02x",l1,l2);
3641 bool allowEmptyClass)
3648 namespaceName=nd->
name();
3652 p=
static_cast<int>(clName.
length())-2;
3653 while (p>=0 && (i=clName.
findRev(
"::",p))!=-1)
3660 namespaceName=nd->
name();
3669 className=scopeName;
3670 namespaceName.
clear();
3673 if (className.
isEmpty() && !namespaceName.
isEmpty() && !allowEmptyClass)
3676 className=namespaceName;
3677 namespaceName.
clear();
3683 className = className.
left(className.
length()-2);
3724 int l =
static_cast<int>(result.
length());
3727 bool skipBracket=
FALSE;
3734 while (p>=0 && count>=0)
3736 char c=result.
at(p);
3742 if (p>0 && result.
at(p-1)==
':' && (count==0 || skipBracket))
3744 return result.
right(l-p-1);
3755 if (p>0 && result.
at(p-1)==
'>')
3763 bool foundMatch=
false;
3764 while (p>=0 && !foundMatch)
3776 if (round==0) count++;
3783 if (result.
at(p-1) ==
'<')
3790 foundMatch = count==0;
3805 done = count==0 || skipBracket;
3818 const char *p = s.
data();
3824 if ((c>=
'0' && c<=
'9') || (c>=
'a' && c<=
'z') || (c>=
'A' && c<=
'Z') || c==
'-')
3826 if (first && c>=
'0' && c<=
'9') growBuf.
addChar(
'a');
3832 encChar[1]=
hex[
static_cast<unsigned char>(c)>>4];
3833 encChar[2]=
hex[
static_cast<unsigned char>(c)&0xF];
3840 return growBuf.
get();
3858 const char *p = s.
data();
3864 case '<': growBuf.
addStr(
"<");
break;
3865 case '>': growBuf.
addStr(
">");
break;
3866 case '&':
if (keepEntities)
3872 if (ce==
';' || (!(
isId(ce) || ce==
'#')))
break;
3878 while (p<e) growBuf.
addChar(*p++);
3890 case '\'': growBuf.
addStr(
"'");
break;
3891 case '"': growBuf.
addStr(
""");
break;
3892 case 1:
case 2:
case 3:
case 4:
case 5:
case 6:
case 7:
case 8:
3893 case 11:
case 12:
case 13:
case 14:
case 15:
case 16:
case 17:
case 18:
3894 case 19:
case 20:
case 21:
case 22:
case 23:
case 24:
case 25:
case 26:
3895 case 27:
case 28:
case 29:
case 30:
case 31:
3897 default: growBuf.
addChar(c);
break;
3901 return growBuf.
get();
3909 const char *p=s.
data();
3915 case '<': growBuf.
addStr(
"<");
break;
3916 case '>': growBuf.
addStr(
">");
break;
3917 case '&':
if (keepEntities)
3923 if (ce==
';' || (!(
isId(ce) || ce==
'#')))
break;
3929 while (p<e) growBuf.
addChar(*p++);
3941 case '\'': growBuf.
addStr(
"'");
break;
3942 case '"': growBuf.
addStr(
""");
break;
3945 uint8_t uc =
static_cast<uint8_t
>(c);
3946 if (uc<32 && !isspace(c))
3962 return growBuf.
get();
3969 const char *p=s.
data();
3975 case '"':
if (!singleQuotes) growBuf.
addStr(
"\\\"");
else growBuf.
addChar(c);
3977 case '\'':
if (singleQuotes) growBuf.
addStr(
"\\\'");
else growBuf.
addChar(c);
3979 case '\\':
if (*p==
'u' && *(p+1)==
'{') growBuf.
addStr(
"\\");
3980 else growBuf.
addStr(
"\\\\");
3982 default: growBuf.
addChar(c);
break;
3993 std::string s = str.
data();
3994 static const reg::Ex re(R
"(&\a\w*;)");
3999 size_t p=0, i=0, l=0;
4000 for (; it!=
end ; ++it)
4002 const auto &match = *it;
4003 p = match.position();
4007 growBuf.
addStr(s.substr(i,p-i));
4011 const char *code=
nullptr;
4022 growBuf.
addStr(s.substr(i));
4025 return growBuf.
get();
4043 ASSERT(context!=
nullptr);
4045 if (ml==
nullptr)
return;
4047 struct MoveMemberInfo
4050 : memberDef(md), memberGroup(mg), sli(rv) {}
4055 std::vector<MoveMemberInfo> movedMembers;
4057 for (
const auto &md : *ml)
4059 if (md->isEnumerate())
4061 for (
const auto &fmd : md->enumFieldList())
4063 int groupId=fmd->getMemberGroupId();
4069 const auto &info = it->second;
4070 auto mg_it = std::find_if(pMemberGroups->begin(),
4071 pMemberGroups->end(),
4072 [&groupId](
const auto &g)
4073 { return g->groupId()==groupId; }
4076 if (mg_it==pMemberGroups->end())
4078 auto mg = std::make_unique<MemberGroup>(
4087 pMemberGroups->push_back(std::move(mg));
4091 mg_ptr = (*mg_it).get();
4103 int groupId=md->getMemberGroupId();
4109 const auto &info = it->second;
4110 auto mg_it = std::find_if(pMemberGroups->begin(),
4111 pMemberGroups->end(),
4112 [&groupId](
const auto &g)
4113 { return g->groupId()==groupId; }
4116 if (mg_it==pMemberGroups->end())
4118 auto mg = std::make_unique<MemberGroup>(
4127 pMemberGroups->push_back(std::move(mg));
4131 mg_ptr = (*mg_it).get();
4133 movedMembers.emplace_back(md,mg_ptr,info->m_sli);
4139 for (
const auto &mmi : movedMembers)
4141 ml->
remove(mmi.memberDef);
4142 mmi.memberGroup->insertMember(mmi.memberDef->resolveAlias());
4143 mmi.memberGroup->setRefItems(mmi.sli);
4159 AUTO_TRACE(
"type='{}' name='{}' lang={}",type,name,lang);
4160 static const reg::Ex re_norm(R
"(\a[\w:]*)");
4161 static const reg::Ex re_fortran(R
"(\a[\w:()=]*)");
4171 size_t typeLen=type.
length();
4174 if (lang == SrcLangExt::Fortran)
4186 std::string s = type.
str();
4192 const auto &match = *it;
4193 size_t i = match.position();
4194 size_t l = match.length();
4199 while (ts<typeLen && type[
static_cast<uint32_t
>(ts)]==
' ') { ts++; tl++; }
4200 if (ts<typeLen && type[
static_cast<uint32_t
>(ts)]==
'<')
4205 while (te<typeLen && brCount!=0)
4207 if (type[
static_cast<uint32_t
>(te)]==
'<')
4209 if (te<typeLen-1 && type[
static_cast<uint32_t
>(te)+1]==
'<') te++;
else brCount++;
4211 if (type[
static_cast<uint32_t
>(te)]==
'>')
4213 if (te<typeLen-1 && type[
static_cast<uint32_t
>(te)+1]==
'>') te++;
else brCount--;
4223 pos=
static_cast<int>(i+l+tl);
4227 pos=
static_cast<int>(i+l);
4232 return static_cast<int>(i);
4235 pos =
static_cast<int>(typeLen);
4248 int p=name.
find(
'<');
4249 if (p==-1)
return name;
4253 std::string s = name.
mid(p).
str();
4254 static const reg::Ex re(R
"([\a:][\w:]*)");
4259 for (; it!=
end ; ++it)
4261 const auto &match = *it;
4262 size_t i = match.position();
4263 size_t l = match.length();
4264 result += s.substr(pi,i-pi);
4267 for (
const Argument &formArg : formalArgs)
4269 if (formArg.name == n)
4295 result+=s.substr(pi);
4313 if (formalArgs.
empty())
return nm;
4316 static const reg::Ex re(R
"(\a\w*)");
4317 std::string name = nm.str();
4322 for (; it!=
end ; ++it)
4324 const auto &match = *it;
4325 size_t i = match.position();
4326 size_t l = match.length();
4327 if (i>p) result += name.substr(p,i-p);
4332 actIt = actualArgs->
begin();
4339 for (
auto formIt = formalArgs.
begin();
4340 formIt!=formalArgs.
end() && !found;
4346 if (actualArgs && actIt!=actualArgs->
end())
4353 formArg.
type =
"class";
4358 formArg.
type =
"typename";
4362 formArg.
name +=
"...";
4367 formArg.
name +=
"...";
4374 if (formArg.
name==n && actualArgs && actIt!=actualArgs->
end() && !actArg.
type.
isEmpty())
4381 ii = subst.find(
'<');
4383 if (ii!=-1 &&
static_cast<int>(
prefix.length())>=ii+2 &&
prefix.mid(
prefix.length()-ii-2,ii+1)==subst.left(ii+1))
4388 while ((ii=subst.find(nameArg,pp))!=-1)
4390 bool beforeNonWord = ii==0 || !
isId(subst.at(ii-1));
4391 bool afterNonWord = subst.length()==ii+nameArg.length() || !
isId(subst.at(ii+nameArg.length()));
4392 if (beforeNonWord && afterNonWord)
4396 pp=ii+
static_cast<int>(nameArg.length());
4401 AUTO_TRACE_ADD(
"result={} n={} type={} hasRecursion={}",result,n,actArg.
type,hasRecursion(result,n,actArg.
type));
4402 if (!hasRecursion(result,n,actArg.
type))
4414 result += actArg.
type;
4420 result += actArg.
type+
" "+actArg.
name;
4425 else if (formArg.
name==n &&
4426 (actualArgs==
nullptr || actIt==actualArgs->
end()) &&
4435 else if (formArg.
name==n &&
4436 (actualArgs==
nullptr || actIt==actualArgs->
end()) &&
4444 if (actualArgs && actIt!=actualArgs->
end())
4455 result+=name.substr(p);
4473 bool allowArtificial)
4476 int i=fullName.
find(
'<');
4477 if (i==-1)
return fullName;
4480 int l=
static_cast<int>(fullName.
length());
4487 while (e<l && count>0)
4489 char c=fullName.
at(e++);
4492 case '(': round++;
break;
4493 case ')':
if (round>0) round--;
break;
4494 case '<':
if (round==0) count++;
break;
4495 case '>':
if (round==0) count--;
break;
4500 int si= fullName.
find(
"::",e);
4502 if (parentOnly && si==-1)
break;
4505 result+=fullName.
mid(p,i-p);
4508 if (cd!=
nullptr && (allowArtificial || !cd->
isArtificial()))
4510 result+=fullName.
mid(i,e-i);
4513 else if (pLastScopeStripped)
4516 *pLastScopeStripped=fullName.
mid(i,e-i);
4519 i=fullName.
find(
'<',p);
4521 result+=fullName.
right(l-p);
4538 AUTO_TRACE(
"leftScope='{}' rightScope='{}'",leftScope,rightScope);
4546 int i=0,p=
static_cast<int>(leftScope.
length());
4551 while ((i=leftScope.
findRev(
"::",p))>0)
4555 result = leftScope.
left(i+2)+rightScope;
4583 int sl=
static_cast<int>(s.
length());
4587 if (sp>=sl)
return -1;
4611 while (sp<sl && !done)
4617 case '<': count++;
break;
4618 case '>': count--;
if (count==0) done=
true;
break;
4651 bool newPage =
true;
4656 warn(fileName,startLine,
"multiple use of page label '{}' with different titles, (other occurrence: {}, line: {})",
4740 else if (si->
lineNr() != -1)
4742 warn(orgFile,line,
"multiple use of section label '{}', (first occurrence: {}, line {})",pd->
name(),si->
fileName(),si->
lineNr());
4746 warn(orgFile,line,
"multiple use of section label '{}', (first occurrence: {})",pd->
name(),si->
fileName());
4771 if (!key.
isEmpty() && key[0]!=
'@')
4776 item->setScope(scope);
4777 item->setName(name);
4778 item->setTitle(title);
4779 item->setArgs(args);
4780 item->setGroup(key);
4828 if (!first) { ol.
writeString(
" | "); }
else first=
false;
4840 if (!first) { ol.
writeString(
" | "); }
else first=
false;
4866 int i_fs = fName.
findRev(
'/');
4867 int i_bs = fName.
findRev(
'\\');
4868 int i = fName.
find(
'.',std::max({ i_fs, i_bs ,0}));
4896 result=result.
mid(i+1);
4901 result=result.
mid(i+1);
4909 if (str.
isEmpty() || word==
nullptr)
return false;
4910 static const reg::Ex re(R
"(\a+)");
4911 std::string s = str.str();
4914 if (it->str()==word)
return true;
4925 static reg::Ex re(R
"(\s*(<\a+>)\s*)");
4926 std::string s = sentence.str();
4932 for ( ; it!=
end ; ++it)
4934 const auto match = *it;
4935 std::string part = match[1].str();
4938 size_t i = match.position();
4939 size_t l = match.length();
4940 result+=s.substr(p,i-p);
4941 result+=match.str();
4947 size_t i = match[1].position();
4948 size_t l = match[1].length();
4949 result+=s.substr(p,i-p);
4953 result+=s.substr(p);
4969 const char *p = s.
data();
4972 int i=0,li=-1,l=
static_cast<int>(s.
length());
4976 if (c==
' ' || c==
'\t' || c==
'\r') { i++; p++; }
4977 else if (c==
'\\' &&
literal_at(p,
"\\ilinebr")) { i+=8; li=i; p+=8; }
4978 else if (c==
'\n') { i++; li=i; docLine++; p++; }
4988 if (c==
' ' || c==
'\t' || c==
'\r') { b--; p--; }
4989 else if (c==
'r' && b>=7 &&
literal_at(p-7,
"\\ilinebr")) { bi=b-7; b-=8; p-=8; }
4990 else if (c==
'>' && b>=11 &&
literal_at(p-11,
"\\ilinebr<br>")) { bi=b-11; b-=12; p-=12; }
4991 else if (c==
'\n') { bi=b; b--; p--; }
4996 if (li==-1 && bi==-1)
return s;
5003 return s.
mid(li,bi-li);
5021 {
"idl",
"c", SrcLangExt::IDL,
".idl" },
5022 {
"java",
"c", SrcLangExt::Java,
".java"},
5023 {
"javascript",
"c", SrcLangExt::JS,
".js" },
5024 {
"csharp",
"c", SrcLangExt::CSharp,
".cs" },
5025 {
"d",
"c", SrcLangExt::D,
".d" },
5026 {
"php",
"c", SrcLangExt::PHP,
".php" },
5027 {
"objective-c",
"c", SrcLangExt::ObjC,
".m" },
5028 {
"c",
"c", SrcLangExt::Cpp,
".c" },
5029 {
"c++",
"c", SrcLangExt::Cpp,
".cpp" },
5030 {
"slice",
"c", SrcLangExt::Slice,
".ice" },
5031 {
"python",
"python", SrcLangExt::Python,
".py" },
5032 {
"fortran",
"fortran", SrcLangExt::Fortran,
".f" },
5033 {
"fortranfree",
"fortranfree", SrcLangExt::Fortran,
".f90" },
5034 {
"fortranfixed",
"fortranfixed", SrcLangExt::Fortran,
".f" },
5035 {
"vhdl",
"vhdl", SrcLangExt::VHDL,
".vhdl"},
5036 {
"xml",
"xml", SrcLangExt::XML,
".xml" },
5037 {
"sql",
"sql", SrcLangExt::SQL,
".sql" },
5038 {
"md",
"md", SrcLangExt::Markdown,
".md" },
5039 {
"lex",
"lex", SrcLangExt::Lex,
".l" },
5046 [&langName](
const auto &info) { return info.langName==langName; });
5053 if (extName.
at(0)!=
'.') extName.
prepend(
".");
5063 err(
"Failed to assign extension {} to parser {} for language {}\n",
5064 extName.
data(),it1->parserName,language);
5152 if (extName.
isEmpty()) extName=
".no_extension";
5153 if (extName.
at(0)!=
'.') extName.
prepend(
".");
5169 if (lang == SrcLangExt::Unknown)
5173 if (langName.
at(0)==
'.') langName = langName.
mid(1);
5175 [&langName](
const auto &info) { return info.langName==langName; });
5178 lang = it->parserId;
5179 fileName = it->defExt;
5183 return SrcLangExt::Cpp;
5192 int lastDot = fn.
findRev(
'.');
5193 if (lastDot!=-1)
return fn.
mid(lastDot);
5202 if (scope==
nullptr ||
5222 if (qualifierIndex!=-1)
5224 explicitScopePart = name.
left(qualifierIndex);
5226 name = name.
mid(qualifierIndex+2);
5230 int minDistance = 10000;
5239 if (distance!=-1 && distance<minDistance)
5241 minDistance = distance;
5255 if (bestMatch && bestMatch->
isTypedef())
5263 if (startPos>=len)
return len;
5264 uint8_t c =
static_cast<uint8_t
>(utf8Str[startPos]);
5269 int (*matcher)(int) =
nullptr;
5270 c =
static_cast<uint8_t
>(utf8Str[startPos+bytes]);
5274 c =
static_cast<uint8_t
>(utf8Str[startPos+bytes]);
5278 matcher = std::isxdigit;
5282 matcher = std::isdigit;
5285 else if (std::isalnum(c))
5288 matcher = std::isalnum;
5292 while ((c =
static_cast<uint8_t
>(utf8Str[startPos+bytes]))!=0 && matcher(c))
5302 return startPos+bytes;
5319 .setAutolinkSupport(
false))
5321 auto astImpl =
dynamic_cast<const DocNodeAST*
>(ast.get());
5325 std::visit(visitor,astImpl->root);
5330 int l=
static_cast<int>(result.
length());
5334 if (charCnt>=80)
break;
5341 if (result.
at(i)==
',' ||
5342 result.
at(i)==
'.' ||
5343 result.
at(i)==
'!' ||
5344 result.
at(i)==
'?' ||
5352 if ( i < l) result=result.
left(i)+
"...";
5353 return result.
data();
5372 auto astImpl =
dynamic_cast<const DocNodeAST*
>(ast.get());
5380 std::visit(visitor,astImpl->root);
5397 if (al.
empty())
return;
5414 .setIndexWords(
true));
5424#ifdef TRACINGSUPPORT
5425 void *backtraceFrames[128];
5426 int frameCount = backtrace(backtraceFrames, 128);
5427 const size_t cmdLen = 40960;
5428 static char cmd[cmdLen];
5430 p +=
qsnprintf(p,cmdLen,
"/usr/bin/atos -p %d ", (
int)getpid());
5431 for (
int x = 0; x < frameCount; x++)
5433 p +=
qsnprintf(p,cmdLen,
"%p ", backtraceFrames[x]);
5435 fprintf(stderr,
"========== STACKTRACE START ==============\n");
5439 while (
size_t len = fread(resBuf, 1,
sizeof(resBuf), fp))
5441 fwrite(resBuf, 1, len, stderr);
5445 fprintf(stderr,
"============ STACKTRACE END ==============\n");
5454 if (
qstricmp(inputEncoding,outputEncoding)==0)
return;
5456 if (cd==
reinterpret_cast<void *
>(-1))
5458 term(
"unsupported character conversion: '{}'->'{}': {}\n"
5459 "Check the INPUT_ENCODING setting in the config file!\n",
5460 inputEncoding,outputEncoding,strerror(errno));
5462 size_t iLeft = contents.size();
5463 const char *srcPtr = contents.data();
5464 size_t tmpBufSize = contents.size()*4+1;
5465 size_t oLeft = tmpBufSize;
5467 tmpBuf.resize(tmpBufSize);
5468 char *dstPtr = tmpBuf.data();
5472 newSize = tmpBufSize-oLeft;
5473 tmpBuf.resize(newSize);
5474 std::swap(contents,tmpBuf);
5479 term(
"{}: failed to translate characters from {} to {}: check INPUT_ENCODING\n",
5480 fileName,inputEncoding,outputEncoding);
5492 if (filterName.
isEmpty() || !filter)
5497 err(
"could not open file {}\n",fileName);
5501 auto fileSize = fi.
size();
5502 contents.resize(fileSize);
5503 f.read(contents.data(),fileSize);
5506 err(
"problems while reading file {}\n",fileName);
5512 QCString cmd=filterName+
" \""+fileName+
"\"";
5517 err(
"could not execute filter {}\n",filterName);
5520 const int bufSize=4096;
5523 while ((numRead=
static_cast<int>(fread(buf,1,bufSize,f)))>0)
5526 contents.append(buf,numRead);
5533 if (contents.size()>=2 &&
5534 static_cast<uint8_t
>(contents[0])==0xFF &&
5535 static_cast<uint8_t
>(contents[1])==0xFE
5540 else if (contents.size()>=2 &&
5541 static_cast<uint8_t
>(contents[0])==0xFE &&
5542 static_cast<uint8_t
>(contents[1])==0xFF
5547 else if (contents.size()>=3 &&
5548 static_cast<uint8_t
>(contents[0])==0xEF &&
5549 static_cast<uint8_t
>(contents[1])==0xBB &&
5550 static_cast<uint8_t
>(contents[2])==0xBF
5553 contents.erase(0,3);
5569 std::string t = title.
str();
5570 static const reg::Ex re(R
"(%[a-z_A-Z]+)");
5574 for (; it!=
end ; ++it)
5576 const auto &match = *it;
5577 size_t i = match.position();
5578 size_t l = match.length();
5579 if (i>p) tf+=t.substr(p,i-p);
5580 tf+=match.str().substr(1);
5589template<
class PatternList,
class PatternElem,
typename PatternGet = QCString(*)(const PatternElem &)>
5591 const PatternList &patList,
5598 if (!patList.empty())
5604 for (
const auto &li : patList)
5606 std::string pattern = getter(li).str();
5607 if (!pattern.empty())
5609 size_t i=pattern.find(
'=');
5610 if (i!=std::string::npos) pattern=pattern.substr(0,i);
5612 if (!caseSenseNames)
5643 auto getter = [](std::string s) ->
QCString {
return s; };
5664 if (extLinksInWindow)
5665 return "target=\"_blank\" ";
5667 return "target=\"_parent\" ";
5684 if (!targetFileName.
isEmpty())
5689 if (!anchor.
isEmpty() && isLocalFile)
5700 if (!anchor.
isEmpty()) url+=
"#"+anchor;
5713 result = it->second;
5714 size_t l = result.
length();
5715 if (!relPath.
isEmpty() && l>0 && result.
at(0)==
'.')
5720 if (l>0 && result.
at(l-1)!=
'/') result+=
'/';
5721 if (!href) result.
append(
"\" ");
5744 if (!img.
save(fileName))
5746 fprintf(stderr,
"Warning: Cannot open file %s for writing\n",data->
name);
5762 std::string s=str.
str();
5763 static const reg::Ex re(R
"(##[0-9A-Fa-f][0-9A-Fa-f])");
5769 size_t sl=s.length();
5771 for (; it!=
end ; ++it)
5773 const auto &match = *it;
5774 size_t i = match.position();
5775 size_t l = match.length();
5776 if (i>p) result+=s.substr(p,i-p);
5777 std::string lumStr = match.str().substr(2);
5778#define HEXTONUM(x) (((x)>='0' && (x)<='9') ? ((x)-'0') : \
5779 ((x)>='a' && (x)<='f') ? ((x)-'a'+10) : \
5780 ((x)>='A' && (x)<='F') ? ((x)-'A'+10) : 0)
5782 double r = 0,g = 0,b = 0;
5785 pow(level/255.0,gamma/100.0),&r,&g,&b);
5786 int red =
static_cast<int>(r*255.0);
5787 int green =
static_cast<int>(g*255.0);
5788 int blue =
static_cast<int>(b*255.0);
5791 colStr[1]=
hex[red>>4];
5792 colStr[2]=
hex[red&0xf];
5793 colStr[3]=
hex[green>>4];
5794 colStr[4]=
hex[green&0xf];
5795 colStr[5]=
hex[blue>>4];
5796 colStr[6]=
hex[blue&0xf];
5802 if (p<sl) result+=s.substr(p);
5813 err(
"could not copy file {} to {}\n",src,dest);
5827 int m1 = text.
find(marker);
5828 if (m1==-1)
return result;
5833 while (!found && (i=text.
find(
'\n',p))!=-1)
5835 found = (p<=m1 && m1<i);
5851 if (lang==SrcLangExt::Java || lang==SrcLangExt::CSharp || lang==SrcLangExt::VHDL || lang==SrcLangExt::Python)
5855 else if (lang==SrcLangExt::PHP && !classScope)
5867 static const std::unordered_set<std::string> schemes = {
5868 "http",
"https",
"ftp",
"ftps",
"sftp",
"file",
"news",
"irc",
"ircs"
5871 int colonPos = loc_url.
find(
':');
5872 return colonPos!=-1 && schemes.find(loc_url.
left(colonPos).
str())!=schemes.end();
5894 return (prot!=Protection::Private && prot!=Protection::Package) ||
5895 (prot==Protection::Private && extractPrivate) ||
5896 (prot==Protection::Package && extractPackage);
5907 const char *p=s.
data();
5910 int minIndent=1000000;
5911 bool searchIndent=
true;
5913 bool skipFirst = skipFirstLine;
5916 if (c==
'\t') { indent+=tabSize - (indent%tabSize); }
5917 else if (c==
'\n') { indent=0; searchIndent=
true; skipFirst=
false; }
5918 else if (c==
' ') { indent++; }
5919 else if (searchIndent && !skipFirst)
5922 if (indent<minIndent) minIndent=indent;
5927 if (minIndent==0)
return substitute(s,
"@ilinebr",
"\\ilinebr");
5933 skipFirst=skipFirstLine;
5942 else if (indent<minIndent && !skipFirst)
5946 int newIndent = indent+tabSize-(indent%tabSize);
5960 else if (c==
'\\' &&
literal_at(p,
"ilinebr "))
5963 result <<
"\\ilinebr ";
5966 for (
int j=0;j<minIndent;j++)
if (*(p+j)==
' ') skipAmount++;
5967 if (skipAmount==minIndent)
5974 result <<
"\\ilinebr";
5985 return result.
str();
5992 if (indentationLevel <= 0 || doc.
isEmpty())
return;
5997 const char *src = doc.
data();
5999 bool insideIndent =
false;
6008 insideIndent =
true;
6009 cnt = indentationLevel;
6020 insideIndent =
false;
6030 insideIndent =
false;
6035 doc.
resize(
static_cast<uint32_t
>(dst-doc.
data()));
6044 return ( ((allExternals && fd->
isLinkable()) ||
6062uint32_t getUtf8Code(
const QCString& s,
int idx )
6064 const int length = s.
length();
6065 if (idx >= length) {
return 0; }
6066 const uint32_t c0 = (uint8_t)s.
at(idx);
6067 if ( c0 < 0xC2 || c0 >= 0xF8 )
6071 if (idx+1 >= length) {
return 0; }
6072 const uint32_t c1 = ((uint8_t)s.
at(idx+1)) & 0x3f;
6075 return ((c0 & 0x1f) << 6) | c1;
6077 if (idx+2 >= length) {
return 0; }
6078 const uint32_t c2 = ((uint8_t)s.
at(idx+2)) & 0x3f;
6081 return ((c0 & 0x0f) << 12) | (c1 << 6) | c2;
6083 if (idx+3 >= length) {
return 0; }
6085 const uint32_t c3 = ((uint8_t)s.
at(idx+3)) & 0x3f;
6086 return ((c0 & 0x07) << 18) | (c1 << 12) | (c2 << 6) | c3;
6098uint32_t getUtf8CodeToLower(
const QCString& s,
int idx )
6100 const uint32_t v = getUtf8Code( s, idx );
6101 return v < 0x7f ? tolower( v ) : v;
6113uint32_t getUtf8CodeToUpper(
const QCString& s,
int idx )
6115 const uint32_t v = getUtf8Code( s, idx );
6116 return v < 0x7f ? toupper( v ) : v;
6130 std::string s = docs.
str();
6131 static const reg::Ex re(R
"(\[([ inout,]+)\])");
6136 const auto &match = *it;
6137 size_t p = match.position();
6138 size_t l = match.length();
6142 std::string dir = match[1].str();
6144 dir.erase(std::remove_if(dir.begin(),dir.end(),
6145 [](
const char c) { return c==
' ' || c==
','; }
6147 unsigned char ioMask=0;
6148 size_t inIndex = dir.find(
"in");
6149 if ( inIndex!=std::string::npos) { dir.erase( inIndex,2); ioMask|=(1<<0); }
6150 size_t outIndex = dir.find(
"out");
6151 if (outIndex!=std::string::npos) { dir.erase(outIndex,3); ioMask|=(1<<1); }
6152 if (dir.empty() && ioMask!=0)
6155 if (ioMask==((1<<0)|(1<<1)))
return "[in,out]";
6156 else if (ioMask==(1<<0))
return "[in]";
6157 else if (ioMask==(1<<1))
return "[out]";
6189 *outListType1=inListType;
6192 if (inProt==Protection::Public)
6199 else if (inProt==Protection::Protected)
6207 *outListType2=inListType.
toPublic();
6210 else if (inProt==Protection::Private)
6220 *outListType1=inListType.
toPublic();
6242 int i= imgExt.
find(
':');
6243 return i==-1 ? imgExt : imgExt.
left(i);
6248 assert(!f.is_open());
6249 bool fileOpened=
FALSE;
6250 bool writeToStdout=outFile==
"-";
6253 f.basic_ios<char>::rdbuf(std::cout.rdbuf());
6268 fileOpened = f.is_open();
6275 static const std::unordered_set<std::string> fortran_C_keywords = {
6276 "character",
"call",
"close",
"common",
"continue",
6277 "case",
"contains",
"cycle",
"class",
"codimension",
6278 "concurrent",
"contiguous",
"critical"
6281 if (*contents !=
'c' && *contents !=
'C')
return false;
6283 const char *c = contents;
6285 while (*c && *c !=
' ') {keyword += *c; c++;}
6286 keyword = keyword.
lower();
6288 return (fortran_C_keywords.find(keyword.
str()) != fortran_C_keywords.end());
6296 bool skipLine=
FALSE;
6302 size_t sizCont = contents.
length();
6303 for (
size_t i=0;i<sizCont;i++)
6307 switch(contents.
at(i))
6314 column += tabSize-1;
6331 if (column==1)
return TRUE;
6332 if (skipLine)
break;
6335 if (column!=6) skipLine=
TRUE;
6338 if (skipLine)
break;
6339 if (column>=7)
return TRUE;
6364 auto skipBlock = [&markerInfo](
const char *p,
const SelectionBlock &blk)
6371 size_t len = markerInfo.
endLen;
6372 bool negate = *(p+markerInfo.
endLen)==
'!';
6374 size_t blkNameLen =
qstrlen(blk.name);
6375 if (
qstrncmp(p+len,blk.name,blkNameLen)==0 &&
6379 return p+len+blkNameLen+markerInfo.
closeLen;
6396 const char *p = s.
data();
6406 bool negate = *(p+len)==
'!';
6408 for (
const auto &blk : blockList)
6410 size_t blkNameLen =
qstrlen(blk.name);
6411 if (
qstrncmp(p+len,blk.name,blkNameLen)==0 &&
6414 bool blockEnabled = blk.enabled!=negate;
6416 p+=len+blkNameLen+markerInfo.
closeLen;
6435 size_t len = markerInfo.
endLen;
6436 bool negate = *(p+len)==
'!';
6438 for (
const auto &blk : blockList)
6440 size_t blkNameLen =
qstrlen(blk.name);
6441 if (
qstrncmp(p+len,blk.name,blkNameLen)==0 &&
6445 p+=len+blkNameLen+markerInfo.
closeLen;
6476 const char *p = s.
data();
6485 bool negate = *(p+len)==
'!';
6491 if (markerInfo.
closeLen==0 && *p==
'\n')
6493 warn(fileName,-1,
"Remaining begin replacement with marker '{}'",marker);
6499 warn(fileName,-1,
"Remaining begin replacement with marker '{}'",marker);
6508 size_t len = markerInfo.
endLen;
6509 bool negate = *(p+len)==
'!';
6515 if (markerInfo.
closeLen==0 && *p==
'\n')
6517 warn(fileName,-1,
"Remaining end replacement with marker '{}'",marker);
6523 warn(fileName,-1,
"Remaining end replacement with marker '{}'",marker);
6540 const char *p=s.
data();
6549 while (*e==
' ' || *e==
'\t') e++;
6571 size_t prev = 0, pos = 0, len = s.length();
6574 pos = s.find(delimiter, prev);
6575 if (pos == std::string::npos) pos = len;
6576 if (pos>prev) result.push_back(s.substr(prev,pos-prev));
6577 prev = pos + delimiter.length();
6579 while (pos<len && prev<len);
6591 for ( ; iter !=
end; ++iter)
6593 const auto &match = *iter;
6594 size_t i=match.position();
6595 size_t l=match.length();
6596 if (i>p) result.push_back(s.substr(p,i-p));
6599 if (p<s.length()) result.push_back(s.substr(p));
6606 auto it = std::find(sv.begin(),sv.end(),s);
6607 return it!=sv.end() ?
static_cast<int>(it-sv.begin()) : -1;
6615 return reg::search(s,match,re) ?
static_cast<int>(match.position()) : -1;
6623 for (
const auto &s : sv)
6625 if (!first) result+=delimiter;
6639 while (residual > 0)
6641 modVal[0] = (upper ?
'A':
'a') + (residual-1)%26;
6642 result = modVal + result;
6643 residual = (residual-1) / 26;
6650 static const char *str_romans_upper[] = {
"M",
"CM",
"D",
"CD",
"C",
"XC",
"L",
"XL",
"X",
"IX",
"V",
"IV",
"I" };
6651 static const char *str_romans_lower[] = {
"m",
"cm",
"d",
"cd",
"c",
"xc",
"l",
"xl",
"x",
"ix",
"v",
"iv",
"i" };
6652 static const int values[] = { 1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1 };
6653 static const char **str_romans = upper ? str_romans_upper : str_romans_lower;
6658 for (
int i = 0; i < 13; ++i)
6660 while (residual - values[i] >= 0)
6662 result += str_romans[i];
6663 residual -= values[i];
6673 size_t size = s.
length();
6675 const char *data = s.
data();
6678 constexpr auto doxy_nbsp =
"&_doxy_nbsp;";
6679 const int maxIndent=1000000;
6680 int minIndent=maxIndent;
6689 int stop = tabSize - (col%tabSize);
6692 while (stop--) out.
addChar(
' ');
6696 if (data[i] ==
'\\')
6702 else if (i+5<size &&
literal_at(data+i,
"iskip"))
6707 else if (i+8<size &&
literal_at(data+i,
"endiskip"))
6739 for (
int j=0;j<bytes-1 && c;j++)
6751 if (!skip && col<minIndent) minIndent=col;
6755 if (minIndent!=maxIndent) refIndent=minIndent;
else refIndent=0;
6765 uint8_t md5_sig[16];
6767 MD5Buffer(projectCookie.
data(),
static_cast<unsigned int>(projectCookie.
length()),md5_sig);
6768 MD5SigToString(md5_sig,sigStr);
6769 sigStr[32]=
'_'; sigStr[33]=0;
6776 int l =
static_cast<int>(name.
length());
6777 int lastSepPos = -1;
6778 const char *p = name.
data();
6787 if (sharpCount==0 && p[i+1]==
':' && p[i+2]==
':')
6801 if (ts==-1) ts=0;
else p+=++ts;
6802 for (i=ts;i<l-1;i++)
6805 if (c==
':' && *p==
':') lastSepPos=i;
6840 case '\t': col+=tabSize - (col%tabSize);
6849 for (
int i=0;i<numBytes-1 && (c=*s++);i++) {}
6850 if (c==0)
return col;
6865 int idx = name.
find(
'<');
6878 int idx = result.
find(
'-');
6879 result = result.
left(idx)+templArgs;
6887 int i = text.
find(
'"');
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
Class representing a string buffer optimized for growing.
void addStr(const QCString &s)
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::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 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)
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 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 stripIndentationVerbatim(QCString &doc, const int indentationLevel)
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)
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 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()
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)
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)
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