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;
116 for (
size_t i=0;
i<
s.length();
i++)
121 m_ol.writeNonBreakableSpace(1);
138 m_ol.lineBreak(
"typebreak");
139 for (
int i=0;
i<indent;
i++)
141 m_ol.writeNonBreakableSpace(3);
146 const QCString &anchor,std::string_view text
150 m_ol.writeObjectLink(extRef,file,anchor,
QCString(text));
179 auto startsWithColon = [](
const std::string &del)
181 for (
size_t i=0;
i<del.size();
i++)
183 if (del[
i]==
'@')
return false;
184 else if (del[
i]==
':')
return true;
190 auto endsWithColon = [](
const std::string &del)
192 for (
int i=
static_cast<int>(del.size())-1;
i>=0;
i--)
194 if (del[
i]==
'@')
return false;
195 else if (del[
i]==
':')
return true;
200 static const reg::Ex re(R
"([\s:]*@\d+[\s:]*)");
201 std::string s = str.str();
205 size_t sl=
s.length();
206 bool needsSeparator=
false;
207 for ( ; iter!=
end ; ++iter)
209 const auto &match = *iter;
210 size_t i = match.position();
213 if (needsSeparator) result+=
"::";
214 needsSeparator=
false;
215 result+=
s.substr(p,
i-p);
217 std::string delim = match.str();
218 needsSeparator = needsSeparator || (startsWithColon(delim) && endsWithColon(delim));
219 p = match.position()+match.length();
223 if (needsSeparator) result+=
"::";
232 if (
s.isEmpty())
return s;
233 static const reg::Ex marker(R
"(@\d+)");
235 !replacement.isEmpty() ? replacement.data() : "__anonymous__");
246 int sl =
static_cast<int>(
s.length());
254 if (!newScope.
isEmpty()) newScope+=
"::";
255 newScope+=
s.mid(
i,l);
260 if (!newScope.
isEmpty()) newScope+=
"::";
261 newScope+=
s.right(sl-
i);
293 const int maxMarkerStrLen = 20;
294 char result[maxMarkerStrLen];
295 qsnprintf(result,maxMarkerStrLen,
"@%d",
id);
316 for (
const auto &
s : l)
319 if (
prefix.length() > length &&
326 if (length>0)
return potential;
353 static const std::unordered_set<std::string> sourceExt = {
354 "c",
"cc",
"cxx",
"cpp",
"c++",
"cppm",
"ccm",
"cxxm",
"c++m",
358 "ii",
"ixx",
"ipp",
"i++",
"inl",
361 static const std::unordered_set<std::string> headerExt = {
362 "h",
"hh",
"hxx",
"hpp",
"h++",
"ixx",
363 "idl",
"ddl",
"pidl",
"ice"
369 if (sourceExt.find(extension.
str())!=sourceExt.end())
371 return EntryType::makeSource();
373 if (headerExt.find(extension.
str())!=headerExt.end())
375 return EntryType::makeHeader();
382 return EntryType::makeEmpty();
388 AUTO_TRACE(
"context='{}' qualifiedName='{}'",context?context->
name():
"",qualifiedName);
397 if (typedefContext) *typedefContext=context;
400 if (qualifiedName.
find(
'<')!=-1)
405 int scopeIndex = qualifiedName.
findRev(
"::");
409 resName=qualifiedName.
right(qualifiedName.
length()-scopeIndex-2);
417 while (mContext && md==
nullptr)
433 if (!tmp.
isEmpty()) qualScopePart=tmp;
436 if (resScope==
nullptr)
break;
448 bool searchRelated=
false;
449 bool mustBeRelated=
false;
460 if (mn==0 && searchRelated)
468 for (
const auto &tmd_p : *mn)
471 AUTO_TRACE_ADD(
"found candidate member '{}' isTypeDef={}' isRelated={} mustBeRelated={}",
486 if (dist!=-1 && (md==
nullptr || dist<minDist))
508 if (args.
find(
")(")!=-1)
512 else if (args.
find(
'[')!=-1)
532static const char constScope[] = {
'c',
'o',
'n',
's',
't',
':' };
533static const char volatileScope[] = {
'v',
'o',
'l',
'a',
't',
'i',
'l',
'e',
':' };
534static const char virtualScope[] = {
'v',
'i',
'r',
't',
'u',
'a',
'l',
':' };
535static const char operatorScope[] = {
'o',
'p',
'e',
'r',
'a',
't',
'o',
'r',
'?',
'?',
'?' };
584 if (
s.isEmpty() ||
vhdl)
return s;
591 if (
s.length()*3>growBufLen)
593 growBufLen =
s.length()*3;
594 growBuf =
static_cast<char *
>(realloc(growBuf,growBufLen+1));
596 if (growBuf==
nullptr)
return s;
598 const char *src=
s.data();
609 while (
i<l && isspace(
static_cast<uint8_t
>(src[
i])))
616 char nc=
i+1<l ? src[
i+1] :
' ';
618 auto searchForKeyword = [&](
const char *kw,
size_t &matchLen,
size_t totalLen)
620 if (matchLen<=totalLen && c==kw[matchLen] &&
655 if (c==
'\\' &&
i+1<l)
679 if (
i>0 && !isspace(
static_cast<uint8_t
>(pc)) &&
680 (
isId(pc) || pc==
'*' || pc==
'&' || pc==
'.' || pc==
'>') &&
681 (osp<8 || (osp==8 && pc!=
'-'))
687 if (
i+1<l && (nc==
'-' || nc==
'&'))
694 if (
i>0 && !isspace(
static_cast<uint8_t
>(pc)) &&
695 ((
i+1<l && (
isId(nc) || nc==
'[')) ||
696 (
i+2<l && nc==
'$' &&
isId(src[
i+2])) ||
697 (
i+3<l && nc==
'&' && src[
i+2]==
'$' &&
isId(src[
i+3]))
707 if (cliSupport &&
i+1<l && (
isId(nc) || nc==
'-'))
714 if (
i+1<l && (
isId(nc) || nc==
'-'))
720 if (
i>0 && pc!=
' ' && pc!=
'\t' && pc!=
':' &&
721 pc!=
'*' && pc!=
'&' && pc!=
'(' && pc!=
'/' &&
731 if (
i>0 &&
isId(pc) && osp<9)
751 if (
i>0 &&
i+1<l && pc!=
'=' && pc!=
':' && !isspace(
static_cast<uint8_t
>(pc)) &&
782 !(pc==
',' && nc==
'.') &&
783 (osp<8 || (osp>=8 &&
isId(pc) &&
isId(nc)))
791 else if ((pc==
'*' || pc==
'&' || pc==
'.') && nc==
'>')
799 auto correctKeywordAllowedInsideScope = [&](
char cc,
size_t &matchLen,
size_t totalLen) {
800 if (c==cc && matchLen==totalLen)
802 if ((
i+2<l && src[
i+1] ==
':' && src[
i+2] ==
':') ||
803 ((
i>matchLen && src[
i-matchLen] ==
':' && src[
i-matchLen-1] ==
':'))
807 correctKeywordAllowedInsideScope(
't',csp, 5);
808 correctKeywordAllowedInsideScope(
'e',vosp,8);
809 correctKeywordAllowedInsideScope(
'l',vsp, 7);
811 auto correctKeywordNotPartOfScope = [&](
char cc,
size_t &matchLen,
size_t totalLen)
813 if (c==cc && matchLen==totalLen &&
i+1<l &&
821 correctKeywordNotPartOfScope(
't',csp, 5);
822 correctKeywordNotPartOfScope(
'e',vosp,8);
823 correctKeywordNotPartOfScope(
'l',vsp, 7);
843 if (templateDepth > 0)
845 int nextOpenPos=name.
findRev(
'>', pos);
846 int nextClosePos=name.
findRev(
'<', pos);
847 if (nextOpenPos!=-1 && nextOpenPos>nextClosePos)
852 else if (nextClosePos!=-1)
864 int lastAnglePos=name.
findRev(
'>', pos);
865 int bracePos=name.
findRev(
'(', pos);
866 if (lastAnglePos!=-1 && lastAnglePos>bracePos)
873 int bp = bracePos>0 ? name.
findRev(
'(',bracePos-1) : -1;
875 return bp==-1 || (bp>=8 && name.
mid(bp-8,10)==
"operator()") ? bracePos : bp;
886 return (name==scope ||
887 (scope.
right(nl)==name &&
888 sl>1+nl && scope.
at(sl-nl-1)==
':' && scope.
at(sl-nl-2)==
':'
897 return (name==scope ||
898 (name.
left(sl)==scope &&
899 nl>sl+1 && name.
at(sl)==
':' && name.
at(sl+1)==
':'
907 const QCString &text,
bool autoBreak,
bool external,
908 bool keepSpaces,
int indentLevel)
912 std::string_view txtStr=text.
view();
913 size_t strLen = txtStr.length();
914 if (strLen==0)
return;
916 static const reg::Ex regExp(R
"((::)?\a[\w~!\\.:$"]*)");
926 size_t floatingIndex=0;
927 for (; it!=
end ; ++it)
929 const auto &match = *it;
930 size_t newIndex = match.position();
931 size_t matchLen = match.length();
932 floatingIndex+=newIndex-skipIndex+matchLen;
933 if (newIndex>0 && txtStr.at(newIndex-1)==
'0')
935 std::string_view part = txtStr.substr(skipIndex,newIndex+matchLen-skipIndex);
936 out.writeString(part,keepSpaces);
937 skipIndex=index=newIndex+matchLen;
942 bool insideString=
FALSE;
943 for (
size_t i=index;
i<newIndex;
i++)
945 if (txtStr.at(
i)==
'"') insideString=!insideString;
946 if (txtStr.at(
i)==
'\\')
i++;
950 if (strLen>35 && floatingIndex>30 && autoBreak)
952 std::string_view splitText = txtStr.substr(skipIndex,newIndex-skipIndex);
953 size_t splitLength = splitText.length();
955 size_t i = splitText.find(
',');
956 if (
i==std::string::npos) {
i=splitText.find(
'<');
if (
i!=std::string::npos) offset=0; }
957 if (
i==std::string::npos)
i=splitText.find(
'>');
958 if (
i==std::string::npos)
i=splitText.find(
' ');
960 if (
i!=std::string::npos)
962 std::string_view part1 = splitText.substr(0,
i+offset);
963 out.writeString(part1,keepSpaces);
964 out.writeBreak(indentLevel==0 ? 0 : indentLevel+1);
965 std::string_view part2 = splitText.substr(
i+offset);
966 out.writeString(part2,keepSpaces);
967 floatingIndex=splitLength-
i-offset+matchLen;
971 out.writeString(splitText,keepSpaces);
977 std::string_view part = txtStr.substr(skipIndex,newIndex-skipIndex);
978 out.writeString(part,keepSpaces);
981 std::string_view word=txtStr.substr(newIndex,matchLen);
1010 auto writeCompoundName = [&](
const auto *cd_) {
1011 if (external ? cd_->isLinkable() : cd_->isLinkableInProject())
1016 out.writeLink(cd_->getReference(),cd_->getOutputFileBase(),cd_->anchor(),word);
1021 if (!found && (cd || (cd=
getClass(matchWord))))
1023 writeCompoundName(cd);
1025 else if ((cd=
getClass(matchWord+
"-p")))
1027 writeCompoundName(cd);
1031 writeCompoundName(cnd);
1038 int m = matchWord.
findRev(
"::");
1046 scopeName=scope->
name();
1050 scopeName = matchWord.
left(m);
1051 matchWord = matchWord.
mid(m+2);
1060 if (result.
found && result.
md &&
1067 if (result.
md!=self && (self==
nullptr || result.
md->
name()!=self->
name()))
1092 out.writeString(word,keepSpaces);
1096 skipIndex=index=newIndex+matchLen;
1100 std::string_view lastPart = txtStr.substr(skipIndex);
1101 out.writeString(lastPart,keepSpaces);
1105 std::function<
void(
size_t)> replaceFunc)
1107 static const reg::Ex marker(R
"(@(\d+))");
1112 for ( ; it!=
end ; ++it)
1114 const auto &match = *it;
1115 size_t newIndex = match.position();
1116 size_t matchLen = match.length();
1117 ol.
parseText(markerText.substr(index,newIndex-index));
1118 unsigned long entryIndex = std::stoul(match[1].str());
1119 if (entryIndex<
static_cast<unsigned long>(numMarkers))
1121 replaceFunc(entryIndex);
1123 index=newIndex+matchLen;
1130 auto replaceFunc = [&list,&ol](
size_t entryIndex)
1132 const auto &e = list[entryIndex];
1164 if (a.hasDocumentation())
1168 paramDocs+=
" \\ilinebr @param"+direction+
" "+a.name+
" "+docsWithoutDir;
1182 if (!a.docs.isEmpty())
1184 if (!a.name.isEmpty())
1186 paramDocs+=
" \\ilinebr @tparam "+a.name+
" "+a.docs;
1188 else if (!a.type.isEmpty())
1194 paramDocs+=
" \\ilinebr @tparam "+type+
" "+a.docs;
1207 for (
auto it = al.
begin() ; it!=al.
end() ;)
1212 int i=type1.
find(
")(");
1216 type1=type1.
left(
i);
1224 result+= type1+
" "+a.
name+type2+a.
array;
1228 result+= type1+type2;
1235 if (it!=al.
end()) result+=
", ";
1250 if (al.
empty())
return result;
1253 for (
const auto &a : al)
1255 if (a.defval.isEmpty() || includeDefault)
1257 if (!first) result+=
", ";
1258 if (!a.name.isEmpty())
1260 if (lang==SrcLangExt::Java || lang==SrcLangExt::CSharp)
1268 int i =
static_cast<int>(a.type.length())-1;
1269 while (
i>=0 &&
isId(a.type.at(
i)))
i--;
1272 result+=a.type.
right(a.type.length()-
i-1);
1273 if (a.type.find(
"...")!=-1)
1283 if (!a.typeConstraint.isEmpty() && lang==SrcLangExt::Java)
1285 result+=
" extends ";
1286 result+=a.typeConstraint;
1307 size_t len = contents.length();
1311 char c = contents[src++];
1315 if (src<len && contents[src] ==
'\n')
1320 else if ( c ==
'\0' && src<len-1)
1324 contents[dest++] = c;
1326 contents.resize(dest);
1333 for (
const auto &filterStr : filterList)
1336 int i_equals=fs.
find(
'=');
1343 filterPattern = filterPattern.
lower();
1344 input = input.
lower();
1351 if (filterName.
find(
' ')!=-1)
1353 filterName=
"\""+filterName+
"\"";
1373 if (name.
isEmpty())
return "";
1380 if (isSourceCode && !filterSrcList.empty())
1384 if (!found && filterName.
isEmpty())
1395 if (filterName.
length()>=2 && filterName[0]==
'"' && filterName[
static_cast<int>(filterName.
length())-1]==
'"')
1397 filterName = filterName.
mid(1,filterName.
length()-2);
1406 const char *outputEncoding =
"UTF-8";
1407 if (inputEncoding==
nullptr ||
qstricmp(inputEncoding,outputEncoding)==0)
return true;
1408 size_t inputSize=input.length();
1409 size_t outputSize=inputSize*4;
1412 if (cd==
reinterpret_cast<void *
>(-1))
1417 size_t iLeft=inputSize;
1418 size_t oLeft=outputSize;
1419 const char *inputPtr = input.data();
1420 char *outputPtr = output.
rawData();
1423 outputSize-=
static_cast<int>(oLeft);
1424 output.
resize(outputSize);
1425 output.
at(outputSize)=
'\0';
1445 bool fileOpened=
false;
1446 if (name[0]==
'-' && name[1]==0)
1448 std::string contents;
1450 while (getline(std::cin,
line))
1452 contents+=
line+
'\n';
1461 err(
"file '{}' not found\n",name);
1474 err(
"cannot open file '{}' for reading\n",name);
1482 for (
const auto &bcd : bcl)
1486 int spos=
s.find(cd->
name()+
"::");
1489 s =
s.left(spos)+
s.right(
1503 if (target==str) { target.
clear();
return; }
1505 int l=
static_cast<int>(str.
length());
1507 while ((
i=target.
find(str,p))!=-1)
1509 bool isMatch = (
i==0 || !
isId(target.
at(
i-1))) &&
1510 (
i+l==
static_cast<int>(target.
length()) || !
isId(target.
at(
i+l)));
1513 int i1=target.
find(
'*',
i+l);
1514 int i2=target.
find(
'&',
i+l);
1515 if (i1==-1 && i2==-1)
1522 else if ((i1!=-1 &&
i<i1) || (i2!=-1 &&
i<i2))
1564 int i=
s.find(
" class ");
1565 if (
i!=-1)
return s.left(
i)+
s.mid(
i+6);
1566 i=
s.find(
" typename ");
1567 if (
i!=-1)
return s.left(
i)+
s.mid(
i+9);
1568 i=
s.find(
" union ");
1569 if (
i!=-1)
return s.left(
i)+
s.mid(
i+6);
1570 i=
s.find(
" struct ");
1571 if (
i!=-1)
return s.left(
i)+
s.mid(
i+7);
1584 if (!templSpec.
isEmpty() && templSpec.
at(0) ==
'<')
1591 templSpec = resolvedType;
1602 if (count>10)
return word;
1604 QCString symName,result,templSpec,tmpName;
1605 if (tSpec && !tSpec->
isEmpty())
1608 AUTO_TRACE(
"d='{}' fs='{}' word='{}' templSpec='{}'",d?d->
name():
"",fs?fs->
name():
"",word,templSpec);
1626 bool isTemplInst = cd && !templSpec.
isEmpty();
1627 if (!cd && !templSpec.
isEmpty())
1638 cd?cd->
name():
"",mType?mType->
name():
"",ts,resolvedType);
1661 if (cd==d && tSpec) *tSpec=
"";
1665 result = resolvedType+ts;
1673 if (tSpec) *tSpec=
"";
1687 result=cd->
name()+templSpec;
1737 resolvedType = lang==SrcLangExt::Java ? word :
resolveTypeDef(d,word);
1745 result = resolvedType;
1778 if (
i>pp) canType += type.
mid(pp,
i-pp);
1799 std::string ts = templSpec.
str();
1800 static const reg::Ex re(R
"(\a\w*)");
1807 for (; it!=
end ; ++it)
1809 const auto &match = *it;
1810 size_t ti = match.position();
1811 size_t tl = match.length();
1812 std::string matchStr = match.str();
1813 canType += ts.substr(tp,ti-tp);
1817 canType+=ts.substr(tp);
1833 if ((type==
"const" || type==
"volatile") && !name.
isEmpty())
1838 if (name==
"const" || name==
"volatile")
1840 if (!type.
isEmpty()) type+=
" ";
1866 AUTO_TRACE(
"srcType='{}' dstType='{}'",srcType,dstType);
1867 if (srcType==dstType)
return true;
1870 int i1=srcType.
find(
")(");
1871 if (i1==-1)
return false;
1872 int i2=dstType.
find(
")(");
1873 if (i1!=i2)
return false;
1876 int j1=srcType.
find(
"(");
1877 if (j1==-1 || j1>i1)
return false;
1878 int j2=dstType.
find(
"(");
1879 if (j2!=j1)
return false;
1880 if (srcType.
left(j1)!=dstType.
left(j2))
return false;
1889 dstScope,dstFileScope,dstAl.get(),
1899 AUTO_TRACE(
"src: scope={} type={} name={} canType={}, dst: scope={} type={} name={} canType={}",
1918 srcA.
type+=sSrcName;
1922 else if (sDstName==srcType.
right(sDstName.
length()))
1924 dstA.
type+=sDstName;
1940 dstScope,dstFileScope,dstA.
canType,
1963 ASSERT(srcScope!=
nullptr && dstScope!=
nullptr);
1965 AUTO_TRACE(
"srcScope='{}' dstScope='{}' srcArgs='{}' dstArgs='{}' checkCV={} lang={}",
1968 if (srcAl==
nullptr || dstAl==
nullptr)
1970 bool match = srcAl==dstAl;
2001 if (srcAl->
size() != dstAl->
size())
2029 auto srcIt = srcAl->
begin();
2030 auto dstIt = dstAl->
begin();
2031 for (;srcIt!=srcAl->
end() && dstIt!=dstAl->
end();++srcIt,++dstIt)
2036 dstScope,dstFileScope,dstA,
2055 AUTO_TRACE(
"srcAl='{}',dstAl='{}',forceNameOverwrite={}",
2063 auto srcIt=srcAl.
begin();
2064 auto dstIt=dstAl.
begin();
2065 while (srcIt!=srcAl.
end() && dstIt!=dstAl.
end())
2070 AUTO_TRACE_ADD(
"before merge: src=[type='{}',name='{}',def='{}'] dst=[type='{}',name='{}',def='{}']",
2086 if (srcA.
name==
"const" || srcA.
name==
"volatile")
2091 if (dstA.
name==
"const" || dstA.
name==
"volatile")
2117 if (forceNameOverwrite)
2160 j1=
static_cast<int>(srcA.
type.
length())-i1-2,
2161 j2=
static_cast<int>(dstA.
type.
length())-i2-2;
2169 else if (i1==-1 && i2!=-1 && dstA.
type.
right(j2)==srcA.
type)
2189 AUTO_TRACE_ADD(
"after merge: src=[type='{}',name='{}',def='{}'] dst=[type='{}',name='{}',def='{}']",
2205 auto isUnconstraintTemplate = [](
const QCString &type)
2207 return type==
"typename" || type==
"class" || type.startsWith(
"typename ") || type.startsWith(
"class ");
2209 auto srcIt = srcAl.
begin();
2210 auto dstIt = dstAl.
begin();
2211 while (srcIt!=srcAl.
end() && dstIt!=dstAl.
end())
2215 if ((!isUnconstraintTemplate(srcA.
type) || !isUnconstraintTemplate(dstA.
type)) && srcA.
type!=dstA.
type)
2235 std::vector<const MemberDef *> &members)
2239 for (
const auto &md_p : *mn)
2250 currentFile==
nullptr || fd==currentFile)
2266 members.push_back(md);
2302 result.
found =
true;
2307 result.
found =
true;
2312 result.
found =
true;
2317 result.
found =
true;
2322 result.
found =
true;
2364 memberName =
substitute(memberName,
"\\",
"::");
2369 while ((is=scopeName.
findRev(
"::"))!=-1 &&
2370 (im=memberName.
find(
"::",pm))!=-1 &&
2371 (scopeName.
right(scopeName.
length()-is-2)==memberName.
mid(pm,im-pm))
2374 scopeName=scopeName.
left(is);
2383 (im=memberName.
findRev(
"::"))!=-1 &&
2384 im<
static_cast<int>(memberName.
length())-2
2387 mScope=memberName.
left(im);
2392 if (mScope==scopeName) scopeName.
clear();
2403 int scopeOffset =
static_cast<int>(scopeName.
length());
2409 className+=
"::"+mScope;
2420 if (fcd==
nullptr && className.
find(
'<')!=-1)
2434 std::unique_ptr<ArgumentList> argList;
2439 for (
const auto &mmd_p : *mn)
2456 if (m<mdist && mcd->isLinkable())
2470 for (
const auto &mmd_p : *mn)
2480 if (m<mdist /* && mcd->isLinkable()*/ )
2496 result.
md =
nullptr;
2497 result.
cd =
nullptr;
2498 result.
found =
false;
2504 if (result.
gd) result.
cd=
nullptr;
2515 if (emd->localName()==mName)
2517 if (emd->isLinkable())
2521 result.
found =
true;
2526 result.
cd =
nullptr;
2527 result.
md =
nullptr;
2528 result.
found =
false;
2539 else if ((scopeOffset=scopeName.
findRev(
"::",scopeOffset-1))==-1)
2543 }
while (scopeOffset>=0);
2550 std::unique_ptr<ArgumentList> argList;
2551 bool hasEmptyArgs = input.
args==
"()";
2558 for (
const auto &mmd_p : *mn)
2583 if (!fuzzy_mmd && hasEmptyArgs)
2591 result.
md = fuzzy_mmd;
2593 result.
found =
true;
2606 int scopeOffset =
static_cast<int>(scopeName.
length());
2612 namespaceName+=
"::"+mScope;
2616 namespaceName=mScope;
2619 if (!namespaceName.
isEmpty() &&
2627 for (
const auto &mmd_p : *mn)
2674 if (!found && input.
args==
"()")
2678 for (
const auto &mmd_p : *mn)
2703 result.
found =
true;
2711 for (
const auto &mmd_p : *mn)
2716 int ni=namespaceName.
findRev(
"::");
2722 (notInNS || sameNS) &&
2732 result.
found =
true;
2741 else if ((scopeOffset=scopeName.
findRev(
"::",scopeOffset-1))==-1)
2745 }
while (scopeOffset>=0);
2749 std::vector<const MemberDef *> members;
2752 if (members.empty())
2758 if (members.size()!=1 && input.
args==
"()")
2764 for (
auto it = mn->
rbegin(); it!=mn->
rend(); ++it)
2766 const auto &mmd_p = *it;
2778 members.push_back(mmd);
2783 if (!members.empty())
2788 for (
const auto &rmd : members)
2790 if (rmd->getFileDef() && rmd->getFileDef()->name() == input.
currentFile->
name())
2798 result.
md = members.back();
2803 result.
md = members.back();
2813 result.
found =
true;
2827 printf(
"@@ ------ getDefsOld start\n");
2829 printf(
"@@ ------ getDefsOld end\n");
2830 printf(
"@@ ------ getDefsNew start\n");
2832 printf(
"@@ ------ getDefsNew end\n");
2834 result.
md!=newResult.
md ||
2835 result.
cd!=newResult.
cd ||
2836 result.
fd!=newResult.
fd ||
2837 result.
nd!=newResult.
nd ||
2838 result.
gd!=newResult.
gd
2841 printf(
"@@ getDefsOld(scName=%s, mbName=%s, args=%s, forceEmptyScope=%d "
2842 "currentFile=%s checkCV=%d)=%d md=%s (%p) cd=%s fd=%s nd=%s gd=%s\n",
2854 printf(
"@@ ------ getDefsOld start\n");
2855 printf(
"@@ getDefsNew(scName=%s, mbName=%s, args=%s, forceEmptyScope=%d "
2856 "currentFile=%s checkCV=%d)=%d md=%s (%p) cd=%s fd=%s nd=%s gd=%s\n",
2862 (
void*)newResult.
md,
2903 bool explicitGlobalScope=
FALSE;
2904 if (scopeName.
at(0)==
':' && scopeName.
at(1)==
':')
2907 explicitGlobalScope=
TRUE;
2915 int scopeOffset=explicitGlobalScope ? 0 :
static_cast<int>(docScopeName.
length());
2920 if (scopeOffset>0) fullName.
prepend(docScopeName.
left(scopeOffset)+
"::");
2944 else if ((scopeOffset=docScopeName.
findRev(
"::",scopeOffset-1))==-1)
2948 }
while (scopeOffset>=0);
2955 if (
s.isEmpty())
return true;
2956 const char *p=
s.data();
2958 while ((c=
static_cast<uint8_t
>(*p++)))
if (!islower(c))
return false;
2971 bool lookForSpecialization,
2976 AUTO_TRACE(
"scope={} name={} inSeeBlock={} lang={} lookForSpecialization={} currentFile={} checkScope={}",
2977 scName,name,inSeeBlock,lang,lookForSpecialization,currentFile ? currentFile->
name() :
"", checkScope);
2982 if (fullName.
find(
"anonymous_namespace{")==-1)
2992 if (lang==SrcLangExt::CSharp && (templStartPos=fullName.
find(
'<'))!=-1)
2994 int templEndPos = fullName.
findRev(
'>');
2995 if (templEndPos!=-1)
3003 int endNamePos=bracePos!=-1 ? bracePos :
static_cast<int>(fullName.
length());
3004 int scopePos=fullName.
findRev(
"::",endNamePos);
3005 bool explicitScope = fullName.
startsWith(
"::") &&
3010 bool allowTypeOnly=
false;
3013 *resContext=
nullptr;
3020 if (!inSeeBlock && scopePos==-1 &&
isLowerCase(tsName))
3034 if (scName!=fullName &&
getScopeDefs(scName,fullName,cd,cnd,nd,modd))
3057 else if (scName==fullName || (!inSeeBlock && scopePos==-1))
3076 if (explicitScope) nameStr=nameStr.
mid(2);
3081 if (bracePos!=-1) argsStr=fullName.
right(fullName.
length()-bracePos);
3085 int templPos=nameStr.
find(
'<');
3086 bool tryUnspecializedVersion =
FALSE;
3087 if (templPos!=-1 && nameStr.
find(
"operator")==-1)
3089 int endTemplPos=nameStr.
findRev(
'>');
3090 if (endTemplPos!=-1)
3092 if (!lookForSpecialization)
3094 nameStr=nameStr.
left(templPos)+nameStr.
right(nameStr.
length()-endTemplPos-1);
3098 tryUnspecializedVersion =
TRUE;
3106 nameStr=nameStr.
mid(scopeStr.
length()+2);
3132 *resContext=
nullptr;
3142 *resMember=result.
md;
3143 *resContext=result.
md;
3147 *resContext=
nullptr;
3153 else if (result.
cd) *resContext=result.
cd;
3154 else if (result.
nd) *resContext=result.
nd;
3155 else if (result.
fd) *resContext=result.
fd;
3156 else if (result.
gd) *resContext=result.
gd;
3157 else if (result.
cnd) *resContext=result.
cnd;
3158 else if (result.
modd) *resContext=result.
modd;
3161 *resContext=
nullptr; *resMember=
nullptr;
3188 else if (tsName.
find(
'.')!=-1)
3200 if (tryUnspecializedVersion)
3202 bool b =
resolveRef(scName,name,inSeeBlock,resContext,resMember,lang,
FALSE,
nullptr,checkScope);
3230 if (!isFileName && result.
find(
'<')==-1) result=
substitute(result,
".",
"::",3);
3232 if (result.
at(0)==
':' && result.
at(1)==
':')
3256 *resContext=
nullptr;
3259 if (lang==SrcLangExt::CSharp)
3264 AUTO_TRACE(
"scName='{}',ref='{}'",scName,lr);
3269 const DirDef *dir =
nullptr;
3287 if (si) resAnchor = si->
label();
3299 resAnchor = si->
label();
3306 resAnchor = si->
label();
3336 else if (lang==SrcLangExt::Java &&
3337 (cd=
getClass(linkRefWithoutTemplates)))
3344 else if ((cd=
getClass(linkRef+
"-p")))
3361 resAnchor=modd->
anchor();
3382 if (md) resAnchor=md->
anchor();
3420 if (n.
isEmpty())
return nullptr;
3423 const int maxAddrSize = 20;
3424 char addr[maxAddrSize];
3425 qsnprintf(addr,maxAddrSize,
"%p:",
reinterpret_cast<const void*
>(fnMap));
3434 ambig = cachedResult->
isAmbig;
3445 if (name.
isEmpty())
return nullptr;
3452 if (name.
isEmpty())
return nullptr;
3459 const std::unique_ptr<FileDef> &fd = fn->front();
3461 fd->getPath().right(path.
length())==path :
3463 if (path.
isEmpty() || isSamePath)
3465 cachedResult->
fileDef = fd.get();
3474 for (
const auto &fd_p : *fn)
3488 cachedResult->
isAmbig = ambig;
3489 cachedResult->
fileDef = lastMatch;
3519 for (
const auto &
s : examplePathList)
3553 path=name.
left(slashPos+1);
3560 for (
const auto &fd : *fn)
3562 if (path.
isEmpty() || fd->getPath().right(path.
length())==path)
3564 if (!first) result +=
"\n";
3566 result+=
" "+fd->absFilePath();
3577 std::string substRes;
3579 const char *p =
s.data();
3583 substRes.reserve(
s.length()+1024);
3590 for (
const auto &kw : keywords)
3592 size_t keyLen =
qstrlen(kw.keyword);
3593 if (
qstrncmp(p,kw.keyword,keyLen)==0)
3595 const char *startArg = p+keyLen;
3596 bool expectParam = std::holds_alternative<KeywordSubstitution::GetValueWithParam>(kw.getValueVariant);
3598 if (expectParam && *startArg==
'(')
3601 const char *endArg =
nullptr;
3602 while ((c=*(startArg+j)) && c!=
')' && c!=
'\n' && c!=0) j++;
3603 if (c==
')') endArg=startArg+j;
3607 auto &&getValue = std::get<KeywordSubstitution::GetValueWithParam>(kw.getValueVariant);
3608 substRes+=getValue(value).str();
3615 warn(file,
line,
"Missing argument for '{}'",kw.keyword);
3619 else if (!expectParam)
3621 auto &&getValue = std::get<KeywordSubstitution::GetValue>(kw.getValueVariant);
3622 substRes+=getValue().str();
3629 warn(file,
line,
"Expected arguments for '{}' but none were specified",kw.keyword);
3639 if (c==
'\n')
line++;
3667 int wi = projectLogo.
find(
" width=");
3670 projectLogo = projectLogo.
left(wi);
3672 int hi = projectLogo.
find(
" height=");
3675 projectLogo = projectLogo.
left(hi);
3688 auto extractDimension = [&projectLogo](
const char *startMarker,
size_t startPos,
size_t endPos) ->
QCString
3691 if (result.
length()>=2 && result.
at(0)!=
'"' && result.
at(result.
length()-1)!=
'"')
3693 result=
"\""+result+
"\"";
3699 int wi = projectLogo.
find(
" width=");
3700 int hi = projectLogo.
find(
" height=");
3701 if (wi!=-1 && hi!=-1)
3705 sizeVal = extractDimension(
" width=", wi+7, hi) +
" "
3706 + extractDimension(
" height=", hi+8, projectLogo.
length());
3710 sizeVal = extractDimension(
" height=", hi+8, wi) +
" "
3711 + extractDimension(
" width=", wi+7, projectLogo.
length());
3716 sizeVal = extractDimension(
" width=", wi+7, projectLogo.
length());
3720 sizeVal = extractDimension(
" height=", hi+8, projectLogo.
length());
3733 {
"$title", [&]() {
return !title.
isEmpty() ? title : projName; } },
3734 {
"$doxygenversion", [&]() {
return getDoxygenVersion(); } },
3735 {
"$projectname", [&]() {
return projName; } },
3736 {
"$projectnumber", [&]() {
return projNum; } },
3737 {
"$projectbrief", [&]() {
return projBrief; } },
3741 {
"$langISO", [&]() {
return theTranslator->trISOLang(); } },
3756 for (
const auto &
s : sl)
3758 const char *ps=
s.c_str();
3759 const char *pd=name.
data();
3761 while (*ps!=0 && *pd!=0 && *ps==*pd) ps++,pd++,
i++;
3762 if (*ps==0 && *pd!=0)
3778int getUtf8Char(
const char *input,
char ids[MAX_UTF8_CHAR_SIZE],CaseModifier modifier)
3781 const unsigned char uc = (
unsigned char)*input;
3782 bool validUTF8Char =
false;
3785 const char* pt = input+1;
3787 if ((uc&0x80)==0x00)
3791 case CaseModifier::None: ids[0]=*input;
break;
3792 case CaseModifier::ToUpper: ids[0]=(char)toupper(*input);
break;
3793 case CaseModifier::ToLower: ids[0]=(char)tolower(*input);
break;
3800 if ((uc&0xE0)==0xC0)
3804 if ((uc&0xF0)==0xE0)
3808 if ((uc&0xF8)==0xF0)
3813 validUTF8Char = l>0;
3814 for (
int m=1; m<l && validUTF8Char; ++m)
3816 unsigned char ct = (
unsigned char)*pt;
3817 if (ct==0 || (ct&0xC0)!=0x80)
3819 validUTF8Char=
false;
3840 if (caseSenseNames == CASE_SENSE_NAMES_t::YES)
return true;
3841 else if (caseSenseNames == CASE_SENSE_NAMES_t::NO)
return false;
3848 if (name.
isEmpty())
return name;
3853 const char *p=name.
data();
3858 case '_':
if (allowUnderscore) growBuf.
addChar(
'_');
else growBuf.
addStr(
"__");
break;
3859 case '-': growBuf.
addChar(
'-');
break;
3860 case ':': growBuf.
addStr(
"_1");
break;
3861 case '/': growBuf.
addStr(
"_2");
break;
3862 case '<': growBuf.
addStr(
"_3");
break;
3863 case '>': growBuf.
addStr(
"_4");
break;
3864 case '*': growBuf.
addStr(
"_5");
break;
3865 case '&': growBuf.
addStr(
"_6");
break;
3866 case '|': growBuf.
addStr(
"_7");
break;
3867 case '.':
if (allowDots) growBuf.
addChar(
'.');
else growBuf.
addStr(
"_8");
break;
3868 case '!': growBuf.
addStr(
"_9");
break;
3869 case ',': growBuf.
addStr(
"_00");
break;
3870 case ' ': growBuf.
addStr(
"_01");
break;
3871 case '{': growBuf.
addStr(
"_02");
break;
3872 case '}': growBuf.
addStr(
"_03");
break;
3873 case '?': growBuf.
addStr(
"_04");
break;
3874 case '^': growBuf.
addStr(
"_05");
break;
3875 case '%': growBuf.
addStr(
"_06");
break;
3876 case '(': growBuf.
addStr(
"_07");
break;
3877 case ')': growBuf.
addStr(
"_08");
break;
3878 case '+': growBuf.
addStr(
"_09");
break;
3879 case '=': growBuf.
addStr(
"_0a");
break;
3880 case '$': growBuf.
addStr(
"_0b");
break;
3881 case '\\': growBuf.
addStr(
"_0c");
break;
3882 case '@': growBuf.
addStr(
"_0d");
break;
3883 case ']': growBuf.
addStr(
"_0e");
break;
3884 case '[': growBuf.
addStr(
"_0f");
break;
3885 case '#': growBuf.
addStr(
"_0g");
break;
3886 case '"': growBuf.
addStr(
"_0h");
break;
3887 case '~': growBuf.
addStr(
"_0i");
break;
3888 case '\'': growBuf.
addStr(
"_0j");
break;
3889 case ';': growBuf.
addStr(
"_0k");
break;
3890 case '`': growBuf.
addStr(
"_0l");
break;
3894 bool doEscape =
true;
3895 if (allowUnicodeNames)
3900 growBuf.
addStr(p-1,charLen);
3908 unsigned char id =
static_cast<unsigned char>(c);
3917 else if (caseSenseNames || !isupper(c))
3924 growBuf.
addChar(
static_cast<char>(tolower(c)));
3930 return growBuf.
get();
3935 if (
s.isEmpty())
return s;
3938 const char *p =
s.data();
3948 case '_': result+=c; p++;
break;
3949 case '1': result+=
':'; p++;
break;
3950 case '2': result+=
'/'; p++;
break;
3951 case '3': result+=
'<'; p++;
break;
3952 case '4': result+=
'>'; p++;
break;
3953 case '5': result+=
'*'; p++;
break;
3954 case '6': result+=
'&'; p++;
break;
3955 case '7': result+=
'|'; p++;
break;
3956 case '8': result+=
'.'; p++;
break;
3957 case '9': result+=
'!'; p++;
break;
3961 case '0': result+=
','; p+=2;
break;
3962 case '1': result+=
' '; p+=2;
break;
3963 case '2': result+=
'{'; p+=2;
break;
3964 case '3': result+=
'}'; p+=2;
break;
3965 case '4': result+=
'?'; p+=2;
break;
3966 case '5': result+=
'^'; p+=2;
break;
3967 case '6': result+=
'%'; p+=2;
break;
3968 case '7': result+=
'('; p+=2;
break;
3969 case '8': result+=
')'; p+=2;
break;
3970 case '9': result+=
'+'; p+=2;
break;
3971 case 'a': result+=
'='; p+=2;
break;
3972 case 'b': result+=
'$'; p+=2;
break;
3973 case 'c': result+=
'\\'; p+=2;
break;
3974 case 'd': result+=
'@'; p+=2;
break;
3975 case 'e': result+=
']'; p+=2;
break;
3976 case 'f': result+=
'['; p+=2;
break;
3977 case 'g': result+=
'#'; p+=2;
break;
3978 case 'h': result+=
'"'; p+=2;
break;
3979 case 'i': result+=
'~'; p+=2;
break;
3980 case 'j': result+=
'\''; p+=2;
break;
3981 case 'k': result+=
';'; p+=2;
break;
3982 case 'l': result+=
'`'; p+=2;
break;
3989 if (!caseSenseNames && c>=
'a' && c<=
'z')
3991 result+=
static_cast<char>(toupper(*p));
4022 if (name.
isEmpty())
return name;
4045 size_t resultLen = result.
length();
4049 uint8_t md5_sig[16];
4051 MD5Buffer(result.
data(),
static_cast<unsigned int>(resultLen),md5_sig);
4052 MD5SigToString(md5_sig,sigStr);
4053 result=result.
left(128-32)+sigStr;
4058 int l1Dir=0,l2Dir=0;
4059 int createSubdirsLevel =
Config_getInt(CREATE_SUBDIRS_LEVEL);
4060 int createSubdirsBitmaskL2 = (1<<createSubdirsLevel)-1;
4063 uint8_t md5_sig[16];
4064 MD5Buffer(result.
data(),
static_cast<unsigned int>(result.
length()),md5_sig);
4065 l1Dir = md5_sig[14] & 0xf;
4066 l2Dir = md5_sig[15] & createSubdirsBitmaskL2;
4077 const int sig_size=16;
4078 uint8_t md5_sig[sig_size];
4079 MD5Buffer(fn.
data(),
static_cast<unsigned int>(fn.
length()),md5_sig);
4080 char result[sig_size*3+2];
4083 for (
int i=0;
i<sig_size;
i++)
4085 static const char oct[]=
"01234567";
4086 uint8_t
byte = md5_sig[
i];
4087 *p++=oct[(
byte>>6)&7];
4088 *p++=oct[(
byte>>3)&7];
4089 *p++=oct[(
byte>>0)&7];
4119 QCString absIncFileName = incFileName;
4129 else if (searchIncludes)
4132 for (
const auto &incPath : includePath)
4151 return absIncFileName;
4161 int createSubdirsLevelPow2 = 1 <<
Config_getInt(CREATE_SUBDIRS_LEVEL);
4162 for (
int l1=0; l1<16; l1++)
4168 term(
"Failed to create output directory '{}'\n",subdir);
4170 for (
int l2=0; l2<createSubdirsLevelPow2; l2++)
4173 subsubdir.
sprintf(
"d%x/d%02x",l1,l2);
4176 term(
"Failed to create output directory '{}'\n",subsubdir);
4188 int createSubdirsLevelPow2 = 1 <<
Config_getInt(CREATE_SUBDIRS_LEVEL);
4189 for (
int l1=0;l1<16;l1++)
4193 for (
int l2=0; l2 < createSubdirsLevelPow2; l2++)
4196 subsubdir.
sprintf(
"d%x/d%02x",l1,l2);
4215 bool allowEmptyClass)
4222 namespaceName=nd->
name();
4226 p=
static_cast<int>(clName.
length())-2;
4227 while (p>=0 && (
i=clName.
findRev(
"::",p))!=-1)
4234 namespaceName=nd->
name();
4243 className=scopeName;
4244 namespaceName.
clear();
4247 if (className.
isEmpty() && !namespaceName.
isEmpty() && !allowEmptyClass)
4250 className=namespaceName;
4251 namespaceName.
clear();
4257 className = className.
left(className.
length()-2);
4298 int l =
static_cast<int>(result.
length());
4301 bool skipBracket=
FALSE;
4308 while (p>=0 && count>=0)
4310 char c=result.
at(p);
4316 if (p>0 && result.
at(p-1)==
':' && (count==0 || skipBracket))
4318 return result.
right(l-p-1);
4329 if (p>0 && result.
at(p-1)==
'>')
4337 bool foundMatch=
false;
4338 while (p>=0 && !foundMatch)
4350 if (round==0) count++;
4357 if (result.
at(p-1) ==
'<')
4364 foundMatch = count==0;
4379 done = count==0 || skipBracket;
4390 if (
s.isEmpty())
return s;
4392 const char *p =
s.data();
4398 if ((c>=
'0' && c<=
'9') || (c>=
'a' && c<=
'z') || (c>=
'A' && c<=
'Z') || c==
'-')
4400 if (first && c>=
'0' && c<=
'9') growBuf.
addChar(
'a');
4406 encChar[1]=
hex[
static_cast<unsigned char>(c)>>4];
4407 encChar[2]=
hex[
static_cast<unsigned char>(c)&0xF];
4414 return growBuf.
get();
4423 if (
s.isEmpty())
return s;
4430 if (
s.isEmpty())
return s;
4432 const char *p =
s.data();
4438 case '<': growBuf.
addStr(
"<");
break;
4439 case '>': growBuf.
addStr(
">");
break;
4440 case '&':
if (keepEntities)
4446 if (ce==
';' || (!(
isId(ce) || ce==
'#')))
break;
4452 while (p<e) growBuf.
addChar(*p++);
4464 case '\'': growBuf.
addStr(
"'");
break;
4465 case '"': growBuf.
addStr(
""");
break;
4466 case 1:
case 2:
case 3:
case 4:
case 5:
case 6:
case 7:
case 8:
4467 case 11:
case 12:
case 13:
case 14:
case 15:
case 16:
case 17:
case 18:
4468 case 19:
case 20:
case 21:
case 22:
case 23:
case 24:
case 25:
case 26:
4469 case 27:
case 28:
case 29:
case 30:
case 31:
4471 default: growBuf.
addChar(c);
break;
4475 return growBuf.
get();
4481 if (
s.isEmpty())
return s;
4483 const char *p=
s.data();
4489 case '<': growBuf.
addStr(
"<");
break;
4490 case '>': growBuf.
addStr(
">");
break;
4491 case '&':
if (keepEntities)
4497 if (ce==
';' || (!(
isId(ce) || ce==
'#')))
break;
4503 while (p<e) growBuf.
addChar(*p++);
4515 case '\'': growBuf.
addStr(
"'");
break;
4516 case '"': growBuf.
addStr(
""");
break;
4519 uint8_t uc =
static_cast<uint8_t
>(c);
4520 if (uc<32 && !isspace(c))
4536 return growBuf.
get();
4541 if (
s.isEmpty())
return s;
4543 const char *p=
s.data();
4549 case '"':
if (!singleQuotes) growBuf.
addStr(
"\\\"");
else growBuf.
addChar(c);
4551 case '\'':
if (singleQuotes) growBuf.
addStr(
"\\\'");
else growBuf.
addChar(c);
4553 case '\\':
if (*p==
'u' && *(p+1)==
'{') growBuf.
addStr(
"\\");
4554 else growBuf.
addStr(
"\\\\");
4556 default: growBuf.
addChar(c);
break;
4567 std::string
s = str.
data();
4568 static const reg::Ex re(R
"(&\a\w*;)");
4573 size_t p=0,
i=0, l=0;
4574 for (; it!=
end ; ++it)
4576 const auto &match = *it;
4577 p = match.position();
4585 const char *code=
nullptr;
4599 return growBuf.
get();
4617 ASSERT(context!=
nullptr);
4619 if (ml==
nullptr)
return;
4621 struct MoveMemberInfo
4624 : memberDef(md), memberGroup(mg), sli(rv) {}
4629 std::vector<MoveMemberInfo> movedMembers;
4631 for (
const auto &md : *ml)
4633 if (md->isEnumerate())
4635 for (
const auto &fmd : md->enumFieldList())
4637 int groupId=fmd->getMemberGroupId();
4643 const auto &info = it->second;
4644 auto mg_it = std::find_if(pMemberGroups->begin(),
4645 pMemberGroups->end(),
4646 [&groupId](
const auto &g)
4647 { return g->groupId()==groupId; }
4650 if (mg_it==pMemberGroups->end())
4652 auto mg = std::make_unique<MemberGroup>(
4661 pMemberGroups->push_back(std::move(mg));
4665 mg_ptr = (*mg_it).get();
4677 int groupId=md->getMemberGroupId();
4683 const auto &info = it->second;
4684 auto mg_it = std::find_if(pMemberGroups->begin(),
4685 pMemberGroups->end(),
4686 [&groupId](
const auto &g)
4687 { return g->groupId()==groupId; }
4690 if (mg_it==pMemberGroups->end())
4692 auto mg = std::make_unique<MemberGroup>(
4701 pMemberGroups->push_back(std::move(mg));
4705 mg_ptr = (*mg_it).get();
4707 movedMembers.emplace_back(md,mg_ptr,info->m_sli);
4713 for (
const auto &mmi : movedMembers)
4715 ml->
remove(mmi.memberDef);
4716 mmi.memberGroup->insertMember(mmi.memberDef->resolveAlias());
4717 mmi.memberGroup->setRefItems(mmi.sli);
4733 static const reg::Ex re_norm(R
"(\a[\w:]*)");
4734 static const reg::Ex re_fortran(R
"(\a[\w:()=]*)");
4739 if (type.
isEmpty())
return -1;
4740 size_t typeLen=type.
length();
4743 if (lang == SrcLangExt::Fortran)
4745 if (type[pos]==
',')
return -1;
4751 std::string
s = type.
str();
4757 const auto &match = *it;
4758 size_t i = match.position();
4759 size_t l = match.length();
4764 while (ts<typeLen && type[
static_cast<uint32_t
>(ts)]==
' ') ts++,tl++;
4765 if (ts<typeLen && type[
static_cast<uint32_t
>(ts)]==
'<')
4770 while (te<typeLen && brCount!=0)
4772 if (type[
static_cast<uint32_t
>(te)]==
'<')
4774 if (te<typeLen-1 && type[
static_cast<uint32_t
>(te)+1]==
'<') te++;
else brCount++;
4776 if (type[
static_cast<uint32_t
>(te)]==
'>')
4778 if (te<typeLen-1 && type[
static_cast<uint32_t
>(te)+1]==
'>') te++;
else brCount--;
4788 pos=
static_cast<int>(
i+l+tl);
4792 pos=
static_cast<int>(
i+l);
4796 return static_cast<int>(
i);
4799 pos =
static_cast<int>(typeLen);
4811 int p=name.
find(
'<');
4812 if (p==-1)
return name;
4816 std::string
s = name.
mid(p).
str();
4817 static const reg::Ex re(R
"([\a:][\w:]*)");
4822 for (; it!=
end ; ++it)
4824 const auto &match = *it;
4825 size_t i = match.position();
4826 size_t l = match.length();
4827 result +=
s.substr(pi,
i-pi);
4830 for (
const Argument &formArg : formalArgs)
4832 if (formArg.name == n)
4858 result+=
s.substr(pi);
4876 if (formalArgs.
empty())
return nm;
4879 static const reg::Ex re(R
"(\a\w*)");
4880 std::string name = nm.str();
4885 for (; it!=
end ; ++it)
4887 const auto &match = *it;
4888 size_t i = match.position();
4889 size_t l = match.length();
4890 if (
i>p) result += name.substr(p,
i-p);
4895 actIt = actualArgs->
begin();
4902 for (
auto formIt = formalArgs.
begin();
4903 formIt!=formalArgs.
end() && !found;
4909 if (actualArgs && actIt!=actualArgs->
end())
4916 formArg.
type =
"class";
4921 formArg.
type =
"typename";
4925 formArg.
name +=
"...";
4930 formArg.
name +=
"...";
4937 if (formArg.
name==n && actualArgs && actIt!=actualArgs->
end() && !actArg.
type.
isEmpty())
4944 ii = subst.find(
'<');
4946 if (ii!=-1 &&
static_cast<int>(
prefix.length())>=ii+2 &&
prefix.mid(
prefix.length()-ii-2,ii+1)==subst.left(ii+1))
4951 while ((ii=subst.find(nameArg,pp))!=-1)
4953 bool beforeNonWord = ii==0 || !
isId(subst.at(ii-1));
4954 bool afterNonWord = subst.length()==ii+nameArg.length() || !
isId(subst.at(ii+nameArg.length()));
4955 if (beforeNonWord && afterNonWord)
4959 pp=ii+
static_cast<int>(nameArg.length());
4964 AUTO_TRACE_ADD(
"result={} n={} type={} hasRecursion={}",result,n,actArg.
type,hasRecursion(result,n,actArg.
type));
4965 if (!hasRecursion(result,n,actArg.
type))
4977 result += actArg.
type;
4983 result += actArg.
type+
" "+actArg.
name;
4988 else if (formArg.
name==n &&
4989 (actualArgs==
nullptr || actIt==actualArgs->
end()) &&
4998 else if (formArg.
name==n &&
4999 (actualArgs==
nullptr || actIt==actualArgs->
end()) &&
5007 if (actualArgs && actIt!=actualArgs->
end())
5018 result+=name.substr(p);
5036 bool allowArtificial)
5039 int i=fullName.
find(
'<');
5040 if (
i==-1)
return fullName;
5043 int l=
static_cast<int>(fullName.
length());
5050 while (e<l && count>0)
5052 char c=fullName.
at(e++);
5055 case '(': round++;
break;
5056 case ')':
if (round>0) round--;
break;
5057 case '<':
if (round==0) count++;
break;
5058 case '>':
if (round==0) count--;
break;
5063 int si= fullName.
find(
"::",e);
5065 if (parentOnly && si==-1)
break;
5068 result+=fullName.
mid(p,
i-p);
5071 if (cd!=
nullptr && (allowArtificial || !cd->
isArtificial()))
5073 result+=fullName.
mid(
i,e-
i);
5076 else if (pLastScopeStripped)
5079 *pLastScopeStripped=fullName.
mid(
i,e-
i);
5082 i=fullName.
find(
'<',p);
5084 result+=fullName.
right(l-p);
5101 AUTO_TRACE(
"leftScope='{}' rightScope='{}'",leftScope,rightScope);
5109 int i=0,p=
static_cast<int>(leftScope.
length());
5114 while ((
i=leftScope.
findRev(
"::",p))>0)
5118 result = leftScope.
left(
i+2)+rightScope;
5146 int sl=
static_cast<int>(
s.length());
5150 if (sp>=sl)
return -1;
5154 if (c==
':') sp++,p++;
else break;
5166 while (sp<sl && !done)
5172 case '<': count++;
break;
5173 case '>': count--;
if (count==0) done=
true;
break;
5206 bool newPage =
true;
5211 warn(fileName,startLine,
"multiple use of page label '{}' with different titles, (other occurrence: {}, line: {})",
5295 else if (si->
lineNr() != -1)
5297 warn(orgFile,
line,
"multiple use of section label '{}', (first occurrence: {}, line {})",pd->
name(),si->
fileName(),si->
lineNr());
5301 warn(orgFile,
line,
"multiple use of section label '{}', (first occurrence: {})",pd->
name(),si->
fileName());
5326 if (!key.
isEmpty() && key[0]!=
'@')
5331 item->setScope(scope);
5332 item->setName(name);
5333 item->setTitle(title);
5334 item->setArgs(args);
5335 item->setGroup(key);
5383 if (!first) { ol.
writeString(
" | "); }
else first=
false;
5395 if (!first) { ol.
writeString(
" | "); }
else first=
false;
5421 int i_fs = fName.
findRev(
'/');
5422 int i_bs = fName.
findRev(
'\\');
5423 int i = fName.
find(
'.',std::max({ i_fs, i_bs ,0}));
5448 printf(
"replaceNamespaceAliases(%s,%zu)\n",
qPrint(scope),
i);
5458 i=it->second.length();
5461 if (
i>0 && ns==scope.
left(
i))
break;
5463 printf(
"result=%s\n",
qPrint(scope));
5473 result=result.
mid(
i+1);
5478 result=result.
mid(
i+1);
5486 if (str.
isEmpty() || word==
nullptr)
return false;
5487 static const reg::Ex re(R
"(\a+)");
5488 std::string s = str.str();
5491 if (it->str()==word)
return true;
5502 static reg::Ex re(R
"(\s*(<\a+>)\s*)");
5503 std::string s = sentence.str();
5509 for ( ; it!=
end ; ++it)
5511 const auto match = *it;
5512 std::string part = match[1].str();
5515 size_t i = match.position();
5516 size_t l = match.length();
5517 result+=
s.substr(p,
i-p);
5518 result+=match.str();
5524 size_t i = match[1].position();
5525 size_t l = match[1].length();
5526 result+=
s.substr(p,
i-p);
5530 result+=
s.substr(p);
5546 const char *p =
s.data();
5549 int i=0,li=-1,l=
static_cast<int>(
s.length());
5553 if (c==
' ' || c==
'\t' || c==
'\r')
i++,p++;
5554 else if (c==
'\\' &&
literal_at(p,
"\\ilinebr"))
i+=8,li=
i,p+=8;
5555 else if (c==
'\n')
i++,li=
i,docLine++,p++;
5565 if (c==
' ' || c==
'\t' || c==
'\r') b--,p--;
5566 else if (c==
'r' && b>=7 &&
literal_at(p-7,
"\\ilinebr")) bi=b-7,b-=8,p-=8;
5567 else if (c==
'>' && b>=11 &&
literal_at(p-11,
"\\ilinebr<br>")) bi=b-11,b-=12,p-=12;
5568 else if (c==
'\n') bi=b,b--,p--;
5573 if (li==-1 && bi==-1)
return s;
5580 return s.mid(li,bi-li);
5598 {
"idl",
"c", SrcLangExt::IDL,
".idl" },
5599 {
"java",
"c", SrcLangExt::Java,
".java"},
5600 {
"javascript",
"c", SrcLangExt::JS,
".js" },
5601 {
"csharp",
"c", SrcLangExt::CSharp,
".cs" },
5602 {
"d",
"c", SrcLangExt::D,
".d" },
5603 {
"php",
"c", SrcLangExt::PHP,
".php" },
5604 {
"objective-c",
"c", SrcLangExt::ObjC,
".m" },
5605 {
"c",
"c", SrcLangExt::Cpp,
".c" },
5606 {
"c++",
"c", SrcLangExt::Cpp,
".cpp" },
5607 {
"slice",
"c", SrcLangExt::Slice,
".ice" },
5608 {
"python",
"python", SrcLangExt::Python,
".py" },
5609 {
"fortran",
"fortran", SrcLangExt::Fortran,
".f" },
5610 {
"fortranfree",
"fortranfree", SrcLangExt::Fortran,
".f90" },
5611 {
"fortranfixed",
"fortranfixed", SrcLangExt::Fortran,
".f" },
5612 {
"vhdl",
"vhdl", SrcLangExt::VHDL,
".vhdl"},
5613 {
"xml",
"xml", SrcLangExt::XML,
".xml" },
5614 {
"sql",
"sql", SrcLangExt::SQL,
".sql" },
5615 {
"md",
"md", SrcLangExt::Markdown,
".md" },
5616 {
"lex",
"lex", SrcLangExt::Lex,
".l" },
5623 [&langName](
const auto &info) { return info.langName==langName; });
5630 if (extName.
at(0)!=
'.') extName.
prepend(
".");
5640 err(
"Failed to assign extension {} to parser {} for language {}\n",
5641 extName.
data(),it1->parserName,language);
5729 if (extName.
isEmpty()) extName=
".no_extension";
5730 if (extName.
at(0)!=
'.') extName.
prepend(
".");
5746 if (lang == SrcLangExt::Unknown)
5750 if (langName.
at(0)==
'.') langName = langName.
mid(1);
5752 [&langName](
const auto &info) { return info.langName==langName; });
5755 lang = it->parserId;
5756 fileName = it->defExt;
5760 return SrcLangExt::Cpp;
5769 int lastDot = fn.
findRev(
'.');
5770 if (lastDot!=-1)
return fn.
mid(lastDot);
5779 if (scope==
nullptr ||
5799 if (qualifierIndex!=-1)
5801 explicitScopePart = name.
left(qualifierIndex);
5803 name = name.
mid(qualifierIndex+2);
5807 int minDistance = 10000;
5816 if (distance!=-1 && distance<minDistance)
5818 minDistance = distance;
5832 if (bestMatch && bestMatch->
isTypedef())
5840 if (startPos>=len)
return len;
5841 uint8_t c =
static_cast<uint8_t
>(utf8Str[startPos]);
5846 int (*matcher)(int) =
nullptr;
5847 c =
static_cast<uint8_t
>(utf8Str[startPos+bytes]);
5851 c =
static_cast<uint8_t
>(utf8Str[startPos+bytes]);
5855 matcher = std::isxdigit;
5859 matcher = std::isdigit;
5862 else if (std::isalnum(c))
5865 matcher = std::isalnum;
5869 while ((c =
static_cast<uint8_t
>(utf8Str[startPos+bytes]))!=0 && matcher(c))
5879 return startPos+bytes;
5893 auto astImpl =
dynamic_cast<const DocNodeAST*
>(ast.get());
5897 std::visit(visitor,astImpl->root);
5902 int l=
static_cast<int>(result.
length());
5906 if (charCnt>=80)
break;
5913 if (result.
at(
i)==
',' ||
5914 result.
at(
i)==
'.' ||
5915 result.
at(
i)==
'!' ||
5916 result.
at(
i)==
'?' ||
5924 if (
i < l) result=result.
left(
i)+
"...";
5925 return result.
data();
5944 auto astImpl =
dynamic_cast<const DocNodeAST*
>(ast.get());
5952 std::visit(visitor,astImpl->root);
5969 if (al.
empty())
return;
5991#ifdef TRACINGSUPPORT
5992 void *backtraceFrames[128];
5993 int frameCount = backtrace(backtraceFrames, 128);
5994 const size_t cmdLen = 40960;
5995 static char cmd[cmdLen];
5997 p +=
qsnprintf(p,cmdLen,
"/usr/bin/atos -p %d ", (
int)getpid());
5998 for (
int x = 0; x < frameCount; x++)
6000 p +=
qsnprintf(p,cmdLen,
"%p ", backtraceFrames[x]);
6002 fprintf(stderr,
"========== STACKTRACE START ==============\n");
6006 while (
size_t len = fread(resBuf, 1,
sizeof(resBuf), fp))
6008 fwrite(resBuf, 1, len, stderr);
6012 fprintf(stderr,
"============ STACKTRACE END ==============\n");
6021 if (
qstricmp(inputEncoding,outputEncoding)==0)
return;
6023 if (cd==
reinterpret_cast<void *
>(-1))
6025 term(
"unsupported character conversion: '{}'->'{}': {}\n"
6026 "Check the INPUT_ENCODING setting in the config file!\n",
6027 inputEncoding,outputEncoding,strerror(errno));
6029 size_t iLeft = contents.size();
6030 const char *srcPtr = contents.data();
6031 size_t tmpBufSize = contents.size()*4+1;
6032 size_t oLeft = tmpBufSize;
6034 tmpBuf.resize(tmpBufSize);
6035 char *dstPtr = tmpBuf.data();
6039 newSize = tmpBufSize-oLeft;
6040 tmpBuf.resize(newSize);
6041 std::swap(contents,tmpBuf);
6046 term(
"{}: failed to translate characters from {} to {}: check INPUT_ENCODING\n",
6047 fileName,inputEncoding,outputEncoding);
6059 if (filterName.
isEmpty() || !filter)
6064 err(
"could not open file {}\n",fileName);
6068 auto fileSize = fi.
size();
6069 contents.resize(fileSize);
6070 f.read(contents.data(),fileSize);
6073 err(
"problems while reading file {}\n",fileName);
6079 QCString cmd=filterName+
" \""+fileName+
"\"";
6084 err(
"could not execute filter {}\n",filterName);
6087 const int bufSize=4096;
6090 while ((numRead=
static_cast<int>(fread(buf,1,bufSize,f)))>0)
6093 contents.append(buf,numRead);
6100 if (contents.size()>=2 &&
6101 static_cast<uint8_t
>(contents[0])==0xFF &&
6102 static_cast<uint8_t
>(contents[1])==0xFE
6107 else if (contents.size()>=2 &&
6108 static_cast<uint8_t
>(contents[0])==0xFE &&
6109 static_cast<uint8_t
>(contents[1])==0xFF
6114 else if (contents.size()>=3 &&
6115 static_cast<uint8_t
>(contents[0])==0xEF &&
6116 static_cast<uint8_t
>(contents[1])==0xBB &&
6117 static_cast<uint8_t
>(contents[2])==0xBF
6120 contents.erase(0,3);
6136 std::string t = title.
str();
6137 static const reg::Ex re(R
"(%[a-z_A-Z]+)");
6141 for (; it!=
end ; ++it)
6143 const auto &match = *it;
6144 size_t i = match.position();
6145 size_t l = match.length();
6146 if (
i>p) tf+=t.substr(p,
i-p);
6147 tf+=match.str().substr(1);
6156template<
class PatternList,
class PatternElem,
typename PatternGet = QCString(*)(const PatternElem &)>
6158 const PatternList &patList,
6165 if (!patList.empty())
6171 for (
const auto &li : patList)
6173 std::string pattern = getter(li).str();
6174 if (!pattern.empty())
6176 size_t i=pattern.find(
'=');
6177 if (
i!=std::string::npos) pattern=pattern.substr(0,
i);
6179 if (!caseSenseNames)
6210 auto getter = [](std::string
s) {
return QCString(
s); };
6231 if (extLinksInWindow)
6232 return "target=\"_blank\" ";
6234 return "target=\"_parent\" ";
6251 if (!targetFileName.
isEmpty())
6256 if (!anchor.
isEmpty() && isLocalFile)
6267 if (!anchor.
isEmpty()) url+=
"#"+anchor;
6280 result = it->second;
6281 size_t l = result.
length();
6282 if (!relPath.
isEmpty() && l>0 && result.
at(0)==
'.')
6287 if (l>0 && result.
at(l-1)!=
'/') result+=
'/';
6288 if (!href) result.
append(
"\" ");
6311 if (!img.
save(fileName))
6313 fprintf(stderr,
"Warning: Cannot open file %s for writing\n",
data->name);
6329 std::string
s=str.
str();
6330 static const reg::Ex re(R
"(##[0-9A-Fa-f][0-9A-Fa-f])");
6336 size_t sl=
s.length();
6338 for (; it!=
end ; ++it)
6340 const auto &match = *it;
6341 size_t i = match.position();
6342 size_t l = match.length();
6343 if (
i>p) result+=
s.substr(p,
i-p);
6344 std::string lumStr = match.str().substr(2);
6345#define HEXTONUM(x) (((x)>='0' && (x)<='9') ? ((x)-'0') : \
6346 ((x)>='a' && (x)<='f') ? ((x)-'a'+10) : \
6347 ((x)>='A' && (x)<='F') ? ((x)-'A'+10) : 0)
6349 double r = 0,g = 0,b = 0;
6352 pow(level/255.0,gamma/100.0),&r,&g,&b);
6353 int red =
static_cast<int>(r*255.0);
6354 int green =
static_cast<int>(g*255.0);
6355 int blue =
static_cast<int>(b*255.0);
6358 colStr[1]=
hex[red>>4];
6359 colStr[2]=
hex[red&0xf];
6360 colStr[3]=
hex[green>>4];
6361 colStr[4]=
hex[green&0xf];
6362 colStr[5]=
hex[blue>>4];
6363 colStr[6]=
hex[blue&0xf];
6369 if (p<sl) result+=
s.substr(p);
6380 err(
"could not copy file {} to {}\n",src,dest);
6394 int m1 = text.
find(marker);
6395 if (m1==-1)
return result;
6400 while (!found && (
i=text.
find(
'\n',p))!=-1)
6402 found = (p<=m1 && m1<
i);
6418 if (lang==SrcLangExt::Java || lang==SrcLangExt::CSharp || lang==SrcLangExt::VHDL || lang==SrcLangExt::Python)
6422 else if (lang==SrcLangExt::PHP && !classScope)
6434 static const std::unordered_set<std::string> schemes = {
6435 "http",
"https",
"ftp",
"ftps",
"sftp",
"file",
"news",
"irc",
"ircs"
6438 int colonPos = loc_url.
find(
':');
6439 return colonPos!=-1 && schemes.find(loc_url.
left(colonPos).
str())!=schemes.end();
6461 return (prot!=Protection::Private && prot!=Protection::Package) ||
6462 (prot==Protection::Private && extractPrivate) ||
6463 (prot==Protection::Package && extractPackage);
6470 if (
s.isEmpty())
return s;
6474 const char *p=
s.data();
6477 int minIndent=1000000;
6478 bool searchIndent=
true;
6480 bool skipFirst = skipFirstLine;
6483 if (c==
'\t') indent+=tabSize - (indent%tabSize);
6484 else if (c==
'\n') indent=0,searchIndent=
true,skipFirst=
false;
6485 else if (c==
' ') indent++;
6486 else if (searchIndent && !skipFirst)
6489 if (indent<minIndent) minIndent=indent;
6494 if (minIndent==0)
return substitute(
s,
"@ilinebr",
"\\ilinebr");
6500 skipFirst=skipFirstLine;
6509 else if (indent<minIndent && !skipFirst)
6513 int newIndent = indent+tabSize-(indent%tabSize);
6527 else if (c==
'\\' &&
literal_at(p,
"ilinebr "))
6530 result <<
"\\ilinebr ";
6533 for (
int j=0;j<minIndent;j++)
if (*(p+j)==
' ') skipAmount++;
6534 if (skipAmount==minIndent)
6541 result <<
"\\ilinebr";
6552 return result.
str();
6559 if (indentationLevel <= 0 || doc.
isEmpty())
return;
6564 const char *src = doc.
data();
6566 bool insideIndent =
false;
6575 insideIndent =
true;
6576 cnt = indentationLevel;
6587 insideIndent =
false;
6597 insideIndent =
false;
6602 doc.
resize(
static_cast<uint32_t
>(dst-doc.
data()));
6611 return ( ((allExternals && fd->
isLinkable()) ||
6629uint32_t getUtf8Code(
const QCString&
s,
int idx )
6631 const int length =
s.length();
6632 if (idx >= length) {
return 0; }
6633 const uint32_t c0 = (uint8_t)
s.at(idx);
6634 if ( c0 < 0xC2 || c0 >= 0xF8 )
6638 if (idx+1 >= length) {
return 0; }
6639 const uint32_t c1 = ((uint8_t)
s.at(idx+1)) & 0x3f;
6642 return ((c0 & 0x1f) << 6) | c1;
6644 if (idx+2 >= length) {
return 0; }
6645 const uint32_t c2 = ((uint8_t)
s.at(idx+2)) & 0x3f;
6648 return ((c0 & 0x0f) << 12) | (c1 << 6) | c2;
6650 if (idx+3 >= length) {
return 0; }
6652 const uint32_t c3 = ((uint8_t)
s.at(idx+3)) & 0x3f;
6653 return ((c0 & 0x07) << 18) | (c1 << 12) | (c2 << 6) | c3;
6665uint32_t getUtf8CodeToLower(
const QCString&
s,
int idx )
6667 const uint32_t v = getUtf8Code(
s, idx );
6668 return v < 0x7f ? tolower( v ) : v;
6680uint32_t getUtf8CodeToUpper(
const QCString&
s,
int idx )
6682 const uint32_t v = getUtf8Code(
s, idx );
6683 return v < 0x7f ? toupper( v ) : v;
6697 std::string
s = docs.
str();
6698 static const reg::Ex re(R
"(\[([ inout,]+)\])");
6703 const auto &match = *it;
6704 size_t p = match.position();
6705 size_t l = match.length();
6709 std::string dir = match[1].str();
6711 dir.erase(std::remove_if(dir.begin(),dir.end(),
6712 [](
const char c) { return c==
' ' || c==
','; }
6714 unsigned char ioMask=0;
6715 size_t inIndex = dir.find(
"in");
6716 if ( inIndex!=std::string::npos) dir.erase( inIndex,2),ioMask|=(1<<0);
6717 size_t outIndex = dir.find(
"out");
6718 if (outIndex!=std::string::npos) dir.erase(outIndex,3),ioMask|=(1<<1);
6719 if (dir.empty() && ioMask!=0)
6722 if (ioMask==((1<<0)|(1<<1)))
return "[in,out]";
6723 else if (ioMask==(1<<0))
return "[in]";
6724 else if (ioMask==(1<<1))
return "[out]";
6756 *outListType1=inListType;
6759 if (inProt==Protection::Public)
6766 else if (inProt==Protection::Protected)
6774 *outListType2=inListType.
toPublic();
6777 else if (inProt==Protection::Private)
6787 *outListType1=inListType.
toPublic();
6809 int i= imgExt.
find(
':');
6810 return i==-1 ? imgExt : imgExt.
left(
i);
6815 assert(!f.is_open());
6816 bool fileOpened=
FALSE;
6817 bool writeToStdout=outFile==
"-";
6820 f.basic_ios<char>::rdbuf(std::cout.rdbuf());
6835 fileOpened = f.is_open();
6842 static const std::unordered_set<std::string> fortran_C_keywords = {
6843 "character",
"call",
"close",
"common",
"continue",
6844 "case",
"contains",
"cycle",
"class",
"codimension",
6845 "concurrent",
"contiguous",
"critical"
6848 if (*contents !=
'c' && *contents !=
'C')
return false;
6850 const char *c = contents;
6852 while (*c && *c !=
' ') {keyword += *c; c++;}
6853 keyword = keyword.
lower();
6855 return (fortran_C_keywords.find(keyword.
str()) != fortran_C_keywords.end());
6863 bool skipLine=
FALSE;
6869 size_t sizCont = contents.
length();
6870 for (
size_t i=0;
i<sizCont;
i++)
6874 switch(contents.
at(
i))
6881 column += tabSize-1;
6898 if (column==1)
return TRUE;
6899 if (skipLine)
break;
6902 if (column!=6) skipLine=
TRUE;
6905 if (skipLine)
break;
6906 if (column>=7)
return TRUE;
6928 if (
s.isEmpty())
return s;
6931 auto skipBlock = [&markerInfo](
const char *p,
const SelectionBlock &blk)
6938 size_t len = markerInfo.
endLen;
6939 bool negate = *(p+markerInfo.
endLen)==
'!';
6941 size_t blkNameLen =
qstrlen(blk.name);
6942 if (
qstrncmp(p+len,blk.name,blkNameLen)==0 &&
6946 return p+len+blkNameLen+markerInfo.
closeLen;
6963 const char *p =
s.data();
6973 bool negate = *(p+len)==
'!';
6975 for (
const auto &blk : blockList)
6977 size_t blkNameLen =
qstrlen(blk.name);
6978 if (
qstrncmp(p+len,blk.name,blkNameLen)==0 &&
6981 bool blockEnabled = blk.enabled!=negate;
6983 p+=len+blkNameLen+markerInfo.
closeLen;
7002 size_t len = markerInfo.
endLen;
7003 bool negate = *(p+len)==
'!';
7005 for (
const auto &blk : blockList)
7007 size_t blkNameLen =
qstrlen(blk.name);
7008 if (
qstrncmp(p+len,blk.name,blkNameLen)==0 &&
7012 p+=len+blkNameLen+markerInfo.
closeLen;
7041 if (
s.isEmpty())
return;
7043 const char *p =
s.data();
7052 bool negate = *(p+len)==
'!';
7058 if (markerInfo.
closeLen==0 && *p==
'\n')
7060 warn(fileName,-1,
"Remaining begin replacement with marker '{}'",marker);
7066 warn(fileName,-1,
"Remaining begin replacement with marker '{}'",marker);
7075 size_t len = markerInfo.
endLen;
7076 bool negate = *(p+len)==
'!';
7082 if (markerInfo.
closeLen==0 && *p==
'\n')
7084 warn(fileName,-1,
"Remaining end replacement with marker '{}'",marker);
7090 warn(fileName,-1,
"Remaining end replacement with marker '{}'",marker);
7106 out.reserve(
s.length());
7107 const char *p=
s.data();
7116 while (*e==
' ' || *e==
'\t') e++;
7138 size_t prev = 0, pos = 0, len =
s.length();
7141 pos =
s.find(delimiter, prev);
7142 if (pos == std::string::npos) pos = len;
7143 if (pos>prev) result.push_back(
s.substr(prev,pos-prev));
7144 prev = pos + delimiter.length();
7146 while (pos<len && prev<len);
7158 for ( ; iter !=
end; ++iter)
7160 const auto &match = *iter;
7161 size_t i=match.position();
7162 size_t l=match.length();
7163 if (
i>p) result.push_back(
s.substr(p,
i-p));
7166 if (p<
s.length()) result.push_back(
s.substr(p));
7173 auto it = std::find(sv.begin(),sv.end(),
s);
7174 return it!=sv.end() ?
static_cast<int>(it-sv.begin()) : -1;
7182 return reg::search(
s,match,re) ?
static_cast<int>(match.position()) : -1;
7190 for (
const auto &
s : sv)
7192 if (!first) result+=delimiter;
7206 while (residual > 0)
7208 modVal[0] = (upper ?
'A':
'a') + (residual-1)%26;
7209 result = modVal + result;
7210 residual = (residual-1) / 26;
7217 static const char *str_romans_upper[] = {
"M",
"CM",
"D",
"CD",
"C",
"XC",
"L",
"XL",
"X",
"IX",
"V",
"IV",
"I" };
7218 static const char *str_romans_lower[] = {
"m",
"cm",
"d",
"cd",
"c",
"xc",
"l",
"xl",
"x",
"ix",
"v",
"iv",
"i" };
7219 static const int values[] = { 1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1 };
7220 static const char **str_romans = upper ? str_romans_upper : str_romans_lower;
7225 for (
int i = 0;
i < 13; ++
i)
7227 while (residual - values[
i] >= 0)
7229 result += str_romans[
i];
7230 residual -= values[
i];
7240 size_t size =
s.length();
7242 const char *
data =
s.data();
7245 constexpr auto doxy_nbsp =
"&_doxy_nbsp;";
7246 const int maxIndent=1000000;
7247 int minIndent=maxIndent;
7256 int stop = tabSize - (col%tabSize);
7259 while (stop--)
out.addChar(
' ');
7263 if (
data[
i] ==
'\\')
7300 out.addStr(doxy_nbsp);
7306 for (
int j=0;j<bytes-1 && c;j++)
7318 if (!skip && col<minIndent) minIndent=col;
7322 if (minIndent!=maxIndent) refIndent=minIndent;
else refIndent=0;
7332 uint8_t md5_sig[16];
7334 MD5Buffer(projectCookie.
data(),
static_cast<unsigned int>(projectCookie.
length()),md5_sig);
7335 MD5SigToString(md5_sig,sigStr);
7336 sigStr[32]=
'_'; sigStr[33]=0;
7343 int l =
static_cast<int>(name.
length());
7344 int lastSepPos = -1;
7345 const char *p = name.
data();
7354 if (sharpCount==0 && p[
i+1]==
':' && p[
i+2]==
':')
7368 if (ts==-1) ts=0;
else p+=++ts;
7369 for (
i=ts;
i<l-1;
i++)
7372 if (c==
':' && *p==
':') lastSepPos=
i;
7407 case '\t': col+=tabSize - (col%tabSize);
7416 for (
int i=0;
i<numBytes-1 && (c=*
s++);
i++) {}
7417 if (c==0)
return col;
7432 int idx = name.
find(
'<');
7445 int idx = result.
find(
'-');
7446 result = result.
left(idx)+templArgs;
7454 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 const QCString & localName() 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 isEmpty(const std::string subdir) const
bool mkdir(const std::string &path, bool acceptsAbsPath=true) const
bool remove(const std::string &path, bool acceptsAbsPath=true) 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 NamespaceAliasInfoMap namespaceAliasMap
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 isForeign() 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 const MemberVector & enumFieldList() const =0
virtual bool hasCallGraph() const =0
virtual const FileDef * getFileDef() const =0
virtual const ArgumentList & argumentList() const =0
virtual bool isStrongEnumValue() const =0
virtual bool isStatic() const =0
virtual bool hasInlineSource() const =0
virtual MemberDef * resolveAlias()=0
virtual bool hasEnumValues() const =0
virtual bool isDefine() 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 bool isStrong() const =0
virtual QCString argsString() const =0
virtual const MemberDef * getEnumScope() 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 isProtected() const
MemberListType toProtected() const
MemberListType toPublic() const
static MemberListType Invalid()
constexpr bool isPrivate() const
ML_TYPES constexpr bool isPublic() const
reverse_iterator rbegin()
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 startConstraintDocs()
void startConstraintType()
void pushGeneratorState()
void disableAllBut(OutputType o)
void endConstraintParam()
void startConstraintList(const QCString &header)
void generateDoc(const QCString &fileName, int startLine, const Definition *ctx, const MemberDef *md, const QCString &docStr, bool indexWords, bool isExample, const QCString &exampleName, bool singleLine, bool linkFromIndex, bool markdownSupport=Config_getBool(MARKDOWN_SUPPORT), bool autolinkSupport=Config_getBool(AUTOLINK_SUPPORT))
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.
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.
int minClassDistance(const ClassDef *cd, const ClassDef *bcd, int level)
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, bool indexWords, bool isExample, const QCString &exampleName, bool singleLine, bool linkFromIndex, bool markdownSupport, bool autolinkSupport)
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.
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 const char * to_string(Protection prot)
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)
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)
const int maxInheritanceDepth
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
static void stripIrrelevantString(QCString &target, const QCString &str)
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)
GetDefResult getDefsOld(const GetDefInput &input)
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 QCString extractCanonicalType(const Definition *d, const FileDef *fs, QCString type, SrcLangExt lang)
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 matchArguments2(const Definition *srcScope, const FileDef *srcFileScope, const ArgumentList *srcAl, const Definition *dstScope, const FileDef *dstFileScope, const ArgumentList *dstAl, bool checkCV, SrcLangExt lang)
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)
void stripIrrelevantConstVolatile(QCString &s)
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[]
GetDefResult getDefsNew(const GetDefInput &input)
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 findMembersWithSpecificName(const MemberName *mn, const QCString &args, bool checkStatics, const FileDef *currentFile, bool checkCV, std::vector< const MemberDef * > &members)
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 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)
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