22#include <unordered_map>
120#pragma GCC diagnostic push
121#pragma GCC diagnostic ignored "-Wshadow"
123#include <clang/Basic/Version.h>
125#pragma GCC diagnostic pop
132#if !defined(_WIN32) || defined(__CYGWIN__)
200{
"template class",
"template struct",
"class",
"struct",
"union",
"interface",
"exception" };
237 stats.emplace_back(name,0);
238 startTime = std::chrono::steady_clock::now();
242 std::chrono::steady_clock::time_point endTime = std::chrono::steady_clock::now();
243 stats.back().elapsed =
static_cast<double>(std::chrono::duration_cast<
244 std::chrono::microseconds>(endTime -
startTime).count())/1000000.0;
255 msg(
"----------------------\n");
256 for (
const auto &s :
stats)
258 msg(
"Spent {:.6f} seconds in {}",s.elapsed,s.name);
321 scope+=
"::"+pd->
name();
364 ((!includeExternal && root->
tagInfo()==
nullptr) ||
365 ( includeExternal && root->
tagInfo()!=
nullptr))
368 AUTO_TRACE(
"additional={} includeExternal={}",additional,includeExternal);
384 "group {}: ignoring title \"{}\" that does not match old title \"{}\"",
404 std::unique_ptr<GroupDef>(
411 std::unique_ptr<GroupDef>(
461 scope+=
"::"+gd->
name();
513 bool save_ambig = ambig;
517 size_t newIndex=fn.
rfind(
'/');
524 fn = fn.
left(newIndex)+
"/"+root->
name;
527 if (!fd) ambig = save_ambig;
558 "Found non-existing group '{}' for the command '{}', ignoring command",
567 text.
sprintf(
"the name '%s' supplied as "
568 "the argument in the \\file statement ",
572 text+=
"matches the following input files:\n";
575 text+=
"Please use a more specific name by "
576 "including a (larger) part of the path!";
580 text+=
"is not an input file";
588template<
class DefMutable>
602 if (!includeFile.
empty() && includeFile.
at(0)==
'"')
605 includeFile=includeFile.
mid(1,includeFile.
length()-2);
607 else if (!includeFile.
empty() && includeFile.
at(0)==
'<')
610 includeFile=includeFile.
mid(1,includeFile.
length()-2);
617 if (!includeFile.
empty() &&
622 text.
sprintf(
"the name '%s' supplied as "
623 "the argument of the \\class, \\struct, \\union, or \\include command ",
628 text+=
"matches the following input files:\n";
631 text+=
"Please use a more specific name by "
632 "including a (larger) part of the path!";
636 text+=
"is not an input file";
640 else if (includeFile.
empty() && ifd &&
654 if (iName.
at(0)==
'<') local=
false;
655 else if (iName.
at(0)==
'"') local=
true;
656 if (iName.
at(0)==
'"' || iName.
at(0)==
'<')
679 cd->setIncludeFile(
nullptr,iName,local,
true);
692 for (
size_t i=0;i<l;i++)
696 else if (c==
')' && round>0) round--;
697 else if (c==
'<' && round==0) count++;
702 if (c==
'>' && round==0 && count>0) count--;
725 if (idx==-1)
return prevScope;
727 if (nsName.
empty())
return prevScope;
728 if (!fullScope.
empty()) fullScope+=
"::";
733 if (nd==
nullptr) cd =
getClass(fullScope);
734 if (nd==
nullptr && cd)
746 "[generated]",1,1,fullScope,
764 if (prevScopeMutable)
796 int p=i1+l1,l2=0,i2=0;
799 DString nestedNameSpecifier = scope.
mid(i1,l1);
804 if (resultScope==
nullptr)
815 if (resultScope!=
nullptr)
break;
874 auto alIt = tArgLists.begin();
891 return alIt!=tArgLists.end() ?
892 std::make_unique<ArgumentList>(*alIt) :
893 std::unique_ptr<ArgumentList>();
901 if (specifier.isStruct())
903 else if (specifier.isUnion())
905 else if (specifier.isCategory())
907 else if (specifier.isInterface())
909 else if (specifier.isProtocol())
911 else if (specifier.isException())
913 else if (specifier.isService())
915 else if (specifier.isSingleton())
918 if (section.isUnionDoc())
920 else if (section.isStructDoc())
922 else if (section.isInterfaceDoc())
924 else if (section.isProtocolDoc())
926 else if (section.isCategoryDoc())
928 else if (section.isExceptionDoc())
930 else if (section.isServiceDoc())
932 else if (section.isSingletonDoc())
960 DString qualifiedName = fullName;
963 qualifiedName.
prepend(scName+
"::");
969 AUTO_TRACE_ADD(
"Found class with name '{}', qualifiedName '{}'", cd ? cd->
name() : root->
name, qualifiedName);
1024 AUTO_TRACE_ADD(
"New class: fullname '{}' namespace '{}' name='{}' brief='{}' docs='{}'",
1041 std::unique_ptr<ArgumentList> tArgList;
1043 if ((root->
lang==SrcLangExt::CSharp || root->
lang==SrcLangExt::Java) &&
1058 fullName=fullName.
left(i);
1069 fullName,sec,tagName,refFileName,
true,root->
spec.isEnum()) ));
1072 AUTO_TRACE_ADD(
"New class '{}' type={} #tArgLists={} tagInfo={} hidden={} artificial={}",
1109 AUTO_TRACE_ADD(
"Class {} not added, already exists as alias", fullName);
1117 if (!root->
spec.isForwardDecl())
1179 qualifiedName.
prepend(scName+
"::");
1185 AUTO_TRACE_ADD(
"Found concept with name '{}' (qualifiedName='{}')", cd ? cd->
name() : root->
name, qualifiedName);
1189 qualifiedName=cd->
name();
1203 AUTO_TRACE_ADD(
"New concept: fullname '{}' namespace '{}' name='{}' brief='{}' docs='{}'",
1204 qualifiedName,namespaceName,className,root->
brief,root->
doc);
1225 qualifiedName,tagName,refFileName)));
1229 qualifiedName,root->
tArgLists.size(),fmt::ptr(tagInfo));
1260 for (
const auto &ce : root->
children())
1263 if (ce->section.isConceptDocPart())
1268 if (!ce->brief.empty())
1270 cd->
addDocPart(ce->brief,ce->startLine,ce->startColumn);
1273 if (!ce->doc.empty())
1275 cd->
addDocPart(ce->doc,ce->startLine,ce->startColumn);
1279 else if (ce->section.isConceptCodePart())
1281 cd->
addCodePart(ce->initializer.str(),ce->startLine,ce->startColumn);
1288 AUTO_TRACE_ADD(
"Concept '{}' not added, already exists (as alias)", qualifiedName);
1295 for (
const auto &ce : root->
children())
1297 if (ce->section.isConceptDocPart())
1317 if (root->
section.isModuleDoc())
1327 if (root->
section.isConcept())
1337 if (root->
section.isConceptDoc())
1356 if (cd!=ocd && cd->groupId()==ocd->groupId() &&
1357 !cd->partOfGroups().empty() && ocd->partOfGroups().empty())
1362 for (
const auto &gd : cd->partOfGroups())
1368 gd->addConcept(ocd.get());
1393 aliasFullName(name),aliasCd(std::move(cd)), aliasContext(ctx) {}
1395 std::unique_ptr<ClassDef> aliasCd;
1398 std::vector<ClassAlias> aliases;
1402 if (cd && visitedClasses.find(icd.get())==visitedClasses.end())
1408 name,icd->getFileDef(),
nullptr);
1434 aliases.emplace_back(aliasFullName,std::move(aliasCd),dm);
1445 visitedClasses.insert(icd.get());
1455 for (
auto &alias : aliases)
1460 alias.aliasContext->addInnerCompound(aliasCd);
1469 if (cd && visitedClasses.find(icd.get())==visitedClasses.end())
1487 "Incomplete input: scope for class {} not found!{}",name,
1488 name.
startsWith(
"std::") ?
" Try enabling BUILTIN_STL_SUPPORT." :
""
1506 if (visitedClasses.find(cd.get())==visitedClasses.end() && !cd->partOfGroups().empty())
1510 for (
auto &ncd : cd->getClasses())
1521 visitedClasses.insert(cd.get());
1528template<
typename Container>
1530 const Container *cd,
1536 MemberList *eiml = cd->getMemberList(mlFilter);
1539 for (
const auto &eimd : *eiml)
1541 DString vtype = eimd->typeString();
1562 const char *p = n.
data()+sn;
1566 if (!isdigit(c) && c!=
'@' && c!=
':')
break;
1572 DString fullName = n+
"."+fieldName;
1601 else if (outerScope)
1616 auto newMd =
createMemberDef(md->getDefFileName(),md->getDefLine(),md->getDefColumn(),
1617 md->typeString(),md->name(),md->argsString(),md->excpString(),
1618 md->protection(),md->virtualness(),md->isStatic(),Relationship::Member,
1628 imd->
setId(md->id());
1649 for (
const auto &md : *ml)
1658 for (
const auto &md : *ml)
1662 if (md->isEnumerate() && md->name().startsWith(
"@"))
1664 for (
const auto &emd : md->enumFieldList())
1687template<
typename Container,
typename TagContainer>
1689 const Container *cd,
1690 const TagContainer *tagParent,
1695 AUTO_TRACE(
"count={} name={}\n",count,cd->name());
1698 MemberList *ml = cd->getMemberList(varFilter);
1702 for (
const auto &md : *ml)
1704 DString type = md->typeString();
1709 std::vector<const ClassDef *> candidates;
1710 for (
const auto &icd : cd->getClasses())
1712 candidates.push_back(icd);
1714 for (
const auto &icd : candidates)
1720 if (md->isAnonymous()) name =
"__unnamed" +
DString().
setNum(pos++)+
"__";
1726 processTagLessClasses(ncd,icd,ncd,MemberListType::PubAttribs(),MemberListType::PubTypes(),name,count+1);
1731 MemberList *pml = tagParent->getMemberList(varFilter);
1734 for (
const auto &pmd : *pml)
1737 if (pmdm && pmd->
name()==md->name())
1754 ml = cd->getMemberList(typeFilter);
1757 for (
const auto &md : *ml)
1766template<
typename Container>
1769 for (
const auto &icd : cd->getClasses())
1777 candidates.insert(cd);
1782 std::set<const Definition *> candidates;
1792 const FileDef *fd = cd->getFileDef();
1807 for (
const auto &d : candidates)
1813 processTagLessClasses(nd,nd,nd,MemberListType::DecVarMembers(),MemberListType::DecEnumMembers(),
"",0);
1818 processTagLessClasses(fd,fd,fd,MemberListType::DecVarMembers(),MemberListType::DecEnumMembers(),
"",0);
1835 (root->
section.isNamespace() ||
1836 root->
section.isNamespaceDoc() ||
1845 if (root->
section.isPackageDoc())
1851 if (!fullName.
empty())
1909 root->
type,root->
spec.isPublished())));
1976 DString aliasName = aliasNd->name();
2005 for (
auto &und : unl)
2007 DString uScope=und->name()+
"::";
2009 if (usingNd!=
nullptr)
break;
2016 if (root->
section.isUsingDir())
2034 (fd==
nullptr || fd->
getLanguage()!=SrcLangExt::Java)
2038 if (!nsName.
empty())
2048 int scopeOffset =
static_cast<int>(nsName.
length());
2061 size_t o = nsName.
rfind(
"::",scopeOffset-1);
2064 }
while (scopeOffset>=0 && usingNd==
nullptr);
2066 if (usingNd==
nullptr && nd)
2070 while (pnd && usingNd==
nullptr)
2087 if (usingNd==
nullptr && fd)
2160 if (root->
section.isUsingDecl() &&
2173 if (root->
section.isUsingDecl() &&
2175 (!filterPythonPackages || (root->
lang==SrcLangExt::Python && root->
fileName.
endsWith(
"__init__.py")))
2178 AUTO_TRACE(
"Found using declaration '{}' at line {} of {} inside section {}",
2192 if (!scName.
empty())
2208 if (nd==
nullptr) scope = fd;
2278 AUTO_TRACE(
"creating new member {} for class {}",memName,cd->
name());
2289 newMmd->setMemberClass(cd);
2307 newMmd->addSectionsToDefinition(root->
anchors);
2313 newMmd->setMemberGroupId(root->
mGrpId);
2316 newMmd->setLanguage(root->
lang);
2317 newMmd->setId(root->
id);
2326 if (root->
section.isUsingDecl() &&
2353 for (
auto &mi : *mni)
2356 if (md && md->
protection()!=Protection::Private)
2371 for (
const auto ©Cd : it->second)
2384 else if (root->
section.isUsingDecl() &&
2386 root->
lang==SrcLangExt::Cpp
2419 memName = root->
name;
2441 newMmd->setNamespace(nd);
2446 newMmd->setFileDef(fd);
2465 newMmd->addSectionsToDefinition(root->
anchors);
2471 newMmd->setMemberGroupId(root->
mGrpId);
2474 newMmd->setLanguage(root->
lang);
2475 newMmd->setId(root->
id);
2483 if (nd && aliasMd.get())
2487 if (fd && aliasMd.get())
2516 if (nd) ncdm->
moveTo(nd);
2545 aliasFullName = aliasCd->localName();
2549 aliasFullName = nd->
qualifiedName()+
"::"+aliasCd->localName();
2581 for (
const auto &fd : *fn)
2584 fd->addIncludedUsingDirectives(visitedFiles);
2606 if (lang==SrcLangExt::Java || lang==SrcLangExt::CSharp)
2611 AUTO_TRACE(
"class variable: file='{}' type='{}' scope='{}' name='{}' args='{}' prot={} mtype={} lang={} ann={} init='{}'",
2617 if (related!=Relationship::Member || mtype==MemberType::Friend ||
Config_getBool(HIDE_SCOPE_NAMES))
2619 if (root->
spec.isAlias())
2621 if (lang==SrcLangExt::Python)
2623 def=
"type "+name+args;
2632 def=type+
" "+name+args;
2637 if (root->
spec.isAlias())
2639 if (lang==SrcLangExt::Python)
2641 def=
"type "+qualScope+scopeSeparator+name+args;
2645 def=
"using "+qualScope+scopeSeparator+name;
2650 def=type+
" "+qualScope+scopeSeparator+name+args;
2662 def=qualScope+scopeSeparator+name+args;
2673 for (
const auto &imd : *mn)
2685 if (root->
lang==SrcLangExt::ObjC &&
2686 root->
mtype==MethodTypes::Property &&
2710 prot,Specifier::Normal,root->
isStatic,related,
2714 mmd->setTagInfo(root->
tagInfo());
2715 mmd->setMemberClass(cd);
2719 mmd->setDefinition(def);
2721 mmd->addSectionsToDefinition(root->
anchors);
2722 mmd->setFromAnonymousScope(fromAnnScope);
2723 mmd->setFromAnonymousMember(fromAnnMemb);
2736 mmd->setMemberGroupId(root->
mGrpId);
2737 mmd->setMemberSpecifiers(root->
spec);
2738 mmd->setVhdlSpecifiers(root->
vhdlSpec);
2739 mmd->setReadAccessor(root->
read);
2740 mmd->setWriteAccessor(root->
write);
2742 mmd->setHidden(root->
hidden);
2744 mmd->setLanguage(root->
lang);
2745 mmd->setId(root->
id);
2748 mmd->setBodyDef(root->
fileDef());
2753 mmd->setRefItems(root->
sli);
2754 mmd->setRequirementReferences(root->
rqli);
2759 if (mtype==MemberType::Typedef)
2784 AUTO_TRACE(
"global variable: file='{}' type='{}' scope='{}' name='{}' args='{}' prot={} mtype={} lang={} init='{}'",
2790 if (mtype==MemberType::Typedef &&
Config_getBool(TYPEDEF_HIDES_STRUCT))
2796 static const reg::Ex re(R
"(\a\w*)");
2798 const std::string &typ = ttype.
str();
2801 DString typeValue = match.str();
2836 if (root->
spec.isAlias())
2838 if (lang==SrcLangExt::Python)
2840 def=
"type "+nd->
name()+sep+name+args;
2844 def=
"using "+nd->
name()+sep+name;
2849 def=type+
" "+nd->
name()+sep+name+args;
2854 def=nd->
name()+sep+name+args;
2861 if (name.
at(0)==
'@')
2867 if (root->
spec.isAlias())
2869 if (root->
lang==SrcLangExt::Python)
2871 def=
"type "+root->
name+args;
2875 def=
"using "+root->
name;
2880 def=type+
" "+name+args;
2901 for (
const auto &imd : *mn)
2915 bool isPHPArray = md->
getLanguage()==SrcLangExt::PHP &&
2918 bool staticsInDifferentFiles =
2924 !staticsInDifferentFiles
2966 mmd->setTagInfo(root->
tagInfo());
2967 mmd->setMemberSpecifiers(root->
spec);
2968 mmd->setVhdlSpecifiers(root->
vhdlSpec);
2972 mmd->addSectionsToDefinition(root->
anchors);
2973 mmd->setFromAnonymousScope(fromAnnScope);
2974 mmd->setFromAnonymousMember(fromAnnMemb);
2985 mmd->setMemberGroupId(root->
mGrpId);
2986 mmd->setDefinition(def);
2987 mmd->setLanguage(root->
lang);
2988 mmd->setId(root->
id);
2996 mmd->setBodyDef(fd);
3001 mmd->setRefItems(root->
sli);
3002 mmd->setRequirementReferences(root->
rqli);
3005 mmd->setNamespace(nd);
3013 mmd->setFileDef(fd);
3019 if (mtype==MemberType::Typedef)
3041 if (lang == SrcLangExt::Fortran || lang == SrcLangExt::VHDL)
3046 static const reg::Ex re(R
"(\([^)]*[*&^][^)]*\))");
3048 size_t i=std::string::npos;
3052 i = match.position();
3055 if (i!=std::string::npos)
3057 size_t di = type.find(
"decltype(");
3058 if (di!=std::string::npos && di<i)
3060 i = std::string::npos;
3063 size_t bb=type.find(
'<');
3064 size_t be=type.rfind(
'>');
3065 bool templFp =
false;
3066 if (be!=std::string::npos) {
3067 size_t cc_ast = type.find(
"::*");
3068 size_t cc_amp = type.find(
"::&");
3069 templFp = (cc_ast != std::string::npos && cc_ast>be) || (cc_amp != std::string::npos && cc_amp>be);
3072 if (!type.empty() &&
3073 i!=std::string::npos &&
3074 type.find(
"operator")==std::string::npos &&
3075 (type.find(
")(")==std::string::npos || type.find(
"typedef ")!=std::string::npos) &&
3077 (!(bb<i && i<be) || templFp)
3080 if (pLength) *pLength=
static_cast<int>(l);
3083 return static_cast<int>(i);
3100 bool result =
false;
3101 bool typeIsClass =
false;
3102 bool typePtrType =
false;
3139 typeIsClass = resolver.
resolveClass(ctx,type)!=
nullptr;
3157 static const reg::Ex initChars(R
"([\d"'&*!^]+)");
3161 std::string name = a.
name.
str();
3162 if (
reg::search(name,match,initChars) && match.position()==0)
3194 std::string atype = a.
type.
str();
3195 if (
reg::search(atype,match,initChars) && match.position()==0)
3202 if (resType.empty()) resType=atype;
3203 static const reg::Ex idChars(R
"(\a\w*)");
3204 if (
reg::search(resType,match,idChars) && match.position()==0)
3206 resType=match.str();
3207 if (resType==
"int" || resType==
"long" ||
3208 resType==
"float" || resType==
"double" ||
3209 resType==
"char" || resType==
"void" ||
3210 resType==
"signed" || resType==
"unsigned" ||
3211 resType==
"const" || resType==
"volatile" )
3248 bool insideString=
false;
3249 bool insideChar=
false;
3251 while (e<len && brCount!=0)
3257 if (!insideString && !insideChar)
3259 if (e<len-1 && s.
at(e+1)==
'<')
3261 else if (roundCount==0)
3266 if (!insideString && !insideChar)
3268 if (e<len-1 && s.
at(e+1)==
'>')
3270 else if (roundCount==0)
3275 if (!insideString && !insideChar)
3279 if (!insideString && !insideChar)
3285 if (insideString && pc!=
'\\')
3294 if (insideChar && pc!=
'\\')
3304 return brCount==0 ?
static_cast<int>(e) : -1;
3313 AUTO_TRACE(
"VARIABLE_SEC: type='{}' name='{}' args='{}' bodyLine={} endBodyLine={} mGrpId={} relates='{}'",
3328 std::string sargs = args.
str();
3329 static const reg::Ex reName(R
"(\a\w*)");
3334 sargs = match.suffix().str();
3335 size_t j = sargs.find(
')');
3336 if (j!=std::string::npos) args=sargs.
substr(0,j);
3347 size_t ai = type.
find(
'[',ii);
3360 AUTO_TRACE_ADD(
"after correction: type='{}' name='{}' args='{}'",type,name,args);
3371 scope=name.
left(index);
3372 name=name.
mid(index+2);
3380 if (!scopeName.
empty())
3392 bool isRelated=
false;
3393 bool isMemberOf=
false;
3396 if (root->
lang==SrcLangExt::CSharp)
3409 for (
size_t i=0;i<name.
length()-1;i++)
3411 if (name[i]==
':' && name[i+1]==
':')
3413 p=
static_cast<int>(i);
3415 else if (name[i]==
'<')
3420 if (e!=-1) i=
static_cast<int>(e);
3426 if (type==
"friend class" || type==
"friend struct" ||
3427 type==
"friend union")
3441 Relationship::Member
3462 mtype=MemberType::EnumValue;
3464 mtype=MemberType::Typedef;
3466 mtype=MemberType::Friend;
3467 else if (root->
mtype==MethodTypes::Property)
3468 mtype=MemberType::Property;
3469 else if (root->
mtype==MethodTypes::Event)
3470 mtype=MemberType::Event;
3472 mtype=sliceOpt ? MemberType::Sequence : MemberType::Typedef;
3474 mtype=sliceOpt ? MemberType::Dictionary : MemberType::Typedef;
3479 isMemberOf=(root->
relatesType==RelatesType::MemberOf);
3497 Relationship relationship = isMemberOf ? Relationship::Foreign :
3498 isRelated ? Relationship::Related :
3499 Relationship::Member ;
3513 else if (!name.
empty())
3539 scope=rname.
left(index);
3540 rname=rname.
mid(index+2);
3552 for (
auto &imd : *mn)
3554 if (!imd->isTypedef())
3563 bool notBothGrouped = root->
groups.empty() || imd->getGroupDef()==
nullptr;
3564 bool bothSameScope = (!cd && !nd) || (cd && imd->getClassDef() == cd) || (nd && imd->getNamespaceDef() == nd);
3567 if (notBothGrouped && bothSameScope && imd->typeString()==rtype)
3615 for (
const auto &e : root->
children())
3616 if (!e->section.isEnum())
3633 for (
const auto &e : root->
children())
3634 if (!e->section.isEnum())
3651 for (
const auto &e : root->
children())
3652 if (!e->section.isEnum())
3667 (root->
section.isVariable() &&
3670 (root->
section.isFunction() &&
3673 (root->
section.isFunction() &&
3682 for (
const auto &e : root->
children())
3683 if (!e->section.isEnum())
3698 enum MemberType type = root->
section.isExportedInterface() ? MemberType::Interface : MemberType::Service;
3709 mmd->setTagInfo(root->
tagInfo());
3710 mmd->setMemberClass(cd);
3712 mmd->setDocsForDefinition(
false);
3716 mmd->setMemberSpecifiers(root->
spec);
3717 mmd->setVhdlSpecifiers(root->
vhdlSpec);
3718 mmd->setMemberGroupId(root->
mGrpId);
3720 mmd->setLanguage(root->
lang);
3721 mmd->setBodyDef(fd);
3722 mmd->setFileDef(fd);
3723 mmd->addSectionsToDefinition(root->
anchors);
3725 mmd->setDefinition(def);
3729 AUTO_TRACE(
"Interface member: fileName='{}' type='{}' name='{}' mtype='{}' prot={} virt={} state={} proto={} def='{}'",
3737 root->
spec.isOptional() ? Protection::Protected : Protection::Public, Specifier::Normal);
3747 mmd->setRefItems(root->
sli);
3748 mmd->setRequirementReferences(root->
rqli);
3757 if (root->
section.isExportedInterface() || root->
section.isIncludedService())
3759 AUTO_TRACE(
"Exported interface/included service: type='{}' scope='{}' name='{}' args='{}'"
3760 " relates='{}' relatesType='{}' file='{}' line={} bodyLine={} #tArgLists={}"
3761 " mGrpId={} spec={} proto={} docFile='{}'",
3784 else if (rname.
empty())
3787 "Illegal member name found.");
3793 case SrcLangExt::Unknown:
3794 case SrcLangExt::IDL:
3823 if (isFriend) mtype=MemberType::Friend;
3824 else if (root->
mtype==MethodTypes::Signal) mtype=MemberType::Signal;
3825 else if (root->
mtype==MethodTypes::Slot) mtype=MemberType::Slot;
3826 else if (root->
mtype==MethodTypes::DCOP) mtype=MemberType::DCOP;
3831 if ((fd==
nullptr || fd->
getLanguage()==SrcLangExt::Cpp) &&
3835 (j!=i+2 || name.
at(i+1)!=
'=')
3853 root->
relatesType==RelatesType::MemberOf ? Relationship::Foreign :
3854 Relationship::Related ;
3864 mmd->setTagInfo(root->
tagInfo());
3865 mmd->setMemberClass(cd);
3867 mmd->setDocsForDefinition(!root->
proto);
3871 mmd->setMemberSpecifiers(spec);
3872 mmd->setVhdlSpecifiers(root->
vhdlSpec);
3873 mmd->setMemberGroupId(root->
mGrpId);
3875 mmd->setLanguage(root->
lang);
3876 mmd->setRequiresClause(root->
req);
3877 mmd->setId(root->
id);
3878 mmd->setBodyDef(fd);
3879 mmd->setFileDef(fd);
3880 mmd->addSectionsToDefinition(root->
anchors);
3885 if (scopeSeparator!=
"::")
3887 qualScope =
substitute(qualScope,
"::",scopeSeparator);
3889 if (lang==SrcLangExt::PHP)
3892 scopeSeparator=
"::";
3909 def=type+
" "+qualScope+scopeSeparator+name;
3913 def=qualScope+scopeSeparator+name;
3917 mmd->setDefinition(def);
3921 AUTO_TRACE(
"function member: type='{}' scope='{}' name='{}' args='{}' proto={} def='{}'",
3922 type, qualScope, rname, args, root->
proto, def);
3932 mmd->setRefItems(root->
sli);
3933 mmd->setRequirementReferences(root->
rqli);
3953 MemberType::Function,
3957 mmd->setTagInfo(root->
tagInfo());
3958 mmd->setLanguage(root->
lang);
3959 mmd->setId(root->
id);
3964 mmd->setDocsForDefinition(!root->
proto);
3970 mmd->addSectionsToDefinition(root->
anchors);
3971 mmd->setMemberSpecifiers(root->
spec);
3972 mmd->setVhdlSpecifiers(root->
vhdlSpec);
3973 mmd->setMemberGroupId(root->
mGrpId);
3974 mmd->setRequiresClause(root->
req);
3984 if (!nscope.
empty())
4009 def=root->
type+
" "+scope+name;
4015 AUTO_TRACE(
"new non-member function type='{}' scope='{}' name='{}' args='{}' proto={} def='{}'",
4017 mmd->setDefinition(def);
4021 mmd->setRefItems(root->
sli);
4022 mmd->setRequirementReferences(root->
rqli);
4026 mmd->setNamespace(nd);
4033 mmd->setFileDef(fd);
4054 if (root->
section.isFunction())
4056 AUTO_TRACE(
"member function: type='{}' scope='{}' name='{}' args='{}' relates='{}' relatesType='{}'"
4057 " file='{}' line={} bodyLine={} #tArgLists={} mGrpId={}"
4058 " spec={} proto={} docFile='{}'",
4073 scope=rname.
left(index);
4074 rname=rname.
mid(index+2);
4083 if (root->
lang==SrcLangExt::CSharp)
4094 size_t memIndex=rname.
rfind(
"::");
4097 if (cd && scope+
"::"==rname.
left(scope.
length()+2))
4103 bool isMember=
false;
4106 size_t ts=rname.
find(
'<');
4107 size_t te=rname.
find(
'>');
4125 isMember=memIndex<ts || memIndex>te;
4165 for (
const auto &imd : *mn)
4178 fullScope.
prepend(parentScope);
4184 if (mnd) nsName = mnd->
name();
4185 if (rnd) rnsName = rnd->
name();
4193 bool sameTemplateArgs =
true;
4194 bool matchingReturnTypes =
true;
4195 bool sameRequiresClause =
true;
4201 matchingReturnTypes =
false;
4205 sameRequiresClause =
false;
4211 sameTemplateArgs =
false;
4214 bool staticsInDifferentFiles =
4217 if (sameTemplateArgs &&
4218 matchingReturnTypes &&
4219 sameRequiresClause &&
4220 !staticsInDifferentFiles &&
4227 if (!root->
groups.empty() && !root->
groups.front().groupname.empty())
4234 found=(mnd && rnd && nsName==rnsName) ||
4235 ((mnd==
nullptr && rnd==
nullptr && mfd!=
nullptr &&
4240 if (!found && gd && gd==md->
getGroupDef() && nsName==rnsName)
4246 AUTO_TRACE_ADD(
"combining function with prototype found={} in namespace '{}'",found,nsName);
4345 else if (rname.
empty())
4348 "Illegal member name found."
4366 for (
const auto &ifmd : *fn)
4370 for (
const auto &immd : *mn)
4386 AUTO_TRACE_ADD(
"Merging related global and member '{}' isFriend={} isRelated={} isFunction={}",
4463 for (
const auto &imdec : *mn)
4471 for (
const auto &imdef : *mn)
4474 if (mdef && mdec!=mdef &&
4494 for (
const auto &imd : *mn)
4510 if (mdef && mdec)
break;
4518 mdec->getOuterScope(),mdec->getFileDef(),mdec->typeString(),
const_cast<ArgumentList*
>(&mdecAl),
4525 mdec->mergeReferences(mdef);
4527 mdec->mergeReferencedBy(mdef);
4544 for (
const auto &imd : *mn)
4555 for (
const auto &irmd : *rmn)
4589 size_t i=qualifiedName.rfind(
"::");
4590 if (i!=std::string::npos)
4597 for (
const auto &imd : *mn)
4623 std::map<std::string,int> templateNames;
4625 for (
const Argument &arg : templateArguments)
4627 static const reg::Ex re(R
"(\a[\w:]*)");
4630 for (; it!=
end ; ++it)
4632 const auto &match = *it;
4633 std::string n = match.str();
4634 if (n==arg.name.str())
4636 if (templateNames.find(n)==templateNames.end())
4638 templateNames.emplace(n,count);
4643 return templateNames;
4658 if (context && cd!=context)
4663 if (result==
nullptr)
4668 if (result==
nullptr)
4697 for (
auto &mi : *mni)
4705 if (!typedefValue.
empty())
4707 type = typedefValue;
4726 usedClassName = typeCd->
name();
4736 if (templateNames.empty())
4740 BaseInfo bi(usedName,Protection::Public,Specifier::Normal);
4745 if (arg.name==usedName)
4749 if (usedCd==
nullptr)
4800 if (!found && !type.
empty())
4859 if (templateNames.empty())
4875 bool b =
Config_getBool(HIDE_UNDOC_RELATIONS) ? true : isArtificial;
4897 AUTO_TRACE(
"Derived from template '{}' with parameters '{}' isArtificial={}",
4898 templateClass->
name(),templSpec,isArtificial);
4901 bool existingClass = templSpec==tempArgsStr;
4902 if (existingClass)
return;
4904 bool freshInstance=
false;
4921 for (
auto it=it_pair.first ; it!=it_pair.second ; ++it)
4923 const Entry *templateRoot = it->second;
4924 AUTO_TRACE_ADD(
"template root found '{}' templSpec='{}'",templateRoot->
name,templSpec);
4930 isArtificial,templArgs.get(),templateNames);
4954 templateClassName,
true,
true);
4955 AUTO_TRACE_ADD(
"templateClassName={} baseClass={}",templateClassName,baseClass?baseClass->
name():
"<none>");
4984 if (name.
empty())
return 0;
4985 int l =
static_cast<int>(name.
length());
4991 while (count>0 && i>=0)
4996 case '>':
if (!insideQuote) count++;
break;
4997 case '<':
if (!insideQuote) count--;
break;
4998 case '\'':
if (!insideQuote) insideQuote=c;
4999 else if (insideQuote==c && (i<0 || name[i]!=
'\\')) insideQuote=0;
5001 case '"':
if (!insideQuote) insideQuote=c;
5002 else if (insideQuote==c && (i<0 || name[i]!=
'\\')) insideQuote=0;
5022 AUTO_TRACE(
"name={} base={} isArtificial={} mode={}",cd->
name(),bi->
name,isArtificial,(
int)mode);
5025 bool explicitGlobalScope=
false;
5028 biName=biName.
mid(2);
5029 explicitGlobalScope=
true;
5033 bool lastParent=
false;
5038 int scopeOffset=explicitGlobalScope ? 0 :
static_cast<int>(scopeName.
length());
5047 baseClassName.
prepend(scopeName.
left(scopeOffset)+
"::");
5049 if (root->
lang==SrcLangExt::CSharp)
5076 || explicitGlobalScope
5079 || (root->
lang==SrcLangExt::IDL &&
5080 (root->
section.isExportedInterface() ||
5081 root->
section.isIncludedService()))
5084 AUTO_TRACE_ADD(
"class relation '{}' inherited/used by '{}' found prot={} virt={} templSpec='{}'",
5085 baseClassName, root->
name, bi->
prot, bi->
virt, templSpec);
5088 size_t si=baseClassName.
rfind(
"::",i);
5090 if (baseClass==
nullptr &&
static_cast<size_t>(i)!=baseClassName.
length())
5100 baseClassName = baseClassName.
left(i)+baseClassName.
mid(e);
5111 else if (baseClass && !templSpec.
empty())
5122 baseClass = templClass;
5140 found=baseClass!=
nullptr && baseClass!=cd;
5150 found = baseClass!=
nullptr && baseClass!=cd;
5162 found = baseClass!=
nullptr && baseClass!=cd;
5165 bool isATemplateArgument = templateNames.find(biName.
str())!=templateNames.end();
5170 AUTO_TRACE_ADD(
"Documented base class '{}' templSpec='{}'",biName,templSpec);
5188 if (baseClassTypeDef==
nullptr)
5198 if (baseClassTypeDef)
5207 AUTO_TRACE_ADD(
"insertBaseClass name={} prot={} virt={} templSpec={}",usedName,prot,bi->
virt,templSpec);
5215 "Detected potential recursive class relation "
5216 "between class {} and base class {}!",
5223 else if (mode==
Undocumented && (scopeOffset==0 || isATemplateArgument))
5225 AUTO_TRACE_ADD(
"New undocumented base class '{}' baseClassName='{}' templSpec='{}' isArtificial={}",
5226 biName,baseClassName,templSpec,isArtificial);
5228 if (isATemplateArgument)
5231 if (baseClass==
nullptr)
5250 if (baseClass==
nullptr)
5261 si = baseClassName.
rfind(
"::");
5277 biName=
"<"+biName.
left(biName.
length()-2)+
">";
5281 AUTO_TRACE_ADD(
"insertBaseClass name={} prot={} virt={} templSpec={}",biName,bi->
prot,bi->
virt,templSpec);
5291 if (scope!=baseClass)
5317 "Detected potential recursive class relation "
5318 "between class {} and base class {}!",
5319 root->
name,baseClassName
5332 size_t o = scopeName.
rfind(
"::",scopeOffset-1);
5336 }
while (scopeOffset>=0);
5338 if (parentNode==
nullptr)
5344 parentNode=parentNode->
parent();
5346 }
while (lastParent);
5366 bool hasExtends = !root->
extends.empty();
5367 if (hasExtends)
return true;
5394 if (root->
lang==SrcLangExt::CSharp)
5400 bName = bName.
left(i);
5465 if (!nd->hasDocumentation())
5468 nd->getLanguage() == SrcLangExt::Fortran) &&
5472 warn_undoc(nd->getDefFileName(),nd->getDefLine(),
"{} {} is not documented.",
5473 nd->getLanguage() == SrcLangExt::Fortran ?
"Module" :
"Namespace",
5523 DString templSpec = ti.templSpec;
5537 for (
const auto &tn_kv : templateNames)
5539 size_t templIndex = tn_kv.second;
5541 bool hasActArg=
false;
5542 if (templIndex<templArgs->size())
5544 actArg=templArgs->at(templIndex);
5548 baseClassNames.find(actArg.
type.
str())!=baseClassNames.end() &&
5549 actualTemplateNames.find(actArg.
type.
str())==actualTemplateNames.end()
5552 actualTemplateNames.emplace(actArg.
type.
str(),
static_cast<int>(templIndex));
5587 for (
const auto &fd : *fn)
5589 fd->computeAnchors();
5602 gd->computeAnchors();
5609template<
typename Func>
5632 for (
const auto &fd : *fn)
5705 if (md==
nullptr)
return;
5706 AUTO_TRACE(
"scope='{}' name='{}' args='{}' funcDecl='{}' mSpec={}",
5721 fullName = cd->
name();
5723 fullName = nd->
name();
5725 if (!fullName.
empty()) fullName+=
"::";
5726 fullName+=md->
name();
5831 "member {} belongs to two different groups. The second one found here will be ignored.",
5869 return allowNoGroup;
5872 for (
const auto &g : root->
groups)
5874 if (g.groupname == gd->
name())
5897 AUTO_TRACE(
"namespace='{}' type='{}' name='{}' tempArg='{}' decl='{}'",namespaceName,type,name,tempArg,decl);
5899 if (n.
empty())
return false;
5911 for (
const auto &md : *mn)
5922 if (md->isAlias() && md->getOuterScope() &&
5929 nd = md->getNamespaceDef();
5933 size_t enumNamePos=0;
5934 if (nd && md->isEnumValue() && (enumNamePos=namespaceName.
rfind(
"::"))!=
DString::npos)
5936 DString enumName = namespaceName.
mid(enumNamePos+2);
5937 if (namespaceName.
left(enumNamePos)==nd->
name())
5942 for (
const auto &emd : *enumMn)
5944 found = emd->isStrong() && md->getEnumScope()==emd.get();
5958 else if (nd==
nullptr && md->isEnumValue())
5963 for (
const auto &emd : *enumMn)
5965 found = emd->isStrong() && md->getEnumScope()==emd.get();
5988 if ((namespaceName.
empty() && nd==
nullptr) ||
5989 (nd && nd->
name()==namespaceName) ||
5993 AUTO_TRACE_ADD(
"Try to add member '{}' to scope '{}'",md->name(),namespaceName);
6001 md->isVariable() || md->isTypedef() ||
6002 matchArguments2(md->getOuterScope(),md->getFileDef(),md->typeString(),&mdAl,
6009 if (matching && !root->
tArgLists.empty())
6028 if (matching && md->isStatic() &&
6029 md->getDefFileName()!=root->
fileName &&
6037 if (!md->templateArguments().empty() && !root->
tArgLists.empty())
6042 if (md->templateArguments().size()!=root->
tArgLists.back().size() ||
6043 md->typeString()!=type ||
6044 md->requiresClause()!=root->
req)
6060 if (!found && root->
relatesType!=RelatesType::Duplicate && root->
section.isFunction())
6064 DString warnMsg =
"no matching file member found for \n"+fullFuncDecl;
6067 warnMsg+=
"\nPossible candidates:";
6068 for (
const auto &md : *mn)
6072 warnMsg+=
"' " +
warn_line(md->getDefFileName(),md->getDefLine());
6080 if (root->
type!=
"friend class" &&
6081 root->
type!=
"friend struct" &&
6082 root->
type!=
"friend union" &&
6083 root->
type!=
"friend" &&
6089 "documented symbol '{}' was not declared or defined.",
qPrint(decl)
6101 auto srcIt = srcTempArgLists.begin();
6102 auto dstIt = dstTempArgLists.begin();
6103 while (srcIt!=srcTempArgLists.end() && dstIt!=dstTempArgLists.end())
6105 if ((*srcIt).size()!=(*dstIt).size())
return true;
6119 result = cd->templateArguments().hasParameters() || cd->templateMaster()!=
nullptr ||
6129 const std::string &src
6133 static const reg::Ex re(R
"(\a\w*)");
6138 for (; it!=
end ; ++it)
6140 const auto &match = *it;
6141 size_t i = match.position();
6142 size_t l = match.length();
6144 dst+=src.substr(p,i-p);
6145 std::string name=match.str();
6147 auto srcIt = srcTempArgLists.begin();
6148 auto dstIt = dstTempArgLists.begin();
6149 while (srcIt!=srcTempArgLists.end() && !found)
6152 std::vector<Argument>::const_iterator tdaIt;
6153 if (dstIt!=dstTempArgLists.end())
6156 tdaIt = tdAli->
begin();
6161 for (
auto tsaIt = tsaLi.
begin(); tsaIt!=tsaLi.
end() && !found; ++tsaIt)
6165 if (tdAli && tdaIt!=tdAli->
end())
6181 else if (tdaType.
startsWith(
"typename ")) vc=9;
6184 tdaName = tdaType.
mid(vc);
6186 if (!tdaName.
empty())
6217 auto dstIt = dst.
begin();
6222 if (dstIt == dst.
end())
6226 da.
array = dstArray;
6234 da.
array = dstArray;
6242 srcTempArgLists,dstTempArgLists,
6268 funcType,funcName,funcArgs,exceptions,
6272 mmd->setTagInfo(root->
tagInfo());
6273 mmd->setLanguage(root->
lang);
6274 mmd->setId(root->
id);
6275 mmd->makeImplementationDetail();
6276 mmd->setMemberClass(cd);
6277 mmd->setDefinition(funcDecl);
6283 mmd->setDocsForDefinition(!root->
proto);
6285 mmd->addSectionsToDefinition(root->
anchors);
6289 mmd->setMemberSpecifiers(spec);
6290 mmd->setVhdlSpecifiers(root->
vhdlSpec);
6291 mmd->setMemberGroupId(root->
mGrpId);
6294 mmd->setRefItems(root->
sli);
6295 mmd->setRequirementReferences(root->
rqli);
6331 bool memFound=
false;
6332 for (
const auto &imd : *mn)
6335 if (md==
nullptr)
continue;
6337 if (cd==
nullptr)
continue;
6349 size_t enumNamePos=0;
6352 DString enumName = className.
mid(enumNamePos+2);
6354 if (!namespaceName.
empty()) fullScope.
prepend(namespaceName+
"::");
6355 if (fullScope==cd->
name())
6361 for (
const auto &emd : *enumMn)
6363 memFound = emd->isStrong() && md->
getEnumScope()==emd.get();
6369 if (memFound)
break;
6374 if (memFound)
break;
6392 if (!templAl.
empty())
6394 declTemplArgs.push_back(templAl);
6402 bool substDone=
false;
6409 if (declTemplArgs.size()>0 && declTemplArgs.size()==defTemplArgs.size())
6432 AUTO_TRACE_ADD(
"matching '{}'<=>'{}' className='{}' namespaceName='{}' result={}",
6461 AUTO_TRACE_ADD(
"Comparing return types '{}'<->'{}' #args {}<->{}",
6469 else if (defTemplArgs.size()>declTemplArgs.size())
6471 AUTO_TRACE_ADD(
"Different number of template arguments {} vs {}",defTemplArgs.size(),declTemplArgs.size());
6477 bool rootIsUserDoc = root->
section.isMemberDoc();
6480 bool classOrMdIsTemplate = mdIsTemplate || classIsTemplate;
6481 bool rootIsTemplate = !root->
tArgLists.empty();
6483 if (!rootIsUserDoc &&
6484 (mdIsTemplate || rootIsTemplate) &&
6485 ((classOrMdIsTemplate && !rootIsTemplate) || (!classOrMdIsTemplate && rootIsTemplate))
6490 AUTO_TRACE_ADD(
"Comparing return types: template v.s. non-template");
6494 AUTO_TRACE_ADD(
"Match results of matchArguments2='{}' substDone='{}'",matching,substDone);
6505 if (!funcTempList.
empty() &&
6525 else if (cd && cd!=tcd)
6531 if (memFound)
break;
6535 addLocalObjCMethod(root,scopeName,funcType,funcName,funcArgs,exceptions,funcDecl,spec);
6538 if (count==0 && !(isFriend && funcType==
"class"))
6541 const ClassDef *ecd =
nullptr, *ucd =
nullptr;
6542 MemberDef *emd =
nullptr, *umd =
nullptr;
6544 for (
const auto &md : *mn)
6566 AUTO_TRACE_ADD(
"new candidate className='{}' scope='{}' args='{}': exact match",
6567 className,ccd->
name(),md->argsString());
6573 AUTO_TRACE_ADD(
"new candidate className='{}' scope='{}' args='{}': no match",
6574 className,ccd->
name(),md->argsString());
6579 bool strictProtoMatching =
Config_getBool(STRICT_PROTO_MATCHING);
6580 if (!strictProtoMatching)
6582 if (candidates==1 && ucd && umd)
6589 else if (candidates>1 && ecd && emd)
6600 if (noMatchCount>1) warnMsg+=
"uniquely ";
6601 warnMsg+=
"matching class member found for \n";
6605 warnMsg+=
" template ";
6610 DString fullFuncDecl=funcDecl;
6614 warnMsg+=fullFuncDecl;
6616 if (candidates>0 || noMatchCount>=1)
6618 warnMsg+=
"\nPossible candidates:";
6624 for (
const auto &md : *mn)
6626 const ClassDef *cd=md->getClassDef();
6640 warnMsg+=
"template ";
6645 if (!md->typeString().empty())
6647 warnMsg+=md->typeString();
6651 if (!qScope.
empty())
6652 warnMsg+=qScope+
"::"+md->name();
6653 warnMsg+=md->argsString();
6654 warnMsg+=
"' " +
warn_line(md->getDefFileName(),md->getDefLine());
6675 AUTO_TRACE(
"funcType={} funcName={} funcArgs={} funcDecl={} spec={}",funcType,funcName,funcArgs,funcDecl,spec);
6677 for (
const auto &md : *mn)
6679 if (md->getClassDef()==cd)
6691 funcType,funcName,funcArgs,exceptions,
6697 mmd->setTagInfo(root->
tagInfo());
6698 mmd->setLanguage(root->
lang);
6699 mmd->setId(root->
id);
6700 mmd->setMemberClass(cd);
6701 mmd->setTemplateSpecialization(
true);
6703 mmd->setDefinition(funcDecl);
6709 mmd->setDocsForDefinition(!root->
proto);
6711 mmd->addSectionsToDefinition(root->
anchors);
6715 mmd->setMemberSpecifiers(spec);
6716 mmd->setVhdlSpecifiers(root->
vhdlSpec);
6717 mmd->setMemberGroupId(root->
mGrpId);
6719 mmd->setRefItems(root->
sli);
6720 mmd->setRequirementReferences(root->
rqli);
6734 bool sameClass=
false;
6739 [](
const auto &md1,
const auto &md2)
6740 { return md1->getClassDef()->name()==md2->getClassDef()->name(); });
6746 if (cd==
nullptr)
return;
6749 if (root->
mtype==MethodTypes::Signal) mtype=MemberType::Signal;
6750 else if (root->
mtype==MethodTypes::Slot) mtype=MemberType::Slot;
6751 else if (root->
mtype==MethodTypes::DCOP) mtype=MemberType::DCOP;
6754 std::unique_ptr<ArgumentList> tArgList =
6759 funcType,funcName,funcArgs,exceptions,
6763 mmd->setTagInfo(root->
tagInfo());
6764 mmd->setLanguage(root->
lang);
6765 mmd->setId(root->
id);
6767 mmd->setMemberClass(cd);
6768 mmd->setDefinition(funcDecl);
6777 mmd->setDocsForDefinition(!root->
proto);
6779 mmd->addSectionsToDefinition(root->
anchors);
6783 mmd->setMemberSpecifiers(spec);
6784 mmd->setVhdlSpecifiers(root->
vhdlSpec);
6785 mmd->setMemberGroupId(root->
mGrpId);
6788 mmd->setRefItems(root->
sli);
6789 mmd->setRequirementReferences(root->
rqli);
6847 AUTO_TRACE(
"root='{}' funcDecl='{}' related='{}' overload={} isFunc={} mGrpId={} #tArgList={} spec={} lang={}",
6860 bool isRelated=
false;
6861 bool isMemberOf=
false;
6862 bool isFriend=
false;
6875 spec.setInline(
true);
6880 spec.setExplicit(
true);
6885 spec.setMutable(
true);
6890 spec.setThreadLocal(
true);
6907 if (!funcDecl.
empty() && funcDecl[0]!=
' ') funcDecl.
prepend(
" ");
6919 if (isFriend && funcDecl.
startsWith(
"class "))
6922 funcDecl=funcDecl.
mid(6);
6923 funcName = funcDecl;
6925 else if (isFriend && funcDecl.
startsWith(
"struct "))
6927 funcDecl=funcDecl.
mid(7);
6928 funcName = funcDecl;
6934 funcArgs,funcTempList,exceptions
6942 AUTO_TRACE_ADD(
"scopeName='{}' className='{}' namespaceName='{}' funcType='{}' funcName='{}' funcArgs='{}'",
6943 scopeName,className,namespaceName,funcType,funcName,funcArgs);
6944 if (!relates.
empty())
6947 isMemberOf=(root->
relatesType == RelatesType::MemberOf);
6954 scopeName = relates;
6964 if (!scopeName.
empty() &&
6967 scopeName = joinedName;
6981 DString joinedName = fnd->name()+
"::"+scopeName;
6984 scopeName=joinedName;
7011 AUTO_TRACE_ADD(
"scopeName='{}' className='{}' namespaceName='{}'",scopeName,className,namespaceName);
7016 if (!namespaceName.
empty())
7018 if (className.
empty())
7020 scopeName=namespaceName;
7022 else if (!relates.
empty() ||
7025 scopeName=namespaceName+
"::"+className;
7029 scopeName=className;
7032 else if (!className.
empty())
7034 scopeName=className;
7038 DString tempScopeName=scopeName;
7042 if (funcSpec.
empty())
7044 uint32_t argListIndex=0;
7049 tempScopeName=scopeName+funcSpec;
7057 if (!scopeName.
empty() && !isRelated && !isFriend && !
Config_getBool(HIDE_SCOPE_NAMES) && root->
lang!=SrcLangExt::Python)
7059 if (!funcType.
empty())
7063 funcDecl=funcType+
" "+tempScopeName+
"::"+funcName+funcTempList;
7067 funcDecl=funcType+
" "+tempScopeName+
"::"+funcName+funcArgs;
7074 funcDecl=tempScopeName+
"::"+funcName+funcTempList;
7078 funcDecl=tempScopeName+
"::"+funcName+funcArgs;
7084 if (!funcType.
empty())
7088 funcDecl=funcType+
" "+funcName+funcTempList;
7092 funcDecl=funcType+
" "+funcName+funcArgs;
7099 funcDecl=funcName+funcTempList;
7103 funcDecl=funcName+funcArgs;
7108 if (funcType==
"template class" && !funcTempList.
empty())
7111 AUTO_TRACE_ADD(
"Parse results: namespaceName='{}' className=`{}` funcType='{}' funcSpec='{}' "
7112 " funcName='{}' funcArgs='{}' funcTempList='{}' funcDecl='{}' relates='{}'"
7113 " exceptions='{}' isRelated={} isMemberOf={} isFriend={} isFunc={}",
7114 namespaceName, className, funcType, funcSpec,
7115 funcName, funcArgs, funcTempList, funcDecl, relates,
7116 exceptions, isRelated, isMemberOf, isFriend, isFunc);
7118 if (!funcName.
empty())
7122 bool strongEnum =
false;
7126 for (
const auto &imd : *mn)
7137 if (!namespaceName.
empty())
7139 namespaceName+=
"::"+className;
7143 namespaceName=className;
7151 funcName =
substitute(funcName,className+
"::",
"");
7154 if (!funcTempList.
empty())
7162 if (!isRelated && !strongEnum && mn)
7165 if (!className.
empty())
7167 if (funcSpec.
empty())
7170 funcArgs,funcTempList,exceptions,
7171 type,args,isFriend,spec,relates,funcDecl,overloaded,isFunc);
7183 else if (overloaded)
7185 addOverloaded(root,mn,funcType,funcName,funcArgs,funcDecl,exceptions,spec);
7189 if (!
findGlobalMember(root,namespaceName,funcType,funcName,funcTempList,funcArgs,funcDecl,spec))
7191 DString fullFuncDecl=funcDecl;
7194 "Cannot determine class for function\n{}",
7200 else if (isRelated && !relates.
empty())
7202 AUTO_TRACE_ADD(
"related function scopeName='{}' className='{}'",scopeName,className);
7203 if (className.
empty()) className=relates;
7207 bool newMember=
true;
7213 for (
const auto &imd : *mn)
7247 mn->
push_back(std::move(mdDefineTaken));
7261 for (
const auto &irmd : *mn)
7282 addMemberDocs(root,rmd_found,funcDecl,
nullptr,overloaded,spec);
7290 switch (root->
mtype)
7292 case MethodTypes::Method: mtype = MemberType::Function;
break;
7293 case MethodTypes::Signal: mtype = MemberType::Signal;
break;
7294 case MethodTypes::Slot: mtype = MemberType::Slot;
break;
7295 case MethodTypes::DCOP: mtype = MemberType::DCOP;
break;
7296 case MethodTypes::Property: mtype = MemberType::Property;
break;
7297 case MethodTypes::Event: mtype = MemberType::Event;
break;
7311 funcType,funcName,funcArgs,exceptions,
7314 isMemberOf ? Relationship::Foreign : Relationship::Related,
7334 mmd->setDefinitionTemplateParameterLists(root->
tArgLists);
7336 mmd->setTagInfo(root->
tagInfo());
7350 for (
const auto &irmd : *rmn)
7381 mmd->setBodyDef(fd);
7388 mmd->setMemberClass(cd);
7389 mmd->setMemberSpecifiers(spec);
7390 mmd->setVhdlSpecifiers(root->
vhdlSpec);
7391 mmd->setDefinition(funcDecl);
7396 mmd->setDocsForDefinition(!root->
proto);
7399 mmd->addSectionsToDefinition(root->
anchors);
7400 mmd->setMemberGroupId(root->
mGrpId);
7401 mmd->setLanguage(root->
lang);
7402 mmd->setId(root->
id);
7406 mmd->setRefItems(root->
sli);
7407 mmd->setRequirementReferences(root->
rqli);
7408 if (root->
relatesType==RelatesType::Duplicate) mmd->setRelatedAlso(cd);
7416 if (!
findGlobalMember(root,namespaceName,funcType,funcName,funcTempList,funcArgs,funcDecl,spec))
7418 DString fullFuncDecl=funcDecl;
7421 "Cannot determine file/namespace for relatedalso function\n{}",
7435 addLocalObjCMethod(root,scopeName,funcType,funcName,funcArgs,exceptions,funcDecl,spec);
7439 bool globMem =
findGlobalMember(root,namespaceName,funcType,funcName,funcTempList,funcArgs,funcDecl,spec);
7440 if (className.
empty() && !globMem)
7444 else if (!className.
empty() && !globMem)
7447 "member '{}' of class '{}' cannot be found",
7448 funcName,className);
7466 AUTO_TRACE(
"root->type='{}' root->inside='{}' root->name='{}' root->args='{}' section={} root->spec={} root->mGrpId={}",
7481 type=type.
left(i+l);
7492 if (root->
section.isMemberDoc())
7518 else if (root->
section.isOverloadDoc())
7532 (root->
section.isVariable() &&
7544 if (type==
"friend class" || type==
"friend struct" ||
7545 type==
"friend union")
7551 type+
" "+root->
name,
7555 else if (!type.
empty())
7584 else if (root->
section.isVariableDoc())
7596 else if (root->
section.isExportedInterface() ||
7597 root->
section.isIncludedService())
7603 type +
" " + root->
name,
7616 if (root->
section.isMemberDoc() ||
7617 root->
section.isOverloadDoc() ||
7620 root->
section.isVariableDoc() ||
7622 root->
section.isIncludedService() ||
7623 root->
section.isExportedInterface()
7633 for (
const auto &e : root->
children())
7635 if (!e->section.isEnum())
7647 for (
const auto &objCImpl : root->
children())
7649 if (objCImpl->section.isObjcImpl())
7651 for (
const auto &objCMethod : objCImpl->children())
7653 if (objCMethod->section.isFunction())
7657 objCMethod->relates,
7660 objCMethod->type+
" "+objCImpl->name+
"::"+objCMethod->name+
" "+objCMethod->args,
7662 objCMethod->section=EntryType::makeEmpty();
7681 bool isGlobal =
false;
7682 bool isRelated =
false;
7683 bool isMemberOf =
false;
7692 if (root->
lang==SrcLangExt::CSharp)
7715 isMemberOf=(root->
relatesType==RelatesType::MemberOf);
7723 if (cd && !name.
empty())
7750 isMemberOf ? Relationship::Foreign : isRelated ? Relationship::Related : Relationship::Member,
7751 MemberType::Enumeration,
7754 mmd->setTagInfo(root->
tagInfo());
7755 mmd->setLanguage(root->
lang);
7756 mmd->setId(root->
id);
7757 if (!isGlobal) mmd->setMemberClass(cd);
else mmd->setFileDef(fd);
7759 mmd->setBodyDef(root->
fileDef());
7760 mmd->setMemberSpecifiers(root->
spec);
7761 mmd->setVhdlSpecifiers(root->
vhdlSpec);
7762 mmd->setEnumBaseType(root->
args);
7765 mmd->addSectionsToDefinition(root->
anchors);
7766 mmd->setMemberGroupId(root->
mGrpId);
7770 mmd->setRefItems(root->
sli);
7771 mmd->setRequirementReferences(root->
rqli);
7776 if (!baseType.
empty())
7785 mmd->setDefinition(name+baseType);
7789 mmd->setDefinition(nd->
name()+
"::"+name+baseType);
7793 mmd->setNamespace(nd);
7800 if (isGlobal && (nd==
nullptr || !nd->
isAnonymous()))
7802 if (!defSet) mmd->setDefinition(name+baseType);
7803 if (fd==
nullptr && root->
parent())
7809 mmd->setFileDef(fd);
7817 mmd->setDefinition(name+baseType);
7821 mmd->setDefinition(cd->
name()+
"::"+name+baseType);
7827 mmd->setDocsForDefinition(!root->
proto);
7857 bool isGlobal =
false;
7858 bool isRelated =
false;
7867 if (root->
lang==SrcLangExt::CSharp)
7882 if (root->
lang==SrcLangExt::CSharp)
7901 if (cd && !name.
empty())
7928 struct EnumValueInfo
7930 EnumValueInfo(
const DString &n,std::unique_ptr<MemberDef> &&md) :
7931 name(n), member(std::move(md)) {}
7933 std::unique_ptr<MemberDef> member;
7935 std::vector< EnumValueInfo > extraMembers;
7937 for (
const auto &imd : *mn)
7944 for (
const auto &e : root->
children())
7947 bool isJavaLike = sle==SrcLangExt::CSharp || sle==SrcLangExt::Java || sle==SrcLangExt::XML;
7948 if ( isJavaLike || root->
spec.isStrong())
7950 if (sle == SrcLangExt::Cpp && e->section.isDefine())
continue;
7957 if (
size_t i = qualifiedName.
rfind(
"::"); i!=
DString::npos && sle==SrcLangExt::CSharp)
7963 qualifiedName=
substitute(qualifiedName,
"::",
".");
7967 DString fileName = e->fileName;
7968 if (fileName.
empty() && e->tagInfo())
7970 fileName = e->tagInfo()->tagName;
7974 fileName,e->startLine,e->startColumn,
7975 e->type,e->name,e->args,
DString(),
7976 e->protection, Specifier::Normal,e->isStatic,Relationship::Member,
7983 fmmd->setNamespace(mnd);
7987 fmmd->setTagInfo(e->tagInfo());
7988 fmmd->setLanguage(e->lang);
7989 fmmd->setBodySegment(e->startLine,e->bodyLine,e->endBodyLine);
7990 fmmd->setBodyDef(e->fileDef());
7992 fmmd->setDocumentation(e->doc,e->docFile,e->docLine);
7993 fmmd->setBriefDescription(e->brief,e->briefFile,e->briefLine);
7994 fmmd->addSectionsToDefinition(e->anchors);
7995 fmmd->setInitializer(e->initializer.str());
7996 fmmd->setMaxInitLines(e->initLines);
7997 fmmd->setMemberGroupId(e->mGrpId);
7998 fmmd->setExplicitExternal(e->explicitExternal,fileName,e->startLine,e->startColumn);
7999 fmmd->setRefItems(e->sli);
8000 fmmd->setRequirementReferences(e->rqli);
8003 fmmd->setEnumScope(md,
true);
8004 extraMembers.emplace_back(e->name,std::move(fmd));
8013 if (!e->name.empty() && (fmn=emnsd->
find(e->name)))
8016 for (
const auto &ifmd : *fmn)
8047 else if (isRelated && cd)
8079 for (
auto &e : extraMembers)
8125 if (gd==
nullptr && !root->
groups.empty())
8139 for (
const auto &g : root->
groups)
8158 "Found non-existing group '{}' for the command '{}', ignoring command",
8172 if (root->
section.isEnumDoc() &&
8197 AUTO_TRACE(
"Found docs for enum with name '{}' and scope '{}' in context '{}' cd='{}', nd='{}' fd='{}'",
8211 for (
const auto &imd : *mn)
8226 else if (cd==
nullptr && mcd==
nullptr && nd!=
nullptr && mnd==nd)
8233 else if (cd==
nullptr && nd==
nullptr && mcd==
nullptr && mnd==
nullptr && fd==mfd)
8258 for (
const auto &mn : mnsd)
8261 for (
const auto &imd : *mn)
8266 int documentedEnumValues=0;
8270 if (fmd->isLinkableInProject()) documentedEnumValues++;
8296 for (
const auto &md : *mn)
8298 index.addClassMemberNameToIndex(md.get());
8299 if (md->getModuleDef())
8301 index.addModuleMemberNameToIndex(md.get());
8309 for (
const auto &md : *mn)
8311 if (md->getNamespaceDef())
8313 index.addNamespaceMemberNameToIndex(md.get());
8317 index.addFileMemberNameToIndex(md.get());
8319 if (md->getModuleDef())
8321 index.addModuleMemberNameToIndex(md.get());
8326 index.sortMemberIndexLists();
8335 if (cd->isLinkableInProject())
8348 if (cd->isLinkableInProject())
8361 if (nd->isLinkableInProject())
8374 for (
const auto &fd : *fn)
8390 std::string s = title.str();
8391 static const reg::Ex re(R
"(\a[\w-]*)");
8394 for (; it!=
end ; ++it)
8396 const auto &match = *it;
8397 std::string matchStr = match.str();
8405 if (gd->isLinkableInProject())
8407 addWordsForTitle(gd.get(),gd->anchor(),gd->groupTitle());
8413 if (pd->isLinkableInProject())
8415 addWordsForTitle(pd.get(),pd->anchor(),pd->title());
8424 auto addMemberToSearchIndex = [](
const MemberDef *md)
8430 DString qn=md->qualifiedName();
8435 if (md->getClassDef())
8439 if (md->getNamespaceDef())
8450 if (md->getGroupDef()) scope = md->getGroupDef();
8451 else if (md->getClassDef()) scope = md->getClassDef();
8452 else if (md->getNamespaceDef()) scope = md->getNamespaceDef();
8453 else if (md->getFileDef()) scope = md->getFileDef();
8457 auto addMemberToIndices = [addMemberToSearchIndex,getScope](
const MemberDef *md)
8459 if (md->isLinkableInProject())
8461 if (!(md->isEnumerate() && md->isAnonymous()))
8464 addMemberToSearchIndex(md);
8466 if (md->isEnumerate())
8468 for (
const auto &fmd : md->enumFieldList())
8471 addMemberToSearchIndex(fmd);
8481 for (
const auto &md : *mn)
8483 addMemberToIndices(md.get());
8490 for (
const auto &md : *mn)
8492 addMemberToIndices(md.get());
8505 for (
const auto &imd : *mn)
8518 for (
const auto &imd : *mn)
8535 for (
const auto &imd : *mn)
8544 const auto &bmni = bmn.
find(mn->memberName());
8547 for (
const auto &ibmd : *bmni)
8555 lang==SrcLangExt::Python ||
8556 lang==SrcLangExt::Java ||
8557 lang==SrcLangExt::PHP ||
8568 lang==SrcLangExt::Python ||
8575 if (lang==SrcLangExt::Python && md->
name().
startsWith(
"__"))
continue;
8615 if (cd->isLinkable())
8617 for (
const auto &bcd : cd->baseClasses())
8633 for (
const auto &ti : cd->getTemplateInstances())
8658 AUTO_TRACE_ADD(
"merging members of category {} into {}",cd->name(),baseClass->
name());
8673 cd->subClasses().empty() &&
8674 !cd->baseClasses().empty())
8705 msg(
"Generating code for file {}...\n",fd->
docName());
8710 else if (parseSources)
8712 msg(
"Parsing code for file {}...\n",fd->
docName());
8728 for (
const auto &fd : *fn)
8736 for (
const auto &fd : *fn)
8745 clangParser->parse();
8746 processSourceFile(fd.get(),*
g_outputList,clangParser.get());
8748 for (
auto incFile : clangParser->filesInSameTU())
8750 if (filesToProcess.find(incFile)!=filesToProcess.end() &&
8752 processedFiles.
find(incFile)==processedFiles.end())
8759 processSourceFile(ifd,*
g_outputList,clangParser.get());
8760 processedFiles.insert(incFile);
8771 for (
const auto &fd : *fn)
8773 if (processedFiles.find(fd->
absFilePath().
str())==processedFiles.end())
8778 clangParser->parse();
8779 processSourceFile(fd.get(),*
g_outputList,clangParser.get());
8792 std::size_t numThreads =
static_cast<std::size_t
>(
Config_getInt(NUM_PROC_THREADS));
8795 msg(
"Generating code files using {} threads.\n",numThreads);
8796 struct SourceContext
8799 : fd(fd_), generateSourceFile(gen_), ol(ol_) {}
8801 bool generateSourceFile;
8805 std::vector< std::future< std::shared_ptr<SourceContext> > > results;
8808 for (
const auto &fd : *fn)
8811 auto ctx = std::make_shared<SourceContext>(fd.get(),generateSourceFile,*
g_outputList);
8812 auto processFile = [ctx]()
8814 if (ctx->generateSourceFile)
8816 msg(
"Generating code for file {}...\n",ctx->fd->docName());
8820 msg(
"Parsing code for file {}...\n",ctx->fd->docName());
8823 ctx->fd->getAllIncludeFilesRecursively(filesInSameTu);
8824 if (ctx->generateSourceFile)
8826 ctx->fd->writeSourceHeader(ctx->ol);
8827 ctx->fd->writeSourceBody(ctx->ol,
nullptr);
8828 ctx->fd->writeSourceFooter(ctx->ol);
8833 ctx->fd->parseSource(
nullptr);
8837 results.emplace_back(threadPool.
queue(processFile));
8840 for (
auto &f : results)
8849 for (
const auto &fd : *fn)
8869 std::size_t numThreads =
static_cast<std::size_t
>(
Config_getInt(NUM_PROC_THREADS));
8875 : fd(fd_), ol(ol_) {}
8880 std::vector< std::future< std::shared_ptr<DocContext> > > results;
8883 for (
const auto &fd : *fn)
8885 bool doc = fd->isLinkableInProject();
8888 auto ctx = std::make_shared<DocContext>(fd.get(),*
g_outputList);
8889 auto processFile = [ctx]() {
8890 msg(
"Generating docs for file {}...\n",ctx->fd->docName());
8891 ctx->fd->writeDocumentation(ctx->ol);
8894 results.emplace_back(threadPool.
queue(processFile));
8898 for (
auto &f : results)
8907 for (
const auto &fd : *fn)
8909 bool doc = fd->isLinkableInProject();
8912 msg(
"Generating docs for file {}...\n",fd->docName());
8931 const_cast<FileDef*
>(fd)->addSourceRef(cd->getStartDefLine(),cd.get(),
nullptr);
8940 const_cast<FileDef*
>(fd)->addSourceRef(cd->getStartDefLine(),cd.get(),
nullptr);
8949 const_cast<FileDef*
>(fd)->addSourceRef(nd->getStartDefLine(),nd.get(),
nullptr);
8956 for (
const auto &md : *mn)
8965 md->isLinkableInProject() &&
8971 const_cast<FileDef*
>(fd)->addSourceRef(md->getStartDefLine(),md->getOuterScope(),md.get());
8977 for (
const auto &md : *mn)
8987 md->isLinkableInProject() &&
8993 const_cast<FileDef*
>(fd)->addSourceRef(md->getStartDefLine(),md->getOuterScope(),md.get());
9010 for (
const auto &def : it->second)
9013 def.fileName,def.lineNr,def.columnNr,
9014 "#define",def.name,def.args,
DString(),
9015 Protection::Public,Specifier::Normal,
false,Relationship::Member,MemberType::Define,
9019 if (!def.args.empty())
9023 mmd->setInitializer(def.definition);
9024 mmd->setFileDef(def.fileDef);
9025 mmd->setDefinition(
"#define "+def.name);
9030 const MemberList *defMl = def.fileDef->getMemberList(MemberListType::DocDefineMembers());
9039 def.fileDef->insertMember(md.get());
9041 AUTO_TRACE_ADD(
"adding macro {} with definition {}",def.name,def.definition);
9075 for (
const auto &fd : *fn)
9077 fd->sortMemberLists();
9084 gd->sortMemberLists();
9101 std::size_t numThreads =
static_cast<std::size_t
>(
Config_getInt(NUM_PROC_THREADS));
9105 std::vector < std::future< void > > results;
9109 for (
const auto &def : symList)
9112 if (dm && !
isSymbolHidden(def) && !def->isArtificial() && def->isLinkableInProject())
9114 auto processTooltip = [dm]() {
9117 results.emplace_back(threadPool.
queue(processTooltip));
9122 for (
auto &f : results)
9131 for (
const auto &def : symList)
9134 if (dm && !
isSymbolHidden(def) && !def->isArtificial() && def->isLinkableInProject())
9181 for (
const auto &fd : *fn)
9203 std::size_t numThreads =
static_cast<std::size_t
>(
Config_getInt(NUM_PROC_THREADS));
9209 : cd(cd_), ol(ol_) {}
9214 std::vector< std::future< std::shared_ptr<DocContext> > > results;
9215 for (
const auto &cd : classList)
9218 if (cd->getOuterScope()==
nullptr ||
9222 auto ctx = std::make_shared<DocContext>(cd,*
g_outputList);
9223 auto processFile = [ctx]()
9225 msg(
"Generating docs for compound {}...\n",ctx->cd->displayName());
9229 if (!ctx->cd->isHidden() && !ctx->cd->isEmbeddedInOuterScope() &&
9230 ctx->cd->isLinkableInProject() && !ctx->cd->isImplicitTemplateInstance())
9232 ctx->cd->writeDocumentation(ctx->ol);
9233 ctx->cd->writeMemberList(ctx->ol);
9237 ctx->cd->writeDocumentationForInnerClasses(ctx->ol);
9240 results.emplace_back(threadPool.
queue(processFile));
9243 for (
auto &f : results)
9250 for (
const auto &cd : classList)
9254 if (cd->getOuterScope()==
nullptr ||
9260 if ( !cd->isHidden() && !cd->isEmbeddedInOuterScope() &&
9261 cd->isLinkableInProject() && !cd->isImplicitTemplateInstance())
9263 msg(
"Generating docs for compound {}...\n",cd->displayName());
9278 for (
const auto &innerCdi : cd->
getClasses())
9283 AUTO_TRACE(
"innerCd={} isLinkable={} isImplicitTemplateInstance={} protectLevelVisible={} embeddedInOuterScope={}",
9292 list.push_back(innerCd);
9300 std::vector<ClassDefMutable*> classList;
9349 for (
const auto &imd : *mn)
9385 for (
const auto &fd : *fn)
9387 fd->combineUsingRelations();
9419 for (
const auto &fd : *fn)
9421 fd->addMembersToMemberGroup();
9436 gd->addMembersToMemberGroup();
9457 for (
const auto &fd : *fn)
9459 fd->distributeMemberGroupDocumentation();
9474 gd->distributeMemberGroupDocumentation();
9504 for (
const auto &fd : *fn)
9506 fd->findSectionsInDocumentation();
9521 gd->findSectionsInDocumentation();
9526 pd->findSectionsInDocumentation();
9531 dd->findSectionsInDocumentation();
9554 for (
const auto &ifmd : *fn)
9568 for (
const auto &imd : *nm)
9599 for (
const auto &imd : *nm)
9619 return fd->absFilePath() == root->
fileName;
9664 Protection::Public,Specifier::Normal,
false,Relationship::Member,MemberType::Define,
9667 mmd->setTagInfo(root->
tagInfo());
9668 mmd->setLanguage(root->
lang);
9680 for (
const auto &md : *mn)
9682 if (md->memberType()==MemberType::Define) count++;
9686 for (
const auto &imd : *mn)
9689 if (md && md->
memberType()==MemberType::Define)
9704 for (
const auto &imd : *mn)
9707 if (md && md->
memberType()==MemberType::Define)
9731 warn(root->
fileName,root->
startLine,
"found documented #define {} but ignoring it because ENABLE_PREPROCESSING is NO.", root->
name);
9745 normalizedName =
substitute(normalizedName,
"\\",
"/");
9748 if (root->
docFile==normalizedName)
9752 normalizedName=normalizedName.
left(lastSlashPos);
9755 if (normalizedName.
at(normalizedName.
length()-1)!=
'/')
9757 normalizedName+=
'/';
9759 DirDef *matchingDir=
nullptr;
9763 if (dir->name().right(normalizedName.
length())==normalizedName)
9768 "\\dir command matches multiple directories.\n"
9769 " Applying the command for directory {}\n"
9770 " Ignoring the command for directory {}",
9771 matchingDir->
name(),dir->name()
9776 matchingDir=dir.get();
9793 warn(root->
fileName,root->
startLine,
"No matching directory found for command \\dir {}",normalizedName);
9802 if (root->
section.isRequirementDoc())
9814 if (root->
section.isPageDoc())
9821 else if (root->
section.isMainpageDoc())
9841 if (root->
section.isMainpageDoc())
9874 else if (si->
lineNr() != -1)
9876 warn(root->
fileName,root->
startLine,
"multiple use of section label '{}' for main page, (first occurrence: {}, line {})",
9881 warn(root->
fileName,root->
startLine,
"multiple use of section label '{}' for main page, (first occurrence: {})",
9898 else if (root->
tagInfo()==
nullptr)
9901 "found more than one \\mainpage comment block! (first occurrence: {}, line {}), Skipping current block!",
9911 if (root->
section.isMainpageDoc())
9935 term(
"page defined {} with label {} is a direct "
9936 "subpage of itself! Please remove this cyclic dependency.\n",
9960 term(
"page defined {} with label {} is a subpage "
9961 "of itself! Please remove this cyclic dependency.\n",
9962 warn_line(pd->docFile(),pd->docLine()),pd->name());
9987 DString label=
"_"+rl->listName();
9988 if (si->label().left(label.
length())==label)
9990 si->setFileName(rl->listName());
9991 si->setGenerated(
true);
9997 if (!si->generated())
10001 if (!si->fileName().empty() &&
10008 if (si->definition())
10015 gd = (
toMemberDef(si->definition()))->getGroupDef();
10045 if (!pd->getGroupDef() && !pd->isReference())
10047 msg(
"Generating docs for page {}...\n",pd->name());
10062 warn(root->
fileName,root->
startLine,
"Example {} was already documented. Ignoring documentation found here.",root->
name);
10090 indentStr.
fill(
' ',indent);
10092 indentStr.
empty()?
"":indentStr,
10097 for (
const auto &e : root->
children())
10115 si->label(),si->fileName(),si->title(),si->type().level(),si->ref());
10129 msg(
"Generating docs for example {}...\n",pd->name());
10131 if (lang != SrcLangExt::Unknown)
10135 intf->resetCodeParserState();
10137 DString n=pd->getOutputFileBase();
10144 if (pd->showLineNo())
10146 lineNoOptStr=
"{lineno}";
10152 (pd->briefDescription().empty()?
"":pd->briefDescription()+
"\n\n")+
10153 pd->documentation()+
"\n\n\\include"+lineNoOptStr+
" "+pd->name(),
10155 .setIndexWords(
true)
10156 .setExample(pd->name()));
10169 if (!gd->isReference())
10181 std::size_t numThreads =
static_cast<std::size_t
>(
Config_getInt(NUM_PROC_THREADS));
10187 : cdm(cdm_), ol(ol_) {}
10192 std::vector< std::future< std::shared_ptr<DocContext> > > results;
10194 for (
const auto &cd : classList)
10199 auto ctx = std::make_shared<DocContext>(cdm,*
g_outputList);
10200 auto processFile = [ctx]()
10202 if ( ( ctx->cdm->isLinkableInProject() &&
10203 !ctx->cdm->isImplicitTemplateInstance()
10206 && !ctx->cdm->isHidden() && !ctx->cdm->isEmbeddedInOuterScope()
10209 msg(
"Generating docs for compound {}...\n",ctx->cdm->displayName());
10210 ctx->cdm->writeDocumentation(ctx->ol);
10211 ctx->cdm->writeMemberList(ctx->ol);
10213 ctx->cdm->writeDocumentationForInnerClasses(ctx->ol);
10216 results.emplace_back(threadPool.
queue(processFile));
10220 for (
auto &f : results)
10222 auto ctx = f.get();
10228 for (
const auto &cd : classList)
10233 if ( ( cd->isLinkableInProject() &&
10234 !cd->isImplicitTemplateInstance()
10237 && !cd->isHidden() && !cd->isEmbeddedInOuterScope()
10240 msg(
"Generating docs for compound {}...\n",cd->displayName());
10254 for (
const auto &cd : conceptList)
10259 msg(
"Generating docs for concept {}...\n",cd->name());
10274 if (nd->isLinkableInProject())
10279 msg(
"Generating docs for namespace {}\n",nd->displayName());
10317 DString cmd=qhgLocation+
" -v 2>&1";
10322 err(
"could not execute {}\n",qhgLocation);
10326 const size_t bufSize = 1024;
10327 char inBuf[bufSize+1];
10328 size_t numRead=fread(inBuf,1,bufSize,f);
10329 inBuf[numRead] =
'\0';
10334 static const reg::Ex versionReg(R
"(Qt (\d+)\.(\d+)\.(\d+))");
10336 std::string s = inBuf;
10339 qtVersion = 10000*
DString(match[1].str()).toInt() +
10340 100*
DString(match[2].str()).toInt() +
10341 DString(match[3].str()).toInt();
10343 if (qtVersion>0 && (qtVersion<60000 || qtVersion >= 60205))
10352 err(
"could not execute {}\n",qhgLocation);
10356 std::string output;
10357 while ((numRead=fread(inBuf,1,bufSize,f))>0)
10359 inBuf[numRead] =
'\0';
10382 if (!dotPath.
empty())
10391 warn_uncond(
"the dot tool could not be found as '{}'\n",dotPath);
10397 size_t l=dotPath.
length();
10398 for (
size_t i=0;i<l;i++)
if (dotPath.
at(i)==
'/') dotPath.
at(i)=
'\\';
10417 bool updateOnly=
false)
10421 bool writeToStdout=configFile==
"-";
10426 if (!writeToStdout)
10430 msg(
"\n\nConfiguration file '{}' created.\n\n",configFile);
10431 msg(
"Now edit the configuration file and enter\n\n");
10432 if (configFile!=
"Doxyfile" && configFile!=
"doxyfile")
10433 msg(
" doxygen {}\n\n",configFile);
10435 msg(
" doxygen\n\n");
10436 msg(
"to generate the documentation for your project\n\n");
10440 msg(
"\n\nConfiguration file '{}' updated.\n\n",configFile);
10446 term(
"Cannot open file {} for writing\n",configFile);
10461 term(
"Cannot open stdout for writing\n");
10476 if (fileName.
empty() || destName.
empty())
return;
10481 fileName = tagLine;
10487 err(
"Tag file '{}' does not exist or is not a file. Skipping it...\n",fileName);
10495 if (!destName.
empty())
10498 msg(
"Reading tag file '{}', location '{}'...\n",fileName,destName);
10502 msg(
"Reading tag file '{}'...\n",fileName);
10512 for (
const auto &sheet : latexExtraStyleSheet)
10514 std::string fileName = sheet;
10515 if (!fileName.empty())
10520 err(
"Style sheet '{}' specified by LATEX_EXTRA_STYLESHEET does not exist!\n",fileName);
10522 else if (fi.
isDir())
10524 err(
"Style sheet '{}' specified by LATEX_EXTRA_STYLESHEET is a directory, it has to be a file!\n", fileName);
10543 if (!htmlStyleSheet.
empty())
10550 err(
"Style sheet '{}' specified by HTML_STYLESHEET does not exist!\n",htmlStyleSheet);
10553 else if (fi.
isDir())
10555 err(
"Style sheet '{}' specified by HTML_STYLESHEET is a directory, it has to be a file!\n",htmlStyleSheet);
10561 copyFile(htmlStyleSheet,destFileName);
10566 for (
const auto &sheet : htmlExtraStyleSheet)
10574 err(
"Style sheet '{}' specified by HTML_EXTRA_STYLESHEET does not exist!\n",fileName);
10578 err(
"Style sheet '{}' specified by HTML_EXTRA_STYLESHEET is already a built-in stylesheet. Please use a different name\n",fi.
fileName());
10580 else if (fi.
isDir())
10582 err(
"Style sheet '{}' specified by HTML_EXTRA_STYLESHEET is a directory, it has to be a file!\n",fileName);
10596 if (!projectLogo.
empty())
10601 err(
"Project logo '{}' specified by PROJECT_LOGO does not exist!\n",projectLogo);
10604 else if (fi.
isDir())
10606 err(
"Project logo '{}' specified by PROJECT_LOGO is a directory, it has to be a file!\n",projectLogo);
10612 copyFile(projectLogo,destFileName);
10621 if (!projectIcon.
empty())
10626 err(
"Project icon '{}' specified by PROJECT_ICON does not exist!\n",projectIcon);
10629 else if (fi.
isDir())
10631 err(
"Project icon '{}' specified by PROJECT_ICON is a directory, it has to be a file!\n",projectIcon);
10637 copyFile(projectIcon,destFileName);
10645 for (
const auto &fileName : files)
10647 if (!fileName.empty())
10652 err(
"Extra file '{}' specified in {} does not exist!\n", fileName,filesOption);
10654 else if (fi.
isDir())
10656 err(
"Extra file '{}' specified in {} is a directory, it has to be a file!\n", fileName,filesOption);
10676 FileEntry(
const DString &p,
FileDef *fd) : path(p), fileDef(fd) {}
10682 std::vector<FileEntry> fileEntries;
10683 for (
const auto &fd : *fn)
10685 if (!fd->isReference())
10687 fileEntries.emplace_back(fd->getPath(),fd.get());
10691 size_t size = fileEntries.size();
10695 FileDef *fd = fileEntries[0].fileDef;
10701 std::stable_sort(fileEntries.begin(),
10703 [](
const FileEntry &fe1,
const FileEntry &fe2)
10704 { return dstricmp_sort(fe1.path,fe2.path)<0; }
10709 const FileEntry &first = fileEntries[0];
10710 const FileEntry &last = fileEntries[size-1];
10711 int first_path_size =
static_cast<int>(first.path.size())-1;
10712 int last_path_size =
static_cast<int>(last.path.size())-1;
10715 for (i=0;i<first_path_size && i<last_path_size;i++)
10717 if (first.path[i]==
'/') j=i;
10718 if (first.path[i]!=last.path[i])
break;
10720 if (i==first_path_size && i<last_path_size && last.path[i]==
'/')
10725 else if (i==last_path_size && i<first_path_size && first.path[i]==
'/')
10732 for (
auto &fileEntry : fileEntries)
10734 DString prefix = fileEntry.path.right(fileEntry.path.length()-j-1);
10735 fileEntry.fileDef->setName(
prefix+fn->fileName());
10737 fileEntry.fileDef->setDiskName(
prefix+fn->fileName());
10751 size_t sep = fileName.
rfind(
'/');
10752 size_t ei = fileName.
rfind(
'.');
10755 extension=fileName.
mid(ei);
10759 extension =
".no_extension";
10774 extension=fileName.
mid(ei);
10778 extension =
".no_extension";
10782 std::string preBuf;
10789 for (
const auto &s : includePath)
10791 std::string absPath =
FileInfo(s).absFilePath();
10795 msg(
"Preprocessing {}...\n",fn);
10802 msg(
"Reading {}...\n",fn);
10807 std::string convBuf;
10808 convBuf.reserve(preBuf.size()+1024);
10813 std::shared_ptr<Entry> fileRoot = std::make_shared<Entry>();
10817 if (newTU) clangParser->
parse();
10820 parser.
parseInput(fileName,convBuf.
data(),fileRoot,clangParser);
10821 fileRoot->setFileDef(fd);
10838 filesToProcess.insert(s);
10841 std::mutex processedFilesLock;
10843 std::size_t numThreads =
static_cast<std::size_t
>(
Config_getInt(NUM_PROC_THREADS));
10844 msg(
"Processing input using {} threads.\n",numThreads);
10846 using FutureType = std::vector< std::shared_ptr<Entry> >;
10847 std::vector< std::future< FutureType > > results;
10850 bool ambig =
false;
10857 auto processFile = [qs,&filesToProcess,&processedFilesLock,&processedFiles]() {
10858 bool ambig_l =
false;
10859 std::vector< std::shared_ptr<Entry> > roots;
10863 auto fileRoot {
parseFile(*parser.get(),fd_l,qs,clangParser.get(),
true) };
10864 roots.push_back(fileRoot);
10868 for (
auto incFile : clangParser->filesInSameTU())
10871 if (filesToProcess.find(incFile)!=filesToProcess.end())
10873 bool needsToBeProcessed =
false;
10875 std::lock_guard<std::mutex> lock(processedFilesLock);
10876 needsToBeProcessed = processedFiles.find(incFile)==processedFiles.end();
10877 if (needsToBeProcessed) processedFiles.insert(incFile);
10879 if (qincFile!=qs && needsToBeProcessed)
10885 fileRoot =
parseFile(*parser.get(),ifd,qincFile,clangParser.get(),
false);
10886 roots.push_back(fileRoot);
10894 results.emplace_back(threadPool.
queue(processFile));
10898 for (
auto &f : results)
10903 root->moveToSubEntryAndKeep(e);
10910 if (processedFiles.find(s)==processedFiles.end())
10913 auto processFile = [s]() {
10914 bool ambig =
false;
10916 std::vector< std::shared_ptr<Entry> > roots;
10923 auto fileRoot =
parseFile(*parser.get(),fd,qs,clangParser.get(),
true);
10924 roots.push_back(fileRoot);
10928 auto fileRoot =
parseFile(*parser.get(),fd,qs,
nullptr,
true);
10929 roots.push_back(fileRoot);
10933 results.emplace_back(threadPool.
queue(processFile));
10937 for (
auto &f : results)
10942 root->moveToSubEntryAndKeep(e);
10949 std::size_t numThreads =
static_cast<std::size_t
>(
Config_getInt(NUM_PROC_THREADS));
10950 msg(
"Processing input using {} threads.\n",numThreads);
10952 using FutureType = std::shared_ptr<Entry>;
10953 std::vector< std::future< FutureType > > results;
10957 auto processFile = [s]() {
10958 bool ambig =
false;
10962 auto fileRoot =
parseFile(*parser.get(),fd,qs,
nullptr,
true);
10966 results.emplace_back(threadPool.
queue(processFile));
10969 for (
auto &f : results)
10971 root->moveToSubEntryAndKeep(f.get());
10989 filesToProcess.insert(s);
10995 bool ambig =
false;
11003 auto fileRoot =
parseFile(*parser.get(),fd,qs,clangParser.get(),
true);
11004 root->moveToSubEntryAndKeep(fileRoot);
11005 processedFiles.insert(s);
11009 for (
auto incFile : clangParser->filesInSameTU())
11012 if (filesToProcess.find(incFile)!=filesToProcess.end() &&
11013 processedFiles.find(incFile)==processedFiles.end())
11019 fileRoot =
parseFile(*parser.get(),ifd,incFile,clangParser.get(),
false);
11020 root->moveToSubEntryAndKeep(fileRoot);
11021 processedFiles.insert(incFile);
11030 if (processedFiles.find(s)==processedFiles.end())
11032 bool ambig =
false;
11039 auto fileRoot =
parseFile(*parser.get(),fd,qs,clangParser.get(),
true);
11040 root->moveToSubEntryAndKeep(fileRoot);
11045 std::shared_ptr<Entry> fileRoot =
parseFile(*parser.get(),fd,qs,
nullptr,
true);
11046 root->moveToSubEntryAndKeep(fileRoot);
11048 processedFiles.insert(s);
11057 bool ambig =
false;
11062 std::shared_ptr<Entry> fileRoot =
parseFile(*parser.get(),fd,qs,
nullptr,
true);
11063 root->moveToSubEntryAndKeep(std::move(fileRoot));
11083 sepPos = result.
find(
'/',2);
11085 sepPos = result.
find(
'/',sepPos+1);
11087 sepPos = result.
find(
'/',sepPos+1);
11090 if (nonSymlinks.find(
prefix.str())==nonSymlinks.end())
11096 bool isRelative =
FileInfo(target.
str()).isRelative();
11107 target+=result.
mid(sepPos);
11110 if (known.find(result.
str())!=known.end())
return std::string();
11111 known.insert(result.
str());
11124 nonSymlinks.insert(
prefix.str());
11149 bool errorIfNotExist,
11156 if (paths && !dirName.empty())
11158 paths->insert(dirName);
11164 if (dirName.empty())
11179 msg(
"Searching for files in directory {}\n", fi->
absFilePath());
11184 for (
const auto &dirEntry : dir.
iterator())
11187 auto checkPatterns = [&]() ->
bool
11189 return (patList==
nullptr ||
patternMatch(cfi,*patList)) &&
11190 (exclPatList==
nullptr || !
patternMatch(cfi,*exclPatList)) &&
11191 (killSet==
nullptr || killSet->find(cfi.
absFilePath())==killSet->end());
11194 if (exclSet==
nullptr || exclSet->find(cfi.
absFilePath())==exclSet->end())
11202 if (errorIfNotExist && checkPatterns())
11207 else if (cfi.
isFile() && checkPatterns())
11210 std::string path=cfi.
dirPath()+
"/";
11211 std::string fullName=path+name;
11218 fn = fnMap->
add(name);
11219 fn->push_back(std::move(fd));
11222 dirResultList.push_back(fullName);
11223 if (resultSet) resultSet->insert(fullName);
11224 if (killSet) killSet->insert(fullName);
11226 else if (recursive &&
11228 (exclPatList==
nullptr || !
patternMatch(cfi,*exclPatList)) &&
11233 patList,exclPatList,&dirResultList,resultSet,errorIfNotExist,
11234 recursive,killSet,paths);
11238 if (resultList && !dirResultList.empty())
11241 std::stable_sort(dirResultList.begin(),
11242 dirResultList.end(),
11243 [](
const auto &f1,
const auto &f2) { return dstricmp_sort(f1.c_str(),f2.c_str())<0; });
11246 resultList->insert(resultList->end(), dirResultList.begin(), dirResultList.end());
11263 bool errorIfNotExist,
11270 if (s.
empty())
return;
11277 if (exclSet==
nullptr || exclSet->find(fi.
absFilePath())==exclSet->end())
11284 if (errorIfNotExist)
11286 warn_uncond(
"source '{}' is not a readable file or directory... skipping.\n",s);
11291 std::string dirPath = fi.
dirPath(
true);
11293 if (paths && !dirPath.empty())
11295 paths->insert(dirPath);
11298 if (killSet==
nullptr || killSet->find(filePath)==killSet->end())
11307 fn->push_back(std::move(fd));
11310 if (resultList || resultSet)
11312 if (resultList) resultList->push_back(filePath);
11313 if (resultSet) resultSet->insert(filePath);
11319 else if (fi.
isDir())
11321 readDir(&fi,fnMap,exclSet,patList,
11322 exclPatList,resultList,resultSet,errorIfNotExist,
11323 recursive,killSet,paths);
11337 anchor=
":"+md->
anchor();
11346 t <<
"REPLACE INTO symbols (symbol_id,scope_id,name,file,line) VALUES('"
11347 << fn+anchor <<
"','"
11349 << d->
name() <<
"','"
11363 for (
const auto &def : symList)
11375 msg(
"Developer parameters:\n");
11376 msg(
" -m dump symbol map\n");
11377 msg(
" -b making messages output unbuffered\n");
11378 msg(
" -c <file> process input file as a comment block and produce HTML output\n");
11380 msg(
" -t [<file|stdout|stderr>] trace debug info to file, stdout, or stderr (default file stdout)\n");
11381 msg(
" -t_time [<file|stdout|stderr>] trace debug info to file, stdout, or stderr (default file stdout),\n"
11382 " and include time and thread information\n");
11384 msg(
" -d <level> enable a debug level, such as (multiple invocations of -d are possible):\n");
11395 DString versionString = getFullVersion();
11396 msg(
"{}\n",versionString);
11400 if (!extVers.
empty()) extVers+=
", ";
11401 extVers +=
"sqlite3 ";
11402 extVers += sqlite3_libversion();
11404 if (!extVers.
empty()) extVers+=
", ";
11405 extVers +=
"clang support ";
11406 extVers += CLANG_VERSION_STRING;
11408 if (!extVers.
empty())
11412 extVers = extVers.
replace(lastComma,1,
" and");
11414 msg(
" with {}.\n",extVers);
11425 msg(
"Doxygen version {0}\nCopyright Dimitri van Heesch 1997-2025\n\n"
11426 "You can use Doxygen in a number of ways:\n\n"
11427 "1) Use Doxygen to generate a template configuration file*:\n"
11428 " {1} [-s] -g [configName]\n\n"
11429 "2) Use Doxygen to update an old configuration file*:\n"
11430 " {1} [-s] -u [configName]\n\n"
11431 "3) Use Doxygen to generate documentation using an existing "
11432 "configuration file*:\n"
11433 " {1} [configName]\n\n"
11434 "4) Use Doxygen to generate a template file controlling the layout of the\n"
11435 " generated documentation:\n"
11436 " {1} -l [layoutFileName]\n\n"
11437 " In case layoutFileName is omitted DoxygenLayout.xml will be used as filename.\n"
11438 " If - is used for layoutFileName Doxygen will write to standard output.\n\n"
11439 "5) Use Doxygen to generate a template style sheet file for RTF, HTML or Latex.\n"
11440 " RTF: {1} -w rtf styleSheetFile\n"
11441 " HTML: {1} -w html headerFile footerFile styleSheetFile [configFile]\n"
11442 " LaTeX: {1} -w latex headerFile footerFile styleSheetFile [configFile]\n\n"
11443 "6) Use Doxygen to generate a rtf extensions file\n"
11444 " {1} -e rtf extensionsFile\n\n"
11445 " If - is used for extensionsFile Doxygen will write to standard output.\n\n"
11446 "7) Use Doxygen to compare the used configuration file with the template configuration file\n"
11447 " {1} -x [configFile]\n\n"
11448 " Use Doxygen to compare the used configuration file with the template configuration file\n"
11449 " without replacing the environment variables or CMake type replacement variables\n"
11450 " {1} -x_noenv [configFile]\n\n"
11451 "8) Use Doxygen to show a list of built-in emojis.\n"
11452 " {1} -f emoji outputFileName\n\n"
11453 " If - is used for outputFileName Doxygen will write to standard output.\n\n"
11454 "*) If -s is specified the comments of the configuration items in the config file will be omitted.\n"
11455 " If configName is omitted 'Doxyfile' will be used as a default.\n"
11456 " If - is used for configFile Doxygen will write / read the configuration to /from standard output / input.\n\n"
11457 "If -q is used for a Doxygen documentation run, Doxygen will see this as if QUIET=YES has been set.\n\n"
11458 "-v print version string, -V print extended version information\n"
11459 "-h,-? prints usage help information\n"
11460 "{1} -d prints additional usage flags for debugging purposes\n",versionString,name);
11467static const char *
getArg(
int argc,
char **argv,
int &optInd)
11470 if (
dstrlen(&argv[optInd][2])>0)
11471 s=&argv[optInd][2];
11472 else if (optInd+1<argc && argv[optInd+1][0]!=
'-')
11491 return []() {
return std::make_unique<T>(); };
11499 std::setlocale(LC_ALL,
"");
11500 std::setlocale(LC_CTYPE,
"C");
11501 std::setlocale(LC_NUMERIC,
"C");
11599 DString versionString = getFullVersion();
11602 auto writeFile = [](
const char *fileName,std::function<void(
TextStream&)> func) ->
bool
11622 bool genConfig=
false;
11623 bool shortList=
false;
11624 bool traceTiming=
false;
11626 bool updateConfig=
false;
11627 bool quiet =
false;
11628 while (optInd<argc && argv[optInd][0]==
'-' &&
11629 (isalpha(argv[optInd][1]) || argv[optInd][1]==
'?' ||
11630 argv[optInd][1]==
'-')
11633 switch(argv[optInd][1])
11643 if (optInd+1>=argc)
11645 layoutName=
"DoxygenLayout.xml";
11649 layoutName=argv[optInd+1];
11657 if (optInd+1>=argc)
11659 msg(
"option \"-c\" is missing the file name to read\n");
11675 if (debugLabel.
empty())
11684 msg(
"option \"-d\" has unknown debug specifier: \"{}\".\n",debugLabel);
11694 if (!strcmp(argv[optInd]+1,
"t_time"))
11696 traceTiming =
true;
11698 else if (!strcmp(argv[optInd]+1,
"t"))
11700 traceTiming =
false;
11704 err(
"option should be \"-t\" or \"-t_time\", found: \"{}\".\n",argv[optInd]);
11708 if (optInd+1>=argc || argv[optInd+1][0] ==
'-')
11710 traceName=
"stdout";
11714 traceName=argv[optInd+1];
11718 err(
"support for option \"-t\" has not been compiled in (use a debug build or a release build with tracing enabled).\n");
11729 err(
"option should be \"-x\" or \"-x_noenv\", found: \"{}\".\n",argv[optInd]);
11743 if (formatName.
empty())
11745 err(
"option \"-e\" is missing format specifier rtf.\n");
11751 if (optInd+1>=argc)
11753 err(
"option \"-e rtf\" is missing an extensions file name\n");
11761 err(
"option \"-e\" has invalid format specifier.\n");
11769 if (listName.
empty())
11771 err(
"option \"-f\" is missing list specifier.\n");
11777 if (optInd+1>=argc)
11779 err(
"option \"-f emoji\" is missing an output file name\n");
11787 err(
"option \"-f\" has invalid list specifier.\n");
11795 if (formatName.
empty())
11797 err(
"option \"-w\" is missing format specifier rtf, html or latex\n");
11803 if (optInd+1>=argc)
11805 err(
"option \"-w rtf\" is missing a style sheet file name\n");
11811 err(
"error opening RTF style sheet file {}!\n",argv[optInd+1]);
11821 if (optInd+4<argc ||
FileInfo(
"Doxyfile").exists() ||
FileInfo(
"doxyfile").exists())
11827 err(
"error opening or reading configuration file {}!\n",argv[optInd+4]);
11832 if (optInd+3>=argc)
11834 err(
"option \"-w html\" does not have enough arguments\n");
11851 if (optInd+4<argc ||
FileInfo(
"Doxyfile").exists() ||
FileInfo(
"doxyfile").exists())
11856 err(
"error opening or reading configuration file {}!\n",argv[optInd+4]);
11861 if (optInd+3>=argc)
11863 err(
"option \"-w latex\" does not have enough arguments\n");
11879 err(
"Illegal format specifier \"{}\": should be one of rtf, html or latex\n",formatName);
11899 if (
dstrcmp(&argv[optInd][2],
"help")==0)
11901 usage(argv[0],versionString);
11904 else if (
dstrcmp(&argv[optInd][2],
"version")==0)
11910 else if ((
dstrcmp(&argv[optInd][2],
"Version")==0) ||
11911 (
dstrcmp(&argv[optInd][2],
"VERSION")==0))
11919 err(
"Unknown option \"-{}\"\n",&argv[optInd][1]);
11920 usage(argv[0],versionString);
11925 setvbuf(stdout,
nullptr,_IONBF,0);
11932 usage(argv[0],versionString);
11936 err(
"Unknown option \"-{:c}\"\n",argv[optInd][1]);
11937 usage(argv[0],versionString);
11948 TRACE(
"Doxygen version used: {}",getFullVersion());
11951 FileInfo configFileInfo1(
"Doxyfile"),configFileInfo2(
"doxyfile");
11954 if (configFileInfo1.exists())
11956 configName=
"Doxyfile";
11958 else if (configFileInfo2.
exists())
11960 configName=
"doxyfile";
11962 else if (genConfig)
11964 configName=
"Doxyfile";
11968 err(
"Doxyfile not found and no input file specified!\n");
11969 usage(argv[0],versionString);
11976 if (fi.
exists() ||
dstrcmp(argv[optInd],
"-")==0 || genConfig)
11978 configName=argv[optInd];
11982 err(
"configuration file {} not found!\n",argv[optInd]);
11983 usage(argv[0],versionString);
11997 err(
"could not open or read configuration file {}!\n",configName);
12069 for (
const auto &mapping : extMaps)
12087 err(
"Failed to map file extension '{}' to unsupported language '{}'.\n"
12088 "Check the EXTENSION_MAPPING setting in the config file.\n",
12093 msg(
"Adding custom extension mapping: '{}' will be treated as language '{}'\n",
12102 if (cd==
reinterpret_cast<void *
>(-1))
12104 term(
"unsupported character conversion: '{}'->'UTF-8': {}\n"
12105 "Check the 'INPUT_ENCODING' setting in the config file!\n",
12115 for (
const auto &mapping : fileEncod)
12131 if (cd==
reinterpret_cast<void *
>(-1))
12133 term(
"unsupported character conversion: '{}'->'UTF-8': {}\n"
12134 "Check the 'INPUT_FILE_ENCODING' setting in the config file!\n",
12135 encoding,strerror(errno));
12148 for (
const auto &s : expandAsDefinedList)
12166 signal(SIGINT,SIG_DFL);
12168 msg(
"Cleaning up...\n");
12183 if (generateTagFile.
empty())
return;
12188 err(
"cannot open tag file {} for writing\n", generateTagFile);
12192 tagFile <<
"<?xml version='1.0' encoding='UTF-8' standalone='yes' ?>\n";
12193 tagFile <<
"<tagfile doxygen_version=\"" << getDoxygenVersion() <<
"\"";
12194 std::string gitVersion = getGitVersion();
12195 if (!gitVersion.empty())
12197 tagFile <<
" doxygen_gitid=\"" << gitVersion <<
"\"";
12204 for (
const auto &fd : *fn)
12206 if (fd->isLinkableInProject()) fd->writeTagFile(tagFile);
12239 if (gd->isLinkableInProject()) gd->writeTagFile(tagFile);
12244 if (mod->isLinkableInProject()) mod->writeTagFile(tagFile);
12249 if (pd->isLinkableInProject()) pd->writeTagFile(tagFile);
12256 if (dd->isLinkableInProject()) dd->writeTagFile(tagFile);
12260 tagFile <<
"</tagfile>\n";
12268 msg(
"Exiting...\n");
12277 const DString &formatDirName,
12278 const char *defaultDirName)
12280 DString result = formatDirName;
12281 if (result.
empty())
12283 result = baseDirName + defaultDirName;
12285 else if (formatDirName[0]!=
'/' && (formatDirName.
length()==1 || formatDirName[1]!=
':'))
12287 result.
prepend(baseDirName+
"/");
12289 Dir formatDir(result.
str());
12292 term(
"Could not create output directory {}\n", result);
12306 g_s.
begin(
"Searching for include files...\n");
12309 for (
const auto &s : includePathList)
12327 g_s.
begin(
"Searching for example files...\n");
12330 for (
const auto &s : examplePathList)
12345 g_s.
begin(
"Searching for images...\n");
12348 for (
const auto &s : imagePathList)
12363 g_s.
begin(
"Searching for dot files...\n");
12366 for (
const auto &s : dotFileList)
12381 g_s.
begin(
"Searching for msc files...\n");
12384 for (
const auto &s : mscFileList)
12399 g_s.
begin(
"Searching for dia files...\n");
12402 for (
const auto &s : diaFileList)
12417 g_s.
begin(
"Searching for plantuml files...\n");
12420 for (
const auto &s : plantUmlFileList)
12435 g_s.
begin(
"Searching for mermaid files...\n");
12438 for (
const auto &s : mermaidFileList)
12453 g_s.
begin(
"Searching for files to exclude\n");
12455 for (
const auto &s : excludeList)
12473 g_s.
begin(
"Searching INPUT for files to process...\n");
12477 for (
const auto &s : inputList)
12480 size_t l = path.
length();
12484 if (path.
at(l-1)==
'\\' || path.
at(l-1)==
'/') path=path.
left(l-1);
12504 if (fileName->size()>1)
12506 std::stable_sort(fileName->begin(),fileName->end(),[](
const auto &f1,
const auto &f2)
12508 return dstricmp_sort(f1->absFilePath(),f2->absFilePath())<0;
12514 [](
const auto &f1,
const auto &f2)
12516 return dstricmp_sort(f1->front()->absFilePath(),f2->front()->absFilePath())<0;
12520 warn_uncond(
"No files to be processed, please check your settings, in particular INPUT, FILE_PATTERNS, and RECURSIVE\n");
12531 if (mdfileAsMainPage.
empty())
return;
12535 warn_uncond(
"Specified markdown mainpage '{}' does not exist\n",mdfileAsMainPage);
12538 bool ambig =
false;
12541 warn_uncond(
"Specified markdown mainpage '{}' has not been defined as input file\n",mdfileAsMainPage);
12560 DString versionString = getFullVersion();
12561 msg(
"Doxygen version used: {}\n",versionString);
12571 if (outputDirectory.
empty())
12577 Dir dir(outputDirectory.
str());
12581 if (!dir.
mkdir(outputDirectory.
str()))
12583 term(
"tag OUTPUT_DIRECTORY: Output directory '{}' does not "
12584 "exist and cannot be created\n",outputDirectory);
12588 msg(
"Notice: Output directory '{}' does not exist. "
12589 "I have created it for you.\n", outputDirectory);
12637 bool generateSitemap = !sitemapUrl.
empty();
12638 if (generateSitemap && !sitemapUrl.
endsWith(
"/"))
12645 bool generateEclipseHelp =
Config_getBool(GENERATE_ECLIPSEHELP);
12659 if (generateDocbook)
12699 if (curFontPath.
empty())
12703 if (!curFontPath.
empty())
12706 newFontPath+=curFontPath;
12722 bool defaultLayoutUsed =
false;
12723 if (layoutFileName.
empty())
12726 defaultLayoutUsed =
true;
12728 AUTO_TRACE_ADD(
"defaultLayoutUsed={}, layoutFileName={}",defaultLayoutUsed,layoutFileName);
12733 msg(
"Parsing layout file {}...\n",layoutFileName);
12736 else if (!defaultLayoutUsed)
12738 warn_uncond(
"failed to open layout file '{}' for reading! Using default settings.\n",layoutFileName);
12748 if (generateHtml) exclPatterns.push_back(htmlOutput.
str());
12749 if (generateDocbook) exclPatterns.push_back(docbookOutput.
str());
12750 if (generateXml) exclPatterns.push_back(xmlOutput.
str());
12751 if (generateLatex) exclPatterns.push_back(latexOutput.
str());
12752 if (generateRtf) exclPatterns.push_back(rtfOutput.
str());
12753 if (generateMan) exclPatterns.push_back(manOutput.
str());
12773 if (generateDocbook)
12784 std::shared_ptr<Entry> root = std::make_shared<Entry>();
12788 msg(
"Reading and parsing tag files\n");
12790 for (
const auto &s : tagFileList)
12842 g_s.
begin(
"Building macro definition list...\n");
12846 g_s.
begin(
"Building group list...\n");
12851 g_s.
begin(
"Building directory list...\n");
12856 g_s.
begin(
"Building namespace list...\n");
12861 g_s.
begin(
"Building file list...\n");
12865 g_s.
begin(
"Building class list...\n");
12869 g_s.
begin(
"Building concept list...\n");
12877 g_s.
begin(
"Computing nesting relations for classes...\n");
12890 g_s.
begin(
"Associating documentation with classes...\n");
12894 g_s.
begin(
"Associating documentation with concepts...\n");
12899 g_s.
begin(
"Associating documentation with modules...\n");
12903 g_s.
begin(
"Building example list...\n");
12907 g_s.
begin(
"Searching for enumerations...\n");
12915 g_s.
begin(
"Searching for documented typedefs...\n");
12921 g_s.
begin(
"Searching for documented sequences...\n");
12925 g_s.
begin(
"Searching for documented dictionaries...\n");
12930 g_s.
begin(
"Searching for members imported via using declarations...\n");
12937 g_s.
begin(
"Searching for included using directives...\n");
12941 g_s.
begin(
"Searching for documented variables...\n");
12945 g_s.
begin(
"Building interface member list...\n");
12948 g_s.
begin(
"Building member list...\n");
12952 g_s.
begin(
"Searching for friends...\n");
12956 g_s.
begin(
"Searching for documented defines...\n");
12960 g_s.
begin(
"Computing class inheritance relations...\n");
12965 g_s.
begin(
"Computing class usage relations...\n");
12969 g_s.
begin(
"Flushing cached template relations that have become invalid...\n");
12973 g_s.
begin(
"Warn for undocumented namespaces...\n");
12977 g_s.
begin(
"Computing class relations...\n");
12988 g_s.
begin(
"Add enum values to enums...\n");
12993 g_s.
begin(
"Searching for member function documentation...\n");
13005 g_s.
begin(
"Creating members for template instances...\n");
13009 g_s.
begin(
"Searching for tag less structs...\n");
13013 g_s.
begin(
"Building page list...\n");
13017 g_s.
begin(
"Building requirements list...\n");
13021 g_s.
begin(
"Search for main page...\n");
13026 g_s.
begin(
"Computing page relations...\n");
13031 g_s.
begin(
"Determining the scope of groups...\n");
13035 g_s.
begin(
"Computing module relations...\n");
13037 mm.resolvePartitions();
13038 mm.resolveImports();
13039 mm.collectExportedSymbols();
13058 return i==0 ?
dstricmp_sort(c1->name(), c2->name())<0 : i<0;
13093 g_s.
begin(
"Determining which enums are documented\n");
13097 g_s.
begin(
"Computing member relations...\n");
13102 g_s.
begin(
"Building full member lists recursively...\n");
13106 g_s.
begin(
"Adding members to member groups.\n");
13112 g_s.
begin(
"Distributing member group documentation.\n");
13117 g_s.
begin(
"Computing member references...\n");
13123 g_s.
begin(
"Inheriting documentation...\n");
13131 g_s.
begin(
"Generating disk names...\n");
13135 g_s.
begin(
"Adding source references...\n");
13139 g_s.
begin(
"Adding xrefitems...\n");
13144 g_s.
begin(
"Adding requirements...\n");
13149 g_s.
begin(
"Sorting member lists...\n");
13153 g_s.
begin(
"Setting anonymous enum type...\n");
13157 g_s.
begin(
"Computing dependencies between directories...\n");
13161 g_s.
begin(
"Generating citations page...\n");
13165 g_s.
begin(
"Counting data structures...\n");
13169 g_s.
begin(
"Resolving user defined references...\n");
13173 g_s.
begin(
"Finding anchors and sections in the documentation...\n");
13177 g_s.
begin(
"Transferring function references...\n");
13181 g_s.
begin(
"Combining using relations...\n");
13186 g_s.
begin(
"Adding members to index pages...\n");
13191 g_s.
begin(
"Correcting members for VHDL...\n");
13195 g_s.
begin(
"Computing tooltip texts...\n");
13203 [](
const auto &g1,
const auto &g2)
13204 {
return g1->groupTitle() < g2->groupTitle(); });
13208 gd->sortSubGroups();
13252 if (generateDocbook)
13272 err(
"USE_HTAGS is YES but htags(1) failed. \n");
13274 err(
"htags(1) ended normally but failed to load the filemap. \n");
13281 g_s.
begin(
"Generating style sheet...\n");
13289 g_s.
begin(
"Generating search indices...\n");
13290 if (searchEngine && !serverBasedSearch && generateHtml)
13298 if (generateHtml && searchEngine)
13301 Dir searchDir(searchDirName.
str());
13302 if (!searchDir.
exists() && !searchDir.
mkdir(searchDirName.
str()))
13304 term(
"Could not create search results directory '{}' $PWD='{}'\n",
13308 if (!serverBasedSearch)
13330 if (generateDocbook)
13346 g_s.
begin(
"Generating images for formulas in HTML...\n");
13353 g_s.
begin(
"Generating images for formulas in RTF...\n");
13360 g_s.
begin(
"Generating images for formulas in Docbook...\n");
13365 g_s.
begin(
"Generating example documentation...\n");
13369 g_s.
begin(
"Generating file sources...\n");
13373 g_s.
begin(
"Counting members...\n");
13379 g_s.
begin(
"Generating file documentation...\n");
13383 g_s.
begin(
"Generating page documentation...\n");
13387 g_s.
begin(
"Generating group documentation...\n");
13391 g_s.
begin(
"Generating class documentation...\n");
13395 g_s.
begin(
"Generating concept documentation...\n");
13399 g_s.
begin(
"Generating module documentation...\n");
13403 g_s.
begin(
"Generating namespace documentation...\n");
13409 g_s.
begin(
"Generating graph info page...\n");
13414 g_s.
begin(
"Generating directory documentation...\n");
13423 g_s.
begin(
"finalizing index lists...\n");
13427 g_s.
begin(
"writing tag file...\n");
13433 g_s.
begin(
"Generating XML output...\n");
13441 g_s.
begin(
"Generating SQLITE3 output...\n");
13448 g_s.
begin(
"Generating AutoGen DEF output...\n");
13454 g_s.
begin(
"Generating Perl module output...\n");
13458 if (generateHtml && searchEngine && serverBasedSearch)
13460 g_s.
begin(
"Generating search index\n");
13470 if (searchDataFile.
empty())
13472 searchDataFile=
"searchdata.xml";
13485 g_s.
begin(
"Combining RTF output...\n");
13488 err(
"An error occurred during post-processing the RTF files!\n");
13495 g_s.
begin(
"Running plantuml with JAVA...\n");
13502 g_s.
begin(
"Running mermaid (mmdc)...\n");
13514 if (generateHtml &&
13518 g_s.
begin(
"Running html help compiler...\n");
13523 if ( generateHtml &&
13527 g_s.
begin(
"Running qhelpgenerator...\n");
13540 std::size_t numThreads =
static_cast<std::size_t
>(
Config_getInt(NUM_PROC_THREADS));
13541 if (numThreads<1) numThreads=1;
13542 msg(
"Total elapsed time: {:.6f} seconds\n(of which an average of {:.6f} seconds per thread waiting for external tools to finish)\n",
13549 msg(
"finished...\n");
13554 msg(
"finished...\n");
std::vector< ArgumentList > ArgumentLists
This class represents an function or template argument list.
RefQualifierType refQualifier() const
bool noParameters() const
bool pureSpecifier() const
bool hasParameters() const
DString trailingReturnType() const
void setPureSpecifier(bool b)
bool constSpecifier() const
void setTrailingReturnType(const DString &s)
void push_back(const Argument &a)
void setConstSpecifier(bool b)
void setRefQualifier(RefQualifierType t)
void setIsDeleted(bool b)
bool volatileSpecifier() const
void setNoParameters(bool b)
void setVolatileSpecifier(bool b)
static CitationManager & instance()
void clear()
clears the database
void generatePage()
Generate the citations page.
std::unique_ptr< ClangTUParser > createTUParser(const FileDef *fd) const
static ClangParser * instance()
Returns the one and only instance of the class.
Clang parser object for a single translation unit, which consists of a source file and the directly o...
void switchToFile(const FileDef *fd)
Switches to another file within the translation unit started with start().
void parse()
Parse the file given at construction time as a translation unit This file should already be preproces...
A abstract class representing of a compound symbol.
virtual DString requiresClause() const =0
virtual const MemberDef * getMemberByName(const DString &) const =0
Returns the member with the given name.
virtual const ArgumentList & templateArguments() const =0
Returns the template arguments of this class.
virtual void writeDocumentation(OutputList &ol) const =0
virtual void writeMemberList(OutputList &ol) const =0
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 int isBaseClass(const ClassDef *bcd, bool followInstances, const DString &templSpec=DString()) const =0
Returns true iff bcd is a direct or indirect base class of this class.
virtual const TemplateInstanceList & getTemplateInstances() const =0
Returns a sorted dictionary with all template instances found for this template class.
virtual ArgumentLists getTemplateParameterLists() const =0
Returns the template parameter lists that form the template declaration of this class.
virtual Protection protection() const =0
Return the protection level (Public,Protected,Private) in which this compound was found.
virtual DString compoundTypeString() const =0
Returns the type of compound as a string.
virtual MemberList * getMemberList(MemberListType lt) const =0
Returns the members in the list identified by lt.
virtual std::unique_ptr< ClassDef > deepCopy(const DString &name) const =0
virtual bool isForwardDeclared() const =0
Returns true if this class represents a forward declaration of a template class.
virtual bool isSubClass(ClassDef *bcd, int level=0) const =0
Returns true iff bcd is a direct or indirect sub class of this class.
virtual void moveTo(Definition *)=0
virtual const TemplateNameMap & getTemplateBaseClassNames() const =0
virtual DString qualifiedNameWithTemplateParameters(const ArgumentLists *actualParams=nullptr, uint32_t *actualParamIndex=nullptr) const =0
virtual bool isEmbeddedInOuterScope() const =0
virtual const MemberNameInfoLinkedMap & memberNameInfoLinkedMap() const =0
Returns a dictionary of all members.
virtual bool isImplicitTemplateInstance() const =0
virtual const ClassDef * templateMaster() const =0
Returns the template master of which this class is an instance.
CompoundType
The various compound types.
virtual CompoundType compoundType() const =0
Returns the type of compound this is, i.e. class/struct/union/...
virtual bool containsOverload(const MemberDef *md) const =0
virtual ClassLinkedRefMap getClasses() const =0
returns the classes nested into this class
virtual FileDef * getFileDef() const =0
Returns the namespace this compound is in, or 0 if it has a global scope.
virtual void writeTagFile(TextStream &) const =0
virtual void writeDocumentationForInnerClasses(OutputList &ol) const =0
virtual void computeAnchors()=0
virtual void addTypeConstraints()=0
virtual void overrideCollaborationGraph(bool e)=0
virtual void addUsedClass(ClassDef *cd, const DString &accessName, Protection prot)=0
virtual void insertExplicitTemplateInstance(ClassDef *instance, const DString &spec)=0
virtual void countMembers()=0
virtual void addMembersToMemberGroup()=0
virtual void setPrimaryConstructorParams(const ArgumentList &list)=0
virtual void setTemplateBaseClassNames(const TemplateNameMap &templateNames)=0
virtual void setClassName(const DString &name)=0
virtual void setFileDef(FileDef *fd)=0
virtual void reclassifyMember(MemberDefMutable *md, MemberType t)=0
virtual ClassDef * insertTemplateInstance(const DString &fileName, int startLine, int startColumn, const DString &templSpec, bool &freshInstance)=0
virtual void setTemplateArguments(const ArgumentList &al)=0
virtual void setTemplateMaster(const ClassDef *tm)=0
virtual void makeTemplateArgument(bool b=true)=0
virtual void mergeCategory(ClassDef *category)=0
virtual void addQualifiers(const StringVector &qualifiers)=0
virtual void setClassSpecifier(TypeSpecifier spec)=0
virtual void insertUsedFile(const FileDef *)=0
virtual void setTagLessReference(const ClassDef *cd)=0
virtual void setUsedOnly(bool b)=0
virtual void sortMemberLists()=0
virtual void setProtection(Protection p)=0
virtual void setTypeConstraints(const ArgumentList &al)=0
virtual void overrideInheritanceGraph(CLASS_GRAPH_t e)=0
virtual void setAnonymousEnumType()=0
virtual void setCompoundType(CompoundType t)=0
virtual void distributeMemberGroupDocumentation()=0
virtual void setMetaData(const DString &md)=0
virtual void findSectionsInDocumentation()=0
virtual void insertMember(MemberDef *)=0
virtual void sortAllMembersList()=0
virtual void mergeMembers()=0
virtual void setIsStatic(bool b)=0
virtual void addMembersToTemplateInstance(const ClassDef *cd, const ArgumentList &templateArguments, const DString &templSpec)=0
virtual void insertSubClass(ClassDef *, Protection p, Specifier s, const DString &t=DString())=0
virtual void addUsedByClass(ClassDef *cd, const DString &accessName, Protection prot)=0
virtual void setSubGrouping(bool enabled)=0
virtual void setRequiresClause(const DString &req)=0
virtual void insertBaseClass(ClassDef *, const DString &name, Protection p, Specifier s, const DString &t=DString())=0
virtual void addCodePart(const DString &code, int lineNr, int colNr)=0
virtual void setFileDef(FileDef *fd)=0
virtual void writeTagFile(TextStream &)=0
virtual void writeDocumentation(OutputList &ol)=0
virtual void addDocPart(const DString &doc, int lineNr, int colNr)=0
virtual void setGroupId(int id)=0
virtual void setInitializer(const DString &init)=0
virtual void findSectionsInDocumentation()=0
virtual void setTemplateArguments(const ArgumentList &al)=0
A String class for use with Doxygen wrapping std::string and adding some additional functionality off...
DString & setNum(short n)
void resize(size_t newlen)
size_t rfind(char c, size_t pos=npos) const
DString mid(size_t index, size_t len=npos) const
bool empty() const
Returns true iff the string is empty (std::string compatible alias for isEmpty()).
DString & replace(size_t index, size_t len, const char *s)
DString substr(size_t pos=0, size_t count=npos) const
Returns a substring of length count starting at pos.
static constexpr size_t npos
value used to indicate 'not found' or 'to the end of the string', matching std::string::npos
char & at(size_t i)
Returns a reference to the character at index i.
DString right(size_t len) const
size_t size() const
Returns the length of the string, not counting the 0-terminator.
DString fill(char c, int len=-1)
Fills a string with a predefined character.
DString & prepend(const char *s)
int contains(char c, bool cs=true) const
size_t find(char c, size_t pos=0) const
DString & sprintf(const char *format,...)
DString stripWhiteSpace() const
returns a copy of this string with leading and trailing whitespace removed
DString left(size_t len) const
const std::string & str() const
bool stripPrefix(const DString &prefix)
const char * data() const
Returns a pointer to the contents of the string in the form of a 0-terminated C string.
bool startsWith(const char *s) const
bool endsWith(const char *s) const
size_t length() const
Returns the length of the string, not counting the 0-terminator.
static void clearFlag(const DebugMask mask)
static bool isFlagSet(const DebugMask mask)
static void print(DebugMask mask, int prio, fmt::format_string< Args... > fmt, Args &&... args)
static double elapsedTime()
static bool setFlagStr(const DString &label)
static void setFlag(const DebugMask mask)
The common base class of all entity definitions found in the sources.
virtual DString briefDescription(bool abbreviate=false) const =0
virtual DString inbodyFile() const =0
virtual int getEndBodyLine() const =0
virtual DString briefFile() const =0
virtual SrcLangExt getLanguage() const =0
Returns the programming language this definition was written in.
virtual int docLine() const =0
virtual DString getDefFileName() const =0
virtual DString documentation() const =0
virtual bool isLinkable() const =0
virtual DString inbodyDocumentation() const =0
virtual int getDefLine() const =0
virtual DefType definitionType() const =0
virtual const DString & name() const =0
virtual const DString & localName() const =0
virtual int inbodyLine() const =0
virtual const FileDef * getBodyDef() const =0
virtual int briefLine() const =0
virtual bool hasDocumentation() const =0
virtual bool isLinkableInProject() const =0
virtual bool isAnonymous() const =0
virtual DString displayName(bool includeScope=true) const =0
virtual DString qualifiedName() const =0
virtual bool isHidden() const =0
virtual DString anchor() const =0
virtual int getStartDefLine() const =0
virtual const GroupList & partOfGroups() const =0
virtual bool isArtificial() const =0
virtual Definition * getOuterScope() const =0
virtual DString docFile() const =0
virtual int getStartBodyLine() const =0
virtual int getDefColumn() const =0
virtual bool isReference() const =0
virtual const Definition * findInnerCompound(const DString &name) const =0
virtual DString getOutputFileBase() const =0
virtual void mergeReferencedBy(const Definition *other)=0
virtual void setName(const DString &name)=0
virtual void setExported(bool b)=0
virtual void setBodySegment(int defLine, int bls, int ble)=0
virtual void setDefFile(const DString &df, int defLine, int defColumn)=0
virtual void setHidden(bool b)=0
virtual void setReference(const DString &r)=0
virtual void mergeReferences(const Definition *other)=0
virtual void setInbodyDocumentation(const DString &d, const DString &docFile, int docLine)=0
virtual void setDocumentation(const DString &d, const DString &docFile, int docLine, bool stripWhiteSpace=true)=0
virtual void addInnerCompound(Definition *d)=0
virtual void addSectionsToDefinition(const std::vector< const SectionInfo * > &anchorList)=0
virtual void setLanguage(SrcLangExt lang)=0
virtual void setOuterScope(Definition *d)=0
virtual void setArtificial(bool b)=0
virtual void setBriefDescription(const DString &b, const DString &briefFile, int briefLine)=0
virtual void makePartOfGroup(GroupDef *gd)=0
virtual void setBodyDef(const FileDef *fd)=0
virtual void setRequirementReferences(const RequirementRefs &rqli)=0
virtual void setId(const DString &name)=0
virtual void setRefItems(const RefItemVector &sli)=0
virtual void computeTooltip()=0
A model of a directory symbol.
virtual void overrideDirectoryGraph(bool e)=0
Class representing a directory in the file system.
static std::string currentDirPath()
std::string absPath() const
bool mkdir(const std::string &path, bool acceptsAbsPath=true) const
void setPath(const std::string &path)
bool remove(const std::string &path, bool acceptsAbsPath=true) const
DirIterator iterator() const
static std::string cleanDirPath(const std::string &path)
static bool setCurrent(const std::string &path)
A linked map of directories.
A class that generates docset files.
static DotManager * instance()
static NamespaceLinkedMap * namespaceLinkedMap
static ConceptLinkedMap * conceptLinkedMap
static bool suppressDocWarnings
static FileNameLinkedMap * plantUmlFileNameLinkedMap
static bool parseSourcesNeeded
static StringUnorderedSet inputPaths
static std::unique_ptr< PageDef > mainPage
static bool clangAssistedParsing
static StringUnorderedSet expandAsDefinedSet
static FileNameLinkedMap * inputNameLinkedMap
static DString filterDBFileName
static ParserManager * parserManager
static InputFileEncodingList inputFileEncodingList
static DString verifiedDotPath
static ClassLinkedMap * classLinkedMap
static MemberNameLinkedMap * functionNameLinkedMap
static PageLinkedMap * exampleLinkedMap
static FileNameLinkedMap * dotFileNameLinkedMap
static NamespaceDefMutable * globalScope
static FileNameLinkedMap * imageNameLinkedMap
static FileNameLinkedMap * mscFileNameLinkedMap
static FileNameLinkedMap * mermaidFileNameLinkedMap
static MemberGroupInfoMap memberGroupInfoMap
static IndexList * indexList
static StaticInitMap staticInitMap
static StringMap tagDestinationMap
static std::mutex countFlowKeywordsMutex
static ClassLinkedMap * hiddenClassLinkedMap
static FileNameLinkedMap * diaFileNameLinkedMap
static PageLinkedMap * pageLinkedMap
static bool generatingXmlOutput
static std::unique_ptr< NamespaceDef > globalNamespaceDef
static DString htmlFileExtension
static DefinesPerFileList macroDefinitions
static DirLinkedMap * dirLinkedMap
static NamespaceAliasInfoMap namespaceAliasMap
static MemberNameLinkedMap * memberNameLinkedMap
static SymbolMap< Definition > * symbolMap
static StringUnorderedSet tagFileSet
static FileNameLinkedMap * includeNameLinkedMap
static FileNameLinkedMap * exampleNameLinkedMap
static SearchIndexIntf searchIndex
static DirRelationLinkedMap dirRelations
static std::mutex addExampleMutex
static ClangUsrMap * clangUsrMap
static GroupLinkedMap * groupLinkedMap
Generator for Eclipse help files.
static EmojiEntityMapper & instance()
Returns the one and only instance of the Emoji entity mapper.
void writeEmojiFile(TextStream &t)
Writes the list of supported emojis to the given file.
Represents an unstructured piece of information, about an entity found in the sources.
TextStream initializer
initial value (for variables)
VhdlSpecifier vhdlSpec
VHDL specifiers.
bool subGrouping
automatically group class members?
RequirementRefs rqli
references to requirements
const std::vector< std::shared_ptr< Entry > > & children() const
GroupDocType groupDocType
int docLine
line number at which the documentation was found
DString includeName
include name (3 arg of \class)
DString bitfields
member's bit fields
ArgumentList typeConstr
where clause (C#) for type constraints
void markAsProcessed() const
int endBodyLine
line number where the definition ends
DString write
property write accessor
bool exported
is the symbol exported from a C++20 module
const TagInfo * tagInfo() const
DString includeFile
include file (2 arg of \class, must be unique)
DString fileName
file this entry was extracted from
ArgumentLists tArgLists
template argument declarations
DString docFile
file in which the documentation was found
MethodTypes mtype
signal, slot, (dcop) method, or property?
@ GROUPDOC_NORMAL
defgroup
DString args
member argument string
SrcLangExt lang
programming language in which this entry was found
DString inside
name of the class in which documents are found
DString doc
documentation block (partly parsed)
DString req
C++20 requires clause.
int startColumn
start column of entry in the source
bool explicitExternal
explicitly defined as external?
DString brief
brief description (doc block)
std::vector< const SectionInfo * > anchors
list of anchors defined in this entry
RelatesType relatesType
how relates is handled
std::vector< Grouping > groups
list of groups this entry belongs to
CommandOverrides commandOverrides
store info for commands whose default can be overridden
int startLine
start line of entry in the source
ArgumentList argList
member arguments as a list
int inbodyLine
line number at which the body doc was found
EntryType section
entry type (see Sections);
int bodyLine
line number of the body in the source
DString exception
throw specification
DString relates
related class (doc block)
int mGrpId
member group id
std::vector< BaseInfo > extends
list of base classes
DString inbodyFile
file in which the body doc was found
Specifier virt
virtualness of the entry
DString metaData
Slice metadata.
std::vector< std::string > qualifiers
qualifiers specified with the qualifier command
RefItemVector sli
special lists (test/todo/bug/deprecated/..) this entry is in
Protection protection
class protection
bool artificial
Artificially introduced item.
bool hidden
does this represent an entity that is hidden from the output
DString inbodyDocs
documentation inside the body of a function
int briefLine
line number at which the brief desc. was found
FileDef * fileDef() const
int initLines
define/variable initializer lines to show
TypeSpecifier spec
class/member specifiers
DString briefFile
file in which the brief desc. was found
DString read
property read accessor
Wrapper class for the Entry type.
constexpr bool isCompoundDoc() const noexcept
constexpr bool isFile() const noexcept
constexpr bool isDoc() const noexcept
ENTRY_TYPES constexpr bool isCompound() const noexcept
std::string to_string() const
constexpr bool isScope() const noexcept
A class that generates a dynamic tree view side panel.
A model of a file symbol.
virtual void addUsingDeclaration(const Definition *d)=0
virtual void removeMember(MemberDef *md)=0
virtual void insertClass(ClassDef *cd)=0
virtual void setDiskName(const DString &name)=0
virtual void insertConcept(ConceptDef *cd)=0
virtual void overrideIncludeGraph(bool e)=0
virtual void writeSourceHeader(OutputList &ol)=0
virtual bool generateSourceFile() const =0
virtual DString absFilePath() const =0
virtual const DString & docName() const =0
virtual const LinkedRefMap< NamespaceDef > & getUsedNamespaces() const =0
virtual bool isSource() const =0
virtual void parseSource(ClangTUParser *clangParser)=0
virtual void getAllIncludeFilesRecursively(StringVector &incFiles) const =0
virtual void writeSourceFooter(OutputList &ol)=0
virtual void writeSourceBody(OutputList &ol, ClangTUParser *clangParser)=0
virtual void addUsingDirective(NamespaceDef *nd)=0
virtual void overrideIncludedByGraph(bool e)=0
virtual void insertMember(MemberDef *md)=0
virtual void insertNamespace(NamespaceDef *nd)=0
Minimal replacement for QFileInfo.
std::string readLink() const
FileInfo(const std::string &name)
std::string fileName() const
std::string dirPath(bool absPath=true) 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 DString groupTitle() const =0
virtual void overrideGroupGraph(bool e)=0
virtual bool addClass(ClassDef *def)=0
virtual bool containsFile(const FileDef *def) const =0
virtual bool addNamespace(NamespaceDef *def)=0
virtual void setGroupScope(Definition *d)=0
virtual void addFile(FileDef *def)=0
virtual void setGroupTitle(const DString &newtitle)=0
virtual MemberList * getMemberList(MemberListType lt) const =0
virtual bool hasGroupTitle() const =0
Generator for HTML output.
static void writeSearchData(const DString &dir)
static void writeSearchPage()
static void writeHeaderFile(TextStream &t, const DString &cssname)
static void writeFooterFile(TextStream &t)
static void writeTabData()
Additional initialization after indices have been created.
static void writeExternalSearchPage()
static void writeStyleSheetFile(TextStream &t)
A class that generated the HTML Help specific files.
static const DString hhpFileName
static Index & instance()
void countDataStructures()
A list of index interfaces.
void addIndexItem(const Definition *context, const MemberDef *md, const DString §ionAnchor=DString(), const DString &title=DString())
void addIndex(As &&... args)
Add an index generator to the list, using a syntax similar to std::make_unique<T>().
void addImageFile(const DString &name)
Generator for LaTeX output.
static void writeFooterFile(TextStream &t)
static void writeStyleSheetFile(TextStream &t)
static void writeHeaderFile(TextStream &t)
void parse(const DString &fileName, const char *data=nullptr)
Parses a user provided layout.
static LayoutDocManager & instance()
Returns a reference to this singleton.
std::unique_ptr< RefList > Ptr
T * add(const char *k, Args &&... args)
const T * find(const std::string &key) const
Container class representing a vector of objects with keys.
const T * find(const std::string &key) const
Generator for Man page output.
A model of a class/file/namespace member symbol.
virtual DString requiresClause() const =0
virtual bool isFriend() const =0
virtual DString argsString() const =0
virtual bool isForeign() const =0
virtual bool isRelated() const =0
virtual DString definition() const =0
virtual const ClassDef * getCachedTypedefVal() const =0
virtual const ClassDef * getClassDef() const =0
virtual DString excpString() const =0
virtual const ArgumentList & templateArguments() const =0
virtual const DString & initializer() const =0
virtual GroupDef * getGroupDef()=0
virtual bool isCSharpProperty() const =0
virtual bool isTypedef() const =0
virtual const MemberVector & enumFieldList() const =0
virtual void moveTo(Definition *)=0
virtual const FileDef * getFileDef() const =0
virtual const ArgumentList & argumentList() const =0
virtual bool isStrongEnumValue() const =0
virtual VhdlSpecifier getVhdlSpecifiers() const =0
virtual bool isFunction() const =0
virtual bool isExternal() const =0
virtual int getMemberGroupId() const =0
virtual DString bitfieldString() const =0
virtual bool isStatic() const =0
virtual const MemberDef * reimplements() const =0
virtual StringVector getQualifiers() const =0
virtual bool isTypedefValCached() const =0
virtual bool isDocsForDefinition() const =0
virtual bool isDefine() const =0
virtual const NamespaceDef * getNamespaceDef() const =0
virtual bool isObjCProperty() const =0
virtual Protection protection() const =0
virtual TypeSpecifier getMemberSpecifiers() const =0
virtual bool isEnumerate() const =0
virtual MemberType memberType() const =0
virtual ClassDef * relatedAlso() const =0
virtual bool isVariable() const =0
virtual bool isStrong() const =0
virtual DString typeString() const =0
virtual Specifier virtualness(int count=0) const =0
virtual int redefineCount() const =0
virtual int initializerLines() const =0
virtual const MemberDef * getEnumScope() const =0
virtual bool isEnumValue() const =0
virtual bool isPrototype() const =0
virtual void setRequiresClause(const DString &req)=0
virtual void setClassDefOfAnonymousType(const ClassDef *cd)=0
virtual void setMemberClass(ClassDef *cd)=0
virtual void setProtection(Protection p)=0
virtual void setDefinition(const DString &d)=0
virtual void setMemberGroupId(int id)=0
virtual void setDocumentedEnumValues(bool value)=0
virtual void setMemberSpecifiers(TypeSpecifier s)=0
virtual void setToAnonymousMember(MemberDef *m)=0
virtual ClassDefMutable * getClassDefMutable()=0
virtual void setArgsString(const DString &as)=0
virtual void setExplicitExternal(bool b, const DString &df, int line, int column)=0
virtual void setEnumScope(MemberDef *md, bool livesInsideEnum=false)=0
virtual void setDefinitionTemplateParameterLists(const ArgumentLists &lists)=0
virtual void invalidateTypedefValCache()=0
virtual void setVhdlSpecifiers(VhdlSpecifier s)=0
virtual void setEnumClassScope(ClassDef *cd)=0
virtual void setInitializer(const DString &i)=0
virtual void setMaxInitLines(int lines)=0
virtual void setInheritsDocsFrom(const MemberDef *md)=0
virtual void setRelatedAlso(ClassDef *cd)=0
virtual void overrideReferencesRelation(bool e)=0
virtual void makeForeign()=0
virtual void overrideReferencedByRelation(bool e)=0
virtual void setDocsForDefinition(bool b)=0
virtual void overrideCallGraph(bool e)=0
virtual void overrideInlineSource(bool e)=0
virtual void setBitfields(const DString &s)=0
virtual void copyArgumentNames(const MemberDef *bmd)=0
virtual void overrideEnumValues(bool e)=0
virtual void setPrototype(bool p, const DString &df, int line, int column)=0
virtual void mergeMemberSpecifiers(TypeSpecifier s)=0
virtual void addQualifiers(const StringVector &qualifiers)=0
virtual void insertEnumField(MemberDef *md)=0
virtual void moveDeclArgumentList(std::unique_ptr< ArgumentList > al)=0
virtual void setAnonymousEnumType(const MemberDef *md)=0
virtual void overrideCallerGraph(bool e)=0
virtual void setReimplements(MemberDef *md)=0
virtual void invalidateCachedArgumentTypes()=0
virtual void setDeclFile(const DString &df, int line, int column)=0
virtual void moveArgumentList(std::unique_ptr< ArgumentList > al)=0
virtual void makeRelated()=0
virtual void insertReimplementedBy(MemberDef *md)=0
A list of MemberDef objects as shown in documentation sections.
Wrapper class for the MemberListType type.
Ordered dictionary of MemberName objects.
MemberName::Ptr take(const DString &key, const MemberDef *value)
const MemberDef * findRev(const DString &name) const
const MemberDef * find(const DString &name) const
void run()
Run mmdc tool for all collected diagrams.
static MermaidManager & instance()
static ModuleManager & instance()
void addDocs(const Entry *root)
void addConceptToModule(const Entry *root, ConceptDef *cd)
void addClassToModule(const Entry *root, ClassDef *cd)
void addMemberToModule(const Entry *root, MemberDef *md)
void writeDocumentation(OutputList &ol)
void addMembersToMemberGroup()
void findSectionsInDocumentation()
void distributeMemberGroupDocumentation()
An abstract interface of a namespace symbol.
virtual const LinkedRefMap< NamespaceDef > & getUsedNamespaces() const =0
virtual bool isInline() const =0
virtual void insertUsedFile(FileDef *fd)=0
virtual void findSectionsInDocumentation()=0
virtual void countMembers()=0
virtual void addUsingDirective(NamespaceDef *nd)=0
virtual void setFileName(const DString &fn)=0
virtual void insertMember(MemberDef *md)=0
virtual void setMetaData(const DString &m)=0
virtual void addUsingDeclaration(const Definition *d)=0
virtual void distributeMemberGroupDocumentation()=0
virtual void writeTagFile(TextStream &)=0
virtual void writeDocumentation(OutputList &ol)=0
virtual void setInline(bool isInline)=0
virtual void computeAnchors()=0
virtual void combineUsingRelations(NamespaceDefSet &visitedNamespace)=0
virtual void sortMemberLists()=0
virtual void addMembersToMemberGroup()=0
void parseInput(const DString &, const char *, const std::shared_ptr< Entry > &, ClangTUParser *) override
Parses a single input file with the goal to build an Entry tree.
void parsePrototype(const DString &) override
Callback function called by the comment block scanner.
bool needsPreprocessing(const DString &) const override
Returns true if the language identified by extension needs the C preprocessor to be run before feed t...
Abstract interface for outline parsers.
virtual bool needsPreprocessing(const DString &extension) const =0
Returns true if the language identified by extension needs the C preprocessor to be run before feed t...
virtual void parseInput(const DString &fileName, const char *fileBuf, const std::shared_ptr< Entry > &root, ClangTUParser *clangParser)=0
Parses a single input file with the goal to build an Entry tree.
Class representing a list of output generators that are written to in parallel.
void disable(OutputType o)
void enable(OutputType o)
void docify(const DString &s)
void writeStyleInfo(int part)
void generateDoc(const DString &fileName, int startLine, const Definition *ctx, const MemberDef *md, const DString &docStr, const DocOptions &options)
A model of a page symbol.
virtual void setLocalToc(const LocalToc &tl)=0
virtual void setFileName(const DString &name)=0
virtual void setShowLineNo(bool)=0
virtual void setPageScope(Definition *)=0
virtual const GroupDef * getGroupDef() const =0
Manages programming language parsers.
std::unique_ptr< CodeParserInterface > getCodeParser(const DString &extension)
Gets the interface to the parser associated with a given extension.
void registerParser(const DString &name, const OutlineParserFactory &outlineParserFactory, const CodeParserFactory &codeParserFactory)
Registers an additional parser.
ParserManager(const OutlineParserFactory &outlineParserFactory, const CodeParserFactory &codeParserFactory)
Create the parser manager.
std::unique_ptr< OutlineParserInterface > getOutlineParser(const DString &extension)
Gets the interface to the parser associated with a given extension.
static PlantumlManager & instance()
void run()
Run plant UML tool for all images.
void processFile(const DString &fileName, const std::string &input, std::string &output)
void addSearchDir(const DString &dir)
static DString getQchFileName()
static const DString qhpFileName
Generator for RTF output.
static bool preProcessFileInplace(const DString &path, const DString &name)
This is an API to a VERY brittle RTF preprocessor that combines nested RTF files.
static void writeStyleSheetFile(TextStream &t)
static void writeExtensionsFile(TextStream &t)
static RefListManager & instance()
static RequirementManager & instance()
void writeTagFile(TextStream &tagFile)
void addRequirement(Entry *e)
Abstract proxy interface for non-javascript based search indices.
void addWord(const DString &word, bool hiPriority)
void setCurrentDoc(const Definition *ctx, const DString &anchor, bool isSourceFile)
void write(const DString &file)
class that provide information about a section.
SectionInfo * replace(const DString &label, const DString &fileName, int lineNr, const DString &title, SectionType type, int level, const DString &ref=DString())
SectionInfo * add(const SectionInfo &si)
static SectionManager & instance()
returns a reference to the singleton
static constexpr int Page
std::vector< stat > stats
void begin(const char *name)
std::chrono::steady_clock::time_point startTime
static void showCacheUsage()
Show usage of the type lookup cache.
static void clearTypeLookupCache(ClearScope scope)
ClassDefMutable * resolveClassMutable(const Definition *scope, const DString &name, bool mayBeUnlinkable=false, bool mayBeHidden=false)
Wrapper around resolveClass that returns a mutable interface to the class object or a nullptr if the ...
const ClassDef * resolveClass(const Definition *scope, const DString &name, bool maybeUnlinkable=false, bool mayBeHidden=false)
Find the class definition matching name within the scope set.
const Definition * resolveSymbol(const Definition *scope, const DString &name, const DString &args=DString(), bool checkCV=false, bool insideCode=false, bool onlyLinkable=false)
Find the symbool definition matching name within the scope set.
DString getTemplateSpec() const
In case a call to resolveClass() points to a template specialization, the template part is return via...
const MemberDef * getTypedef() const
In case a call to resolveClass() resolves to a type member (e.g. an enum) this method will return it.
Text streaming class that buffers data.
std::string str() const
Return the contents of the buffer as a std::string object.
Class managing a pool of worker threads.
auto queue(F &&f, Args &&... args) -> std::future< decltype(f(args...))>
Queue the callable function f for the threads to execute.
virtual DString trPage(bool first_capital, bool singular)=0
virtual DString trMainPage()=0
Wrapper class for a number of boolean properties.
std::string to_string() const
static void correctMemberProperties(MemberDefMutable *md)
static void computeVhdlComponentRelations()
ClassDefMutable * toClassDefMutable(Definition *d)
ClassDef * getClass(const DString &n)
std::unique_ptr< ClassDef > createClassDefAlias(const Definition *newScope, const ClassDef *cd)
ClassDef * toClassDef(Definition *d)
std::unique_ptr< ClassDef > createClassDef(const DString &fileName, int startLine, int startColumn, const DString &name, ClassDef::CompoundType ct, const DString &ref, const DString &fName, bool isSymbol, bool isJavaEnum)
Factory method to create a new ClassDef object.
std::unordered_set< const ClassDef * > ClassDefSet
std::map< std::string, int > TemplateNameMap
ClassDefMutable * getClassMutable(const DString &key)
Class representing a regular expression.
Class to iterate through matches.
Object representing the matching results.
ConceptDefMutable * toConceptDefMutable(Definition *d)
std::unique_ptr< ConceptDef > createConceptDef(const DString &fileName, int startLine, int startColumn, const DString &name, const DString &tagRef, const DString &tagFile)
ConceptDefMutable * getConceptMutable(const DString &key)
#define Config_getInt(name)
#define Config_getList(name)
#define Config_updateString(name, value)
#define Config_updateBool(name, value)
#define Config_getBool(name)
#define Config_getString(name)
#define Config_updateList(name,...)
#define Config_getEnum(name)
std::set< std::string > StringSet
std::unordered_set< std::string > StringUnorderedSet
std::map< std::string, std::string > StringMap
std::vector< std::string > StringVector
void parseFuncDecl(const DString &decl, const SrcLangExt lang, DString &clName, DString &type, DString &name, DString &args, DString &funcTempList, DString &exceptions)
std::unique_ptr< ArgumentList > stringToArgumentList(SrcLangExt lang, const DString &argsString, DString *extraTypeChars=nullptr)
std::unordered_map< std::string, DefineList > DefinesPerFileList
Definition * toDefinition(DefinitionMutable *dm)
DefinitionMutable * toDefinitionMutable(Definition *d)
DirIterator begin(DirIterator it) noexcept
DirIterator end(const DirIterator &) noexcept
void computeDirDependencies()
void generateDirDocs(OutputList &ol)
#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.
static void findInheritedTemplateInstances()
void printNavTree(Entry *root, int indent)
static void addClassToContext(const Entry *root)
static void makeTemplateInstanceRelation(const Entry *root, ClassDefMutable *cd)
static StringUnorderedSet g_pathsVisited(1009)
static void buildGroupList(const Entry *root)
static void insertMemberAlias(Definition *outerScope, const MemberDef *md)
static void findUsingDeclarations(const Entry *root, bool filterPythonPackages)
static void flushCachedTemplateRelations()
static MemberDef * addVariableToFile(const Entry *root, MemberType mtype, const DString &scope, const DString &type, const DString &name, const DString &args, bool fromAnnScope, MemberDef *fromAnnMemb)
static void copyLatexStyleSheet()
static void generateDocsForClassList(const std::vector< ClassDefMutable * > &classList)
static int findFunctionPtr(const std::string &type, SrcLangExt lang, int *pLength=nullptr)
static bool isSpecialization(const ArgumentLists &srcTempArgLists, const ArgumentLists &dstTempArgLists)
static void computeTemplateClassRelations()
static std::string resolveSymlink(const std::string &path)
void adjustConfiguration()
adjust globals that depend on configuration settings.
static void findDEV(const MemberNameLinkedMap &mnsd)
static void runQHelpGenerator()
static void addConceptToContext(const Entry *root)
static void addRelatedPage(Entry *root)
static void addIncludeFile(DefMutable *cd, FileDef *ifd, const Entry *root)
static StringVector g_inputFiles
static void generateXRefPages()
static Definition * buildScopeFromQualifiedName(const DString &name_, SrcLangExt lang, const TagInfo *tagInfo)
static void findUsingDeclImports(const Entry *root)
static void copyStyleSheet()
FindBaseClassRelation_Mode
void distributeClassGroupRelations()
static void generateGroupDocs()
static void findDirDocumentation(const Entry *root)
void checkConfiguration()
check and resolve config options
static void processTagLessClasses(const Definition *root, const Container *cd, const TagContainer *tagParent, MemberListType varFilter, MemberListType typeFilter, const DString &prefix, int count)
Look through the members of class cd and its public members.
static bool findClassRelation(const Entry *root, Definition *context, ClassDefMutable *cd, const BaseInfo *bi, const TemplateNameMap &templateNames, FindBaseClassRelation_Mode mode, bool isArtificial)
static void resolveTemplateInstanceInType(const Entry *root, const Definition *scope, const MemberDef *md)
static void organizeSubGroupsFiltered(const Entry *root, bool additional)
static void warnUndocumentedNamespaces()
static TemplateNameMap getTemplateArgumentsInName(const ArgumentList &templateArguments, const std::string &name)
static void buildConceptList(const Entry *root)
static void addMemberSpecialization(const Entry *root, MemberName *mn, ClassDefMutable *cd, const DString &funcType, const DString &funcName, const DString &funcArgs, const DString &funcDecl, const DString &exceptions, TypeSpecifier spec)
static void resolveClassNestingRelations()
static void generateNamespaceConceptDocs(const ConceptLinkedRefMap &conceptList)
static void findClassEntries(const Entry *root)
static void vhdlCorrectMemberProperties()
static void addMemberFunction(const Entry *root, MemberName *mn, const DString &scopeName, const DString &namespaceName, const DString &className, const DString &funcTyp, const DString &funcName, const DString &funcArgs, const DString &funcTempList, const DString &exceptions, const DString &type, const DString &args, bool isFriend, TypeSpecifier spec, const DString &relates, const DString &funcDecl, bool overloaded, bool isFunc)
static void generateExampleDocs()
static void stopDoxygen(int)
static void substituteTemplatesInArgList(const ArgumentLists &srcTempArgLists, const ArgumentLists &dstTempArgLists, const ArgumentList &src, ArgumentList &dst)
static void copyLogo(const DString &outputOption, bool toIndex)
static void computeMemberReferences()
static void transferRelatedFunctionDocumentation()
static void addMembersToMemberGroup()
static void findMainPageTagFiles(Entry *root)
static void addLocalObjCMethod(const Entry *root, const DString &scopeName, const DString &funcType, const DString &funcName, const DString &funcArgs, const DString &exceptions, const DString &funcDecl, TypeSpecifier spec)
static void distributeConceptGroups()
static void copyExtraFiles(const StringVector &files, const DString &filesOption, const DString &outputOption, bool toIndex)
static NamespaceDef * findUsedNamespace(const LinkedRefMap< NamespaceDef > &unl, const DString &name)
static void transferFunctionDocumentation()
static void setAnonymousEnumType()
static void sortMemberLists()
static void findMember(const Entry *root, const DString &relates, const DString &type, const DString &args, DString funcDecl, bool overloaded, bool isFunc)
static void createTemplateInstanceMembers()
void transferStaticInstanceInitializers()
static void findObjCMethodDefinitions(const Entry *root)
static void addMemberDocs(const Entry *root, MemberDefMutable *md, const DString &funcDecl, const ArgumentList *al, bool over_load, TypeSpecifier spec)
static void dumpSymbolMap()
static void buildTypedefList(const Entry *root)
static void findGroupScope(const Entry *root)
static void generateFileDocs()
static int findEndOfTemplate(const DString &s, size_t startPos)
static void findDefineDocumentation(Entry *root)
static void findUsedClassesForClass(const Entry *root, Definition *context, ClassDefMutable *masterCd, ClassDefMutable *instanceCd, bool isArtificial, const ArgumentList *actualArgs=nullptr, const TemplateNameMap &templateNames=TemplateNameMap())
static void findMemberDocumentation(const Entry *root)
static void distributeMemberGroupDocumentation()
static void generateNamespaceClassDocs(const ClassLinkedRefMap &classList)
static void addEnumValuesToEnums(const Entry *root)
static void generatePageDocs()
static void resolveUserReferences()
static void buildRequirementsList(Entry *root)
static void compareDoxyfile(Config::CompareMode diffList)
static void addPageToContext(PageDef *pd, Entry *root)
static std::shared_ptr< Entry > parseFile(OutlineParserInterface &parser, FileDef *fd, const DString &fn, ClangTUParser *clangParser, bool newTU)
static void buildVarList(const Entry *root)
static void copyIcon(const DString &outputOption, bool toIndex)
static void buildSequenceList(const Entry *root)
static void generateFileSources()
static void generateClassDocs()
static int findTemplateSpecializationPosition(const DString &name)
static void buildNamespaceList(const Entry *root)
static void findIncludedUsingDirectives()
static void addDefineDoc(const Entry *root, MemberDefMutable *md)
static void countMembers()
static ClassDef * findClassWithinClassContext(Definition *context, ClassDef *cd, const DString &name)
static void organizeSubGroups(const Entry *root)
static void applyMemberOverrideOptions(const Entry *root, MemberDefMutable *md)
static void addOverloaded(const Entry *root, MemberName *mn, const DString &funcType, const DString &funcName, const DString &funcArgs, const DString &funcDecl, const DString &exceptions, TypeSpecifier spec)
static void findFriends()
static void findEnums(const Entry *root)
static void generateConfigFile(const DString &configFile, bool shortList, bool updateOnly=false)
static DString g_commentFileName
static void dumpSymbol(TextStream &t, Definition *d)
static void addClassAndNestedClasses(std::vector< ClassDefMutable * > &list, ClassDefMutable *cd)
static void addEnumDocs(const Entry *root, MemberDefMutable *md)
static void addListReferences()
static void exitDoxygen() noexcept
static bool findGlobalMember(const Entry *root, const DString &namespaceName, const DString &type, const DString &name, const DString &tempArg, const DString &, const DString &decl, TypeSpecifier)
static bool isClassSection(const Entry *root)
static void buildGroupListFiltered(const Entry *root, bool additional, bool includeExternal)
static void runHtmlHelpCompiler()
static void addMembersToIndex()
static bool g_dumpSymbolMap
static void version(const bool extended)
static OutputList * g_outputList
static DString extractClassName(const Entry *root)
static void findMainPage(Entry *root)
static ClassDef::CompoundType convertToCompoundType(EntryType section, TypeSpecifier specifier)
DString stripTemplateSpecifiers(const DString &s)
static void findUsingDirectives(const Entry *root)
static void addInterfaceOrServiceToServiceOrSingleton(const Entry *root, ClassDefMutable *cd, DString const &rname)
static bool g_successfulRun
static bool tryAddEnumDocsToGroupMember(const Entry *root, const DString &name)
static void addSourceReferences()
static void associateVariableWithAnonymousEnumType(const MemberDef *md, const Container *cd, const MemberDef *enumTypeMember, MemberListType mlFilter)
static void createUsingMemberImportForClass(const Entry *root, ClassDefMutable *cd, const MemberDef *md, const DString &fileName, const DString &memName)
static DString substituteTemplatesInString(const ArgumentLists &srcTempArgLists, const ArgumentLists &dstTempArgLists, const std::string &src)
std::function< std::unique_ptr< T >() > make_parser_factory()
static void buildExampleList(Entry *root)
static void inheritDocumentation()
static void flushUnresolvedRelations()
static bool isSymbolHidden(const Definition *d)
void readConfiguration(int argc, char **argv)
static void readDir(FileInfo *fi, FileNameLinkedMap *fnMap, StringUnorderedSet *exclSet, const StringVector *patList, const StringVector *exclPatList, StringVector *resultList, StringUnorderedSet *resultSet, bool errorIfNotExist, bool recursive, StringUnorderedSet *killSet, StringUnorderedSet *paths)
static void findTemplateInstanceRelation(const Entry *root, Definition *context, ClassDefMutable *templateClass, const DString &templSpec, const TemplateNameMap &templateNames, bool isArtificial)
static void findDocumentedEnumValues()
static void generateDiskNames()
static void addToIndices()
static void computeClassRelations()
static void buildFunctionList(const Entry *root)
static void checkPageRelations()
static void addGlobalFunction(const Entry *root, const DString &rname, const DString &sc)
static void findModuleDocumentation(const Entry *root)
static void readTagFile(const std::shared_ptr< Entry > &root, const DString &tagLine)
static void findEnumDocumentation(const Entry *root)
static void computePageRelations(Entry *root)
static void addMethodToClass(const Entry *root, ClassDefMutable *cd, const DString &rtype, const DString &rname, const DString &rargs, bool isFriend, Protection protection, bool stat, Specifier virt, TypeSpecifier spec, const DString &relates)
static bool isVarWithConstructor(const Entry *root)
static StringSet g_usingDeclarations
static void buildDictionaryList(const Entry *root)
static bool haveEqualFileNames(const Entry *root, const MemberDef *md)
void readFileOrDirectory(const DString &s, FileNameLinkedMap *fnMap, StringUnorderedSet *exclSet, const StringVector *patList, const StringVector *exclPatList, StringVector *resultList, StringUnorderedSet *resultSet, bool recursive, bool errorIfNotExist, StringUnorderedSet *killSet, StringUnorderedSet *paths)
static void generateNamespaceDocs()
static void buildClassDocList(const Entry *root)
static void buildPageList(Entry *root)
static void writeTagFile()
static void addRequirementReferences()
static void computeVerifiedDotPath()
static bool g_singleComment
static void findSectionsInDocumentation()
static void mergeCategories()
static const StringUnorderedSet g_compoundKeywords
static bool scopeIsTemplate(const Definition *d)
static void buildFileList(const Entry *root)
static void buildClassList(const Entry *root)
static void usage(const DString &name, const DString &versionString)
static MemberDef * addVariableToClass(const Entry *root, ClassDefMutable *cd, MemberType mtype, const DString &type, const DString &name, const DString &args, bool fromAnnScope, MemberDef *fromAnnMemb, Protection prot, Relationship related)
static void findUsedTemplateInstances()
static void computeTooltipTexts()
static void addVariable(const Entry *root, int isFuncPtr=-1)
static void findBaseClassesForClass(const Entry *root, Definition *context, ClassDefMutable *masterCd, ClassDefMutable *instanceCd, FindBaseClassRelation_Mode mode, bool isArtificial, const ArgumentList *actualArgs=nullptr, const TemplateNameMap &templateNames=TemplateNameMap())
static void parseFilesSingleThreading(const std::shared_ptr< Entry > &root)
parse the list of input files
static void buildCompleteMemberLists()
static const ClassDef * findClassDefinition(FileDef *fd, NamespaceDef *nd, const DString &scopeName)
static void filterMemberDocumentation(const Entry *root, const DString &relates)
static void generateConceptDocs()
static bool isRecursiveBaseClass(const DString &scope, const DString &name)
static std::unique_ptr< OutlineParserInterface > getParserForFile(const DString &fn)
static void combineUsingRelations()
static const char * getArg(int argc, char **argv, int &optInd)
std::unique_ptr< ArgumentList > getTemplateArgumentsFromName(const DString &name, const ArgumentLists &tArgLists)
static void findTagLessClasses(std::set< const Definition * > &candidates, const Container *cd)
static ClassDefMutable * createTagLessInstance(const Definition *root, const ClassDef *templ, const DString &fieldName)
static void checkMarkdownMainfile()
static std::unordered_map< std::string, std::vector< ClassDefMutable * > > g_usingClassMap
static void buildConceptDocList(const Entry *root)
static bool isEntryInGroupOfMember(const Entry *root, const MemberDef *md, bool allowNoGroup=false)
static void applyToAllDefinitions(Func func)
static void parseFilesMultiThreading(const std::shared_ptr< Entry > &root)
parse the list of input files
static DString createOutputDirectory(const DString &baseDirName, const DString &formatDirName, const char *defaultDirName)
static void transferFunctionReferences()
static void buildDefineList()
static void buildInterfaceAndServiceList(const Entry *root)
static Definition * findScopeFromQualifiedName(NamespaceDefMutable *startScope, const DString &n, FileDef *fileScope, const TagInfo *tagInfo)
static void computeMemberRelations()
static void buildListOfUsingDecls(const Entry *root)
static void computeMemberRelationsForBaseClass(const ClassDef *cd, const BaseClassDef *bcd)
static std::multimap< std::string, const Entry * > g_classEntries
std::vector< InputFileEncoding > InputFileEncodingList
std::unordered_map< std::string, BodyInfo > StaticInitMap
std::unordered_map< std::string, NamespaceAliasInfo > NamespaceAliasInfoMap
std::unordered_map< std::string, const Definition * > ClangUsrMap
DString substitute(const DString &s, const DString &src, const DString &dst)
substitute all occurrences of src in s by dst
int dstricmp(const char *s1, const char *s2)
uint32_t dstrlen(const char *str)
Returns the length of string str, or 0 if a null pointer is passed.
int dstricmp_sort(const char *str1, const char *str2)
int dstrcmp(const char *str1, const char *str2)
const char * qPrint(const char *s)
FileDef * toFileDef(Definition *d)
std::unique_ptr< FileDef > createFileDef(const DString &p, const DString &n, const DString &ref, const DString &dn)
std::unordered_set< const FileDef * > FileDefSet
void addNamespaceToGroups(const Entry *root, NamespaceDef *nd)
void addGroupToGroups(const Entry *root, GroupDef *subGroup)
void addClassToGroups(const Entry *root, ClassDef *cd)
void addDirToGroups(const Entry *root, DirDef *dd)
std::unique_ptr< GroupDef > createGroupDef(const DString &fileName, int line, const DString &name, const DString &title, const DString &refFileName)
void addConceptToGroups(const Entry *root, ConceptDef *cd)
void addMemberToGroups(const Entry *root, MemberDef *md)
void writeGraphInfo(OutputList &ol)
void endTitle(OutputList &ol, const DString &fileName, const DString &name)
void writeIndexHierarchy(OutputList &ol)
void endFile(OutputList &ol, bool skipNavIndex, bool skipEndContents, const DString &navPath)
void startTitle(OutputList &ol, const DString &fileName, const DefinitionMutable *def)
void startFile(OutputList &ol, const DString &name, bool isSource, const DString &manName, const DString &title, HighlightedItem hli, bool additionalIndices, const DString &altSidebarName, int hierarchyLevel, const DString &allMembersFile)
Translator * theTranslator
void setTranslator(OUTPUT_LANGUAGE_t langName)
#define LATEX_STYLE_EXTENSION
void writeDefaultLayoutFile(const DString &fileName)
std::unique_ptr< MemberDef > createMemberDef(const DString &defFileName, int defLine, int defColumn, const DString &type, const DString &name, const DString &args, const DString &excp, Protection prot, Specifier virt, bool stat, Relationship related, MemberType t, const ArgumentList &tal, const ArgumentList &al, const DString &metaData)
Factory method to create a new instance of a MemberDef.
std::unique_ptr< MemberDef > createMemberDefAlias(const Definition *newScope, const MemberDef *aliasMd)
MemberDefMutable * toMemberDefMutable(Definition *d)
void combineDeclarationAndDefinition(MemberDefMutable *mdec, MemberDefMutable *mdef)
MemberDef * toMemberDef(Definition *d)
std::unordered_map< int, std::unique_ptr< MemberGroupInfo > > MemberGroupInfoMap
DString warn_line(const DString &file, int line)
#define warn_undoc(file, line, fmt,...)
#define warn_uncond(fmt,...)
#define warn(file, line, fmt,...)
void postProcess(bool clearHeaderAndFooter, CompareMode compareMode=CompareMode::Full)
void checkAndCorrect(bool quiet, const bool check)
void compareDoxyfile(TextStream &t, CompareMode compareMode)
void writeTemplate(TextStream &t, bool shortList, bool updateOnly=false)
bool parse(const DString &fileName, bool update=false, CompareMode compareMode=CompareMode::Full)
void correctPath(const StringVector &list)
Correct a possible wrong PATH variable.
FILE * popen(const DString &name, const DString &type)
double getSysElapsedTime()
void setenv(const DString &variable, const DString &value)
int system(const DString &command, const DString &args, bool commandHasConsole=true)
DString getenv(const DString &variable)
bool isAbsolutePath(const DString &fileName)
DString pathListSeparator()
std::ofstream openOutputStream(const DString &name, bool append=false)
const char * commandExtension()
DString trunc(const DString &s, size_t numChars=15)
std::unique_ptr< NamespaceDef > createNamespaceDef(const DString &defFileName, int defLine, int defColumn, const DString &name, const DString &ref, const DString &refFile, const DString &type, bool isPublished)
Factory method to create new NamespaceDef instance.
std::unique_ptr< NamespaceDef > createNamespaceDefAlias(const Definition *newScope, const NamespaceDef *nd)
Factory method to create an alias of an existing namespace.
void replaceNamespaceAliases(DString &name)
NamespaceDef * getResolvedNamespace(const DString &name)
NamespaceDef * toNamespaceDef(Definition *d)
NamespaceDefMutable * toNamespaceDefMutable(Definition *d)
NamespaceDefMutable * getResolvedNamespaceMutable(const DString &key)
std::unordered_set< const NamespaceDef * > NamespaceDefSet
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::unique_ptr< PageDef > createPageDef(const DString &f, int l, const DString &n, const DString &d, const DString &t)
void setPerlModDoxyfile(const DString &qs)
Portable versions of functions that are platform dependent.
int portable_iconv_close(void *cd)
void * portable_iconv_open(const char *tocode, const char *fromcode)
void finalizeSearchIndexer()
void createJavaScriptSearchIndex()
void writeJavaScriptSearchIndex()
Javascript based search engine.
void addSTLSupport(std::shared_ptr< Entry > &root)
Add stub entries for the most used classes in the standard template library.
Some helper functions for std::string.
void addTerminalCharIfMissing(std::string &s, char c)
This class contains the information about the argument of a function or template.
Class that contains information about an inheritance relation.
ClassDef * classDef
Class definition that this relation inherits from.
This class stores information about an inheritance relation.
Protection prot
inheritance type
Specifier virt
virtualness
DString name
the name of the base class
Data associated with description found in the body.
DString groupname
name of the group
static constexpr const char * getGroupPriName(GroupPri_t priority) noexcept
@ GROUPING_INGROUP
membership in group was defined by @ingroup
GroupPri_t pri
priority of this definition
stat(const char *n, double el)
This struct is used to capture the tag file information for an Entry.
void parseTagFile(const std::shared_ptr< Entry > &root, const char *fullName)
void initTracing(const DString &logFile, bool timing)
DString substituteTemplateArgumentsInString(const DString &nm, const ArgumentList &formalArgs, const ArgumentList *actualArgs)
bool findAndRemoveWord(DString &sentence, const char *word)
removes occurrences of whole word from sentence, while keeps internal spaces and reducing multiple se...
bool protectionLevelVisible(Protection prot)
DString stripFromIncludePath(const DString &path)
DString mergeScopes(const DString &leftScope, const DString &rightScope)
DString filterTitle(const DString &title)
bool matchTemplateArguments(const ArgumentList &srcAl, const ArgumentList &dstAl)
void addCodeOnlyMappings()
bool rightScopeMatch(const DString &scope, const DString &name)
bool checkIfTypedef(const Definition *scope, const FileDef *fileScope, const DString &n)
DString replaceAnonymousScopes(const DString &s, const DString &replacement)
void addRefItem(const RefItemVector &sli, const DString &key, const DString &prefix, const DString &name, const DString &title, const DString &args, const Definition *scope)
int computeQualifiedIndex(const DString &name)
Return the index of the last :: in the string name that is still before the first <.
bool patternMatch(const FileInfo &fi, const StringVector &patList)
DString removeRedundantWhiteSpace(const DString &s)
bool checkExtension(const DString &fName, const DString &ext)
DString convertNameToFile(const DString &name, bool allowDots, bool allowUnderscore)
bool leftScopeMatch(const DString &scope, const DString &name)
DString tempArgListToString(const ArgumentList &al, SrcLangExt lang, bool includeDefault)
DString showFileDefMatches(const FileNameLinkedMap *fnMap, const DString &n)
FileDef * findFileDef(const FileNameLinkedMap *fnMap, const DString &n, bool &ambig)
DString getFileNameExtension(const DString &fn)
DString resolveTypeDef(const Definition *context, const DString &qualifiedName, const Definition **typedefContext)
bool readInputFile(const DString &fileName, std::string &contents, bool filter, bool isSourceCode)
read a file name fileName and optionally filter and transcode it
DString normalizeNonTemplateArgumentsInString(const DString &name, const Definition *context, const ArgumentList &formalArgs)
SrcLangExt getLanguageFromFileName(const DString &fileName, SrcLangExt defLang)
bool matchArguments2(const Definition *srcScope, const FileDef *srcFileScope, const DString &srcReturnType, const ArgumentList *srcAl, const Definition *dstScope, const FileDef *dstFileScope, const DString &dstReturnType, const ArgumentList *dstAl, bool checkCV, SrcLangExt lang)
void initDefaultExtensionMapping()
void addHtmlExtensionIfMissing(DString &fName)
DString fileToString(const DString &name, bool filter, bool isSourceCode)
void extractNamespaceName(const DString &scopeName, DString &className, DString &namespaceName, bool allowEmptyClass)
DString stripTemplateSpecifiersFromScope(const DString &fullName, bool parentOnly, DString *pLastScopeStripped, DString scopeName, bool allowArtificial)
DString argListToString(const ArgumentList &al, bool useCanonicalType, bool showDefVals)
DString projectLogoFile()
bool copyFile(const DString &src, const DString &dest)
Copies the contents of file with name src to the newly created file with name dest.
int getPrefixIndex(const DString &name)
DString getLanguageSpecificSeparator(SrcLangExt lang, bool classScope)
Returns the scope separator to use given the programming language lang.
bool updateLanguageMapping(const DString &extension, const DString &language)
void mergeMemberOverrideOptions(MemberDefMutable *md1, MemberDefMutable *md2)
DString getOverloadDocs()
DString mangleCSharpGenericName(const DString &name)
void mergeArguments(ArgumentList &srcAl, ArgumentList &dstAl, bool forceNameOverwrite)
int getScopeFragment(const DString &s, int p, int *l)
int extractClassNameFromType(const DString &type, int &pos, DString &name, DString &templSpec, SrcLangExt lang)
void cleanupInlineGraph()
DString langToString(SrcLangExt lang)
Returns a string representation of lang.
bool openOutputFile(const DString &outFile, std::ofstream &f)
DString stripAnonymousNamespaceScope(const DString &s)
EntryType guessSection(const DString &name)
A bunch of utility functions.