38 TMethodWrapperImpl(
TMethod*
m,
int overloadIdx):
39 fMeth(m), fOverloadIdx(overloadIdx) {}
41 static void SetClass(
const TClass* cl) { fgClass = cl; }
43 const char*
GetName()
const {
return fMeth->GetName(); }
45 Int_t GetNargs()
const {
return fMeth->GetNargs(); }
52 const TMethodWrapperImpl*
m =
dynamic_cast<const TMethodWrapperImpl*
>(obj);
57 if (GetNargs() < m->GetNargs())
return -1;
58 else if (GetNargs() > m->GetNargs())
return 1;
66 const char*
r(m->GetName());
67 if (
l[0] ==
'~' &&
r[0] ==
'~') {
88 if (
l[0] ==
'~')
return -1;
89 if (
r[0] ==
'~')
return 1;
90 return (ret < 0) ? -1 : 1;
94 static const TClass* fgClass;
99 const TClass* TMethodWrapperImpl::fgClass = 0;
151 fHtml(docOutput.GetHtml()), fDocOutput(&docOutput), fLineNo(0),
152 fCurrentClass(cl), fRecentClass(0), fCurrentModule(0),
153 fDirectiveCount(0), fLineNumber(0), fDocContext(kIgnore),
154 fCheckForMethod(
kFALSE), fClassDocState(kClassDoc_Uninitialized),
165 TMethodWrapperImpl::SetClass(cl);
167 for (
int ia = 0; ia < 3; ++ia) {
181 while ((method = (
TMethod *) nextMethod())) {
205 TMethodWrapperImpl::SetClass(0);
214 for (std::map<std::string, Int_t>::const_iterator iMethod =
fMethodCounts.begin();
217 Info(
"~TDocParser",
"Implementation of method %s::%s could not be found.",
219 iMethod->first.c_str());
224 directive->
GetName(directiveName);
225 Warning(
"~TDocParser",
"Missing \"%s\" for macro %s", directive->
GetEndTag(), directiveName.
Data());
245 std::map<std::string, int> methOverloads;
247 while ((method = (
TMethod *) nextMethod())) {
249 if (!strcmp(method->
GetName(),
"Dictionary") ||
250 !strcmp(method->
GetName(),
"Class_Version") ||
251 !strcmp(method->
GetName(),
"Class_Name") ||
252 !strcmp(method->
GetName(),
"DeclFileName") ||
253 !strcmp(method->
GetName(),
"DeclFileLine") ||
254 !strcmp(method->
GetName(),
"ImplFileName") ||
255 !strcmp(method->
GetName(),
"ImplFileLine") ||
256 (bc && (method->
GetName()[0] ==
'~' 271 if (mtype == 0)
continue;
279 for (
Int_t access = 0; !hidden && access < 3; ++access) {
281 hidden |= (other) && (other->GetMethod()->GetClass() != method->
GetClass());
284 fMethods[mtype].
Add(
new TMethodWrapperImpl(method, methOverloads[method->
GetName()]));
285 ++methOverloads[method->
GetName()];
295 for (
Int_t access = 0; access < 3; ++access) {
317 if (!strcmp(dm->
GetName(),
"fgIsA"))
328 if (mtype == 0)
continue;
336 if ((dm->
Property() & flagEnumConst) == flagEnumConst
369 for (
Int_t access = 0; access < 6; ++access) {
382 const char base64String[65] =
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_.";
390 anchor += base64String[hash % 52];
393 anchor += base64String[hash % 64];
428 if (!interpretDirectives) {
465 std::list<TClass*> currentType;
474 currentType.push_back(0);
477 while (isspace((
UChar_t)line[i]))
484 Ssiz_t copiedToCommentUpTo = 0;
489 const char* endTag = directive->
GetEndTag();
492 if (posEndTag == 0 || line[posEndTag - 1] !=
'"')
494 if (posEndTag !=
kNPOS)
508 copiedToCommentUpTo = i;
512 for (; i < line.
Length(); ++i) {
514 if (!currentType.back())
520 if (currentType.back())
523 if (line[i + 1] ==
':') {
530 if (line[i + 1] ==
'>') {
537 if (line[i + 1] !=
'.') {
546 currentType.push_back(0);
551 if (currentType.size() > 1)
552 currentType.pop_back();
560 currentType.back() = 0;
566 && i > 2 && line[i] ==
'\'' && line[i-1] ==
';';
567 if (haveHtmlEscapedChar) {
569 while (posBegin > 0 &&
IsWord(line[posBegin]))
571 haveHtmlEscapedChar = posBegin > 0 &&
572 line[posBegin] ==
'&' && line[posBegin - 1] ==
'\'';
578 && ( (i > 1 && line[i - 2] ==
'\'')
579 || (i > 3 && line[i - 2] ==
'\\' && line[i - 3] ==
'\'')))
580 || haveHtmlEscapedChar)
581 && (i == 0 || line[i - 1] !=
'\\');
583 if (line[i] ==
'"' || (line[i] ==
'\'' && (
585 (line.Length() > i + 2 && line[i + 2] ==
'\'') ||
587 (line.Length() > i + 3 && line[i + 1] ==
'\'' && line[i + 3] ==
'\'')))) {
591 currentType.back() = 0;
593 }
else if (context ==
kCode 594 && line[i] ==
'/' && (line[i+1] ==
'/' || line[i+1] ==
'*')) {
596 if (line[i+1] ==
'/')
598 currentType.back() = 0;
603 && line.Length() > i + 1
604 && line[i] ==
'*' && line[i+1] ==
'/') {
608 currentType.back() = 0;
616 copiedToCommentUpTo = i;
618 }
else if (startOfLine == i
620 && context ==
kCode) {
625 if (i < line.Length())
633 currentType.back() = 0;
642 while (endWord < line.
Length() &&
IsName(line[endWord]))
654 if ((i == 0 || (i > 0 && line[i - 1] !=
'"'))
657 currentType.back() = 0;
668 currentType.back() = 0;
683 const char* globalTypeName = 0;
684 if (!currentType.size()) {
685 Warning(
"DecorateKeywords",
"type context is empty!");
686 currentType.push_back(0);
688 TClass* lookupScope = currentType.back();
690 if (scoping == kNada) {
697 if (scoping == kNada) {
698 subType =
gROOT->GetType(word);
701 if (!subType && !subClass) {
708 subType =
gROOT->GetType(globalTypeName);
714 if (!subType && !subClass) {
719 if (!subType && !subClass) {
721 while (isspace(line[endWord])) ++endWord;
722 if (line[endWord] ==
'<' || line[endWord] ==
'>') {
724 Ssiz_t endWordT = endWord + 1;
725 int templateLevel = 1;
726 while (endWordT < line.
Length()
729 || line[endWordT] ==
'<' 730 || line[endWordT] ==
'>')) {
731 if (line[endWordT] ==
'<')
733 else if (line[endWordT] ==
'>')
739 word =
line(i, endWordT - i);
744 if (lookupScope && !subType && !subClass) {
745 if (scoping == kScope) {
747 subClassName +=
"::";
748 subClassName += word;
751 subType =
gROOT->GetType(subClassName);
753 if (!subClass && !subType) {
759 if (!subClass && !subType && !datamem && !meth) {
761 while (isspace(line[endWord])) ++endWord;
762 if (line[endWord] ==
'<' || line[endWord] ==
'>') {
764 Ssiz_t endWordT = endWord + 1;
765 int templateLevel = 1;
766 while (endWordT < line.
Length()
769 || line[endWordT] ==
'<' 770 || line[endWordT] ==
'>')) {
771 if (line[endWordT] ==
'<')
773 else if (line[endWordT] ==
'>')
778 subClassName +=
"::";
779 subClassName +=
line(i, endWordT - i);
782 word =
line(i, endWordT - i);
794 globalTypeName ? globalTypeName : subType->
GetName());
795 currentType.back() = 0;
796 }
else if (subClass) {
798 globalTypeName ? globalTypeName : subClass->
GetName());
800 currentType.back() = subClass;
802 }
else if (datamem || meth) {
815 while (
IsWord(retTypeName[pos]) || retTypeName[pos]==
'<' || retTypeName[pos]==
'>' || retTypeName[pos]==
':')
822 currentType.back() = 0;
837 currentType.back() = 0;
861 currentType.back() = 0;
871 typedef std::map<std::string ,
Int_t > MethodCount_t;
872 MethodCount_t::iterator iMethodName =
fMethodCounts.find(name);
874 --(iMethodName->second);
875 if (iMethodName->second <= 0)
888 while ((cl = (
TClass*) iClass()))
892 if (!directive)
continue;
893 directive->
SetParser(const_cast<TDocParser*>(
this));
918 if (posInclude !=
kNPOS) {
920 Ssiz_t posStartFilename = posInclude + 7;
921 if (line.
Tokenize(filename, posStartFilename,
"[<\"]")) {
922 Ssiz_t posEndFilename = posStartFilename;
923 if (line.
Tokenize(filename, posEndFilename,
"[>\"]")) {
935 line +=
"<a href=\"./";
938 line += filename +
"</a>" + endOfLine[0];
939 posEndOfLine = line.
Length() - 1;
942 line += endOfLine(1, endOfLine.Length());
952 posEndOfLine = line.
Length();
955 Ssiz_t posHashAfterDecoration = posHash;
957 posEndOfLine += posHashAfterDecoration - posHash;
970 else out_module =
"(UNKNOWN MODULE WHILE PARSING)";
978 Ssiz_t& copiedToCommentUpTo)
996 copiedToCommentUpTo = pos;
1011 if (begin && line[pos] ==
'(') {
1012 std::list<char> waitForClosing;
1013 Ssiz_t endParam = pos + 1;
1014 for (; endParam < line.
Length()
1015 && (line[endParam] !=
')' || !waitForClosing.empty()); ++endParam) {
1016 const char c = line[endParam];
1017 if (!waitForClosing.empty() && waitForClosing.back() == c) {
1018 waitForClosing.pop_back();
1023 if (waitForClosing.empty() || waitForClosing.back() !=
'\'')
1024 waitForClosing.push_back(
'"');
1027 if (waitForClosing.empty() || waitForClosing.back() !=
'"')
1028 waitForClosing.push_back(
'\'');
1031 if (waitForClosing.empty() || (waitForClosing.back() !=
'"' && waitForClosing.back() !=
'\''))
1032 waitForClosing.push_back(
')');
1040 if (waitForClosing.empty()) {
1041 params =
line(pos + 1, endParam - (pos + 1));
1042 pos += params.
Length() + 2;
1049 const char* endTag = directive->
GetEndTag();
1050 Ssiz_t lenEndTag = strlen(endTag);
1052 if (line[posEndTag - 1] ==
'"') {
1053 posEndTag += lenEndTag;
1058 if (posEndTag !=
kNPOS) {
1067 posEndTag = line.
Length();
1074 while (pos < line.
Length())
1079 copiedToCommentUpTo = line.
Length();
1088 else pos += word.
Length() - 2;
1093 Warning(
"HandleDirective",
"Cannot find directive handler object %s !",
1115 copiedToCommentUpTo = pos;
1163 for (std::list<UInt_t>::const_reverse_iterator iPC =
fParseContext.rbegin();
1165 if (!lowerContext || ((lowerContext && ((*iPC & kParseContextMask) == lowerContext))
1166 && (!contextFlag || (contextFlag && (*iPC & contextFlag)))))
1257 if (pos > 0 && line[pos - 1] ==
'"')
1277 tag[0] -=
'a' -
'A';
1283 if (
gDebug > 0 && !clDirective)
1284 Warning(
"IsDirective",
"Unknown THtml directive %s in line %d!", word.
Data(),
fLineNo);
1305 if (isalnum(c) || c ==
'_' || c ==
'~')
1328 if (isalpha(c) || c ==
'_' || c ==
'~')
1345 Bool_t& isconst, std::ostream &srcOut,
1346 TString &anchor, std::ifstream& sourceFile,
1349 typedef std::map<std::string ,
Int_t > MethodCount_t;
1352 if (posMethodName ==
kNPOS) {
1357 if (posQuote !=
kNPOS && (posBlock ==
kNPOS || posQuote < posBlock))
1358 posBlock = posQuote;
1359 if (posBlock ==
kNPOS)
1361 for (MethodCount_t::iterator iMethodName =
fMethodCounts.begin();
1363 TString lookFor(iMethodName->first);
1365 if (posMethodName !=
kNPOS && posMethodName < posBlock
1366 && (posMethodName == 0 || !
IsWord(
fLineRaw[posMethodName - 1]))) {
1369 Ssiz_t posMethodEnd = posMethodName + lookFor.
Length();
1371 if (
fLineRaw[posMethodEnd] ==
'(') {
1373 srcOut, anchor, sourceFile, allowPureVirtual);
1387 while (ret.Length() && (
IsName(ret[ret.Length() - 1]) || ret[ret.Length()-1] ==
':'))
1388 ret.Remove(ret.Length() - 1, 1);
1391 while (didSomething) {
1393 if (ret.BeginsWith(
"inline ")) {
1394 didSomething =
kTRUE;
1397 if (ret.BeginsWith(
"static ")) {
1398 didSomething =
kTRUE;
1401 if (ret.BeginsWith(
"virtual ")) {
1402 didSomething =
kTRUE;
1411 if (posParam ==
kNPOS ||
1413 ret.Contains(
"{") || ret.Contains(
"}") || ret.Contains(
"(") || ret.Contains(
")")
1414 || ret.Contains(
"=")) {
1423 Ssiz_t checkOpBracketParam = posParam + 1;
1424 while (isspace((
UChar_t)name[checkOpBracketParam]))
1425 ++checkOpBracketParam;
1426 if (name[checkOpBracketParam] ==
')') {
1427 ++checkOpBracketParam;
1428 while (isspace((
UChar_t)name[checkOpBracketParam]))
1429 ++checkOpBracketParam;
1430 if (name[checkOpBracketParam] ==
'(')
1431 posParam = checkOpBracketParam;
1435 if (posParam ==
kNPOS) {
1442 params =
name(posParam, name.
Length() - posParam);
1454 if (iMethodName ==
fMethodCounts.end() || iMethodName->second <= 0) {
1463 Int_t bracketLevel = 1;
1464 while (bracketLevel) {
1465 const char* paramEnd = strpbrk(params.
Data() + posParamEnd,
")(\"'");
1473 srcOut <<
"<a name=\"" << anchor <<
"\"></a>";
1480 if (sourceFile.eof()) {
1481 Error(
"LocateMethodInCurrentLine",
1482 "Cannot find end of signature for function %s!",
1496 posParamEnd = params.
Length();
1499 posParamEnd = paramEnd - params.
Data();
1500 switch (params[posParamEnd]) {
1501 case '(': ++bracketLevel; ++posParamEnd;
break;
1502 case ')': --bracketLevel; ++posParamEnd;
break;
1505 while (params.
Length() > posParamEnd && params[posParamEnd] !=
'"') {
1507 if (params[posParamEnd] ==
'\\') ++posParamEnd;
1510 if (params.
Length() <= posParamEnd) {
1521 if (params[posParamEnd] ==
'\\') ++posParamEnd;
1532 isconst = pastParams.
BeginsWith(
"const") && !(isalnum(pastParams[5]) || pastParams[5] ==
'_');
1536 Ssiz_t posSemicolon = params.
Index(
';', posParamEnd);
1537 Ssiz_t posPureVirt = params.
Index(
'=', posParamEnd);
1538 if (posSemicolon !=
kNPOS)
1539 if ((posBlock ==
kNPOS || (posSemicolon < posBlock)) &&
1540 (posPureVirt ==
kNPOS || !allowPureVirtual)
1541 && !allowPureVirtual)
1545 params.
Remove(posParamEnd);
1553 posMethodName = posParam + posParamEnd;
1608 Bool_t lookForSourceInfo ,
1610 Bool_t allowPureVirtual ,
1611 const char* methodPattern ,
1612 const char* sourceExt )
1614 TString sourceFileName(filename);
1616 if (!sourceFileName.
Length()) {
1618 Error(
"LocateMethods",
"Can't find source file '%s' for class %s!",
1622 std::ifstream sourceFile(sourceFileName.
Data());
1623 if (!sourceFile || !sourceFile.good()) {
1624 Error(
"LocateMethods",
"Can't open file '%s' for reading!", sourceFileName.
Data());
1628 TPMERegexp patternRE(methodPattern ? methodPattern :
"");
1640 std::ofstream srcHtmlOut;
1642 if (sourceExt && sourceExt[0]) {
1650 srcHtmlOutName +=
".h.html";
1658 while (!sourceFile.eof()) {
1664 if (sourceFile.eof())
break;
1681 Strip(strippedComment);
1682 if (strippedComment.
Length() > 0) {
1697 while ((posLastScope =
name.Index(
"::")) !=
kNPOS)
1698 name.Remove(0, posLastScope + 2);
1701 if (posName !=
kNPOS) {
1702 Ssiz_t posClosingParen = posName +
name.Length();
1703 while (isspace(
fLineStripped[posClosingParen])) ++posClosingParen;
1717 if (methodName.
Length() && !wroteMethodNowWaitingForOpenBlock) {
1719 if (useDocxxStyle && docxxComment.
Length()) {
1723 WriteMethod(out, methodRet, methodName, methodParam, methodIsConst,
1726 if (savedComment[0]) {
1731 if (!wroteMethodNowWaitingForOpenBlock) {
1734 if (methodPattern) {
1737 if (posPattern !=
kNPOS && methodPattern) {
1739 static const char vetoChars[] =
"{\"";
1740 for (
int ich = 0; posPattern !=
kNPOS && vetoChars[ich]; ++ich) {
1742 if (posVeto !=
kNPOS && posVeto < posPattern)
1746 if (posPattern !=
kNPOS || !methodPattern) {
1747 if (methodPattern) {
1749 posPattern += patternRE[0].Length();
1752 methodParam, methodIsConst, srcHtmlOut,
1753 anchor, sourceFile, allowPureVirtual);
1754 if (methodName.
Length()) {
1756 needAnchor = !anchor.
Length();
1775 if (methodName.
Length() && !wroteMethodNowWaitingForOpenBlock) {
1777 if (!codeOneLiner.
Length() &&
1787 else if (!methodName.
Length() && !useDocxxStyle)
1793 srcHtmlOut <<
"<a name=\"" << anchor <<
"\"></a>";
1800 if (lookForSourceInfo)
1813 else if (needAnchor)
1818 if (methodName.
Length()) {
1819 if (useDocxxStyle && docxxComment.
Length())
1821 WriteMethod(out, methodRet, methodName, methodParam, methodIsConst,
1827 srcHtmlOut <<
"</pre>" << std::endl;
1831 srcHtmlOut <<
"</div>" << std::endl;
1854 while ((posLastScope = pattern.Index(
"::")) !=
kNPOS)
1855 pattern.Remove(0, posLastScope + 2);
1861 kFALSE , pattern,
".cxx.html");
1862 Ssiz_t posGt = pattern.Index(
'>');
1863 if (posGt !=
kNPOS) {
1865 Ssiz_t posLt = pattern.Index(
'<');
1866 if (posLt !=
kNPOS && posLt < posGt) {
1867 pattern.Replace(posLt + 1, posGt - posLt - 1,
".*");
1869 kFALSE , pattern,
".cxx.html");
1887 while ((posLastScope = pattern.Index(
"::")) !=
kNPOS)
1888 pattern.Remove(0, posLastScope + 1);
1895 Ssiz_t posGt = pattern.Index(
'>');
1896 if (posGt !=
kNPOS) {
1898 Ssiz_t posLt = pattern.Index(
'<');
1899 if (posLt !=
kNPOS && posLt < posGt) {
1900 pattern.Replace(posLt + 1, posGt - posLt - 1,
".*");
1918 kTRUE , 0,
".h.html");
1953 while ((mustDealWithCommentAtBOL && posSpanEnd !=
kNPOS) || posComment !=
kNPOS) {
1954 Int_t spanLevel = 1;
1956 while (spanLevel > 1 || (posSpan !=
kNPOS && posSpan < posSpanEnd)) {
1958 if (posSpan !=
kNPOS && posSpan < posSpanEnd) {
1968 if (posSpanEnd !=
kNPOS) {
1970 commentLine.Remove(posSpanEnd, 7);
1971 if (posComment !=
kNPOS)
1972 commentLine.Remove(posComment, 22);
1974 mustDealWithCommentAtBOL =
kFALSE;
1981 if (posComment !=
kNPOS)
1982 commentLine.Remove(posComment, 22);
1997 char start_or_end = 0;
1999 if (commentLine.Length()>1 && commentLine[0] ==
'/' 2000 && (commentLine[1] ==
'/' || commentLine[1] ==
'*')) {
2001 start_or_end = commentLine[1];
2002 commentLine.Remove(0, 2);
2005 if (start_or_end !=
'/' && commentLine.Length()>1
2006 && commentLine[commentLine.Length() - 2] ==
'*' 2007 && commentLine[commentLine.Length() - 1] ==
'/') {
2008 start_or_end = commentLine[commentLine.Length() - 2];
2009 commentLine.Remove(commentLine.Length()-2);
2013 if (start_or_end && commentLine.Length() > 3) {
2014 TString lineAllOneChar(commentLine.Strip());
2018 Char_t c = lineAllOneChar[len - 1];
2019 if (c == lineAllOneChar[len - 2] && c == lineAllOneChar[len - 3]) {
2021 Strip(lineAllOneCharStripped);
2022 if (!lineAllOneCharStripped.
Length()) {
2023 commentLine.Remove(0);
2038 if (commentLine.Length() > 0 && start_or_end == commentLine[commentLine.Length() - 1])
2043 while (commentLine.Length() > 2
2044 && !
IsWord(commentLine[0])
2045 && commentLine[0] == commentLine[commentLine.Length() - 1])
2049 while (start_or_end && commentLine[0] == start_or_end)
2050 commentLine.Remove(0, 1);
2065 for (std::list<UInt_t>::iterator iContext =
fParseContext.begin();
2067 if (*iContext == lookFor) iComment =iContext;
2077 Bool_t changed = str[0] ==
' ' || str[0] ==
'\t' || str[0] ==
'\n';
2079 && (str[str.
Length() - 1] ==
' ' || str[str.
Length() - 1] ==
'\t' 2080 || str[str.
Length() - 1] ==
'\n');
2081 if (!changed)
return kFALSE;
2083 while (str[i] ==
' ' || str[i] ==
'\t' || str[i] ==
'\n')
2087 while (i >= 0 && (str[i] ==
' ' || str[i] ==
'\t' || str[i] ==
'\n'))
2107 static void RemoveUnneededSpaces(
TString&
s) {
2114 if (((isalnum(p) || p ==
'_') && (isalnum(n) || n ==
'_'))
2115 || (p ==
'>' && n ==
'>')) {
2118 while (isspace(s[i])) {
2126 static void ParseParameters(
TString& strippedParams,
TList& paramArr) {
2131 bool quoted =
false;
2134 for (
Ssiz_t i = 0; i < len; ++i) {
2135 switch (strippedParams[i]) {
2138 case '[': ++nest;
break;
2141 case ']': --nest;
break;
2142 case '=': init =
true;
break;
2143 case '\'': ++i;
if (strippedParams[i] ==
'\\') ++i; ++i;
continue;
2144 case '\\': ++i;
continue;
break;
2145 case '"': quoted = !quoted;
break;
2147 if (!quoted && !nest) {
2157 arg += strippedParams[i];
2161 if (strippedLastArg.Length()) {
2171 TIter iCandidate(candidates);
2172 int nparams = paramArr->
GetSize();
2173 for (
int iparam = 0; iparam < nparams && candidates->
GetSize() > 1; ++iparam) {
2176 while (noParName.
Length()
2177 && (isalnum(noParName[noParName.
Length() - 1]) || noParName[noParName.
Length() - 1] ==
'_'))
2181 if (noParName.
Length()) {
2182 RemoveUnneededSpaces(noParName);
2184 RemoveUnneededSpaces(srcArg);
2189 for (
int comparison = 0; comparison < 5; ++comparison) {
2190 if (comparison == 1 && noParName == srcArg)
2199 RemoveUnneededSpaces(sMethArg);
2200 bool matches =
false;
2201 switch (comparison) {
2202 case 0: matches = (srcArg == sMethArg);
break;
2203 case 1: matches = (noParName == sMethArg);
break;
2204 case 2: matches = srcArg.
Contains(sMethArg) || sMethArg.
Contains(srcArg);
break;
2207 suppressed.
Add(method);
2221 if (candidates->
GetSize() > 1) {
2244 const char* filename,
TString& anchor,
2251 TString strippedParams(params);
2252 if (strippedParams[0] ==
'(') {
2253 strippedParams.
Remove(0, 1);
2260 ParseParameters(strippedParams, paramArr);
2261 int nparams = paramArr.
GetSize();
2265 for (
int access = 0; access < 3; ++access) {
2267 if (!methList)
continue;
2269 TIter nextMethod(methList);
2275 candidates.
Add(method);
2280 if (nparams && candidates.
GetSize() > 1) {
2281 MatchOverloadSignatures(&candidates, ¶mArr);
2285 if (candidates.
GetSize() == 1) {
2291 fComment, codeOneLiner, guessedMethod);
A zero length substring is legal.
virtual const char * BaseName(const char *pathname)
Base name of a file name. Base name of /user/root is root.
virtual const char * GetName() const
Returns name of object.
TDocParser(TClassDocOutput &docOutput, TClass *cl)
Constructor called for parsing class sources.
TList * GetListOfBases()
Return list containing the TBaseClass(es) of a class.
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
void WriteLineNumbers(std::ostream &out, Long_t nLines, const TString &infileBase) const
Create a div containing the line numbers (for a source listing) 1 to nLines.
virtual bool GetImplFileName(TClass *cl, Bool_t filesys, TString &out_name) const
Return implementation file name.
virtual ULong_t Hash() const
Return hash value for this object.
Collectable string class.
TMethod * LocateMethodInCurrentLine(Ssiz_t &posMethodName, TString &ret, TString &name, TString ¶ms, Bool_t &isconst, std::ostream &srcOut, TString &anchor, std::ifstream &sourcefile, Bool_t allowPureVirtual)
Search for a method starting at posMethodName, and return its return type, its name, and its arguments.
const char * GetReturnTypeName() const
Get full type description of function return type, e,g.: "class TDirectory*".
virtual void DeleteDirectiveOutput() const
Delete output generated by prior runs of all known directives; the output file names might have chang...
All ROOT classes may have RTTI (run time type identification) support added.
TClass * GetClassPointer(Bool_t load=kTRUE)
Get pointer to the base class TClass.
std::istream & ReadLine(std::istream &str, Bool_t skipWhite=kTRUE)
Read a line from stream upto newline skipping any whitespace.
virtual void SetOwner(Bool_t enable=kTRUE)
Set whether this collection is the owner (enable==true) of its content.
void SetTag(const char *tag)
virtual Bool_t GetResult(TString &result)=0
const char * GetTypeName() const
Get type of data member, e,g.: "class TDirectory*" -> "TDirectory".
virtual TObject * Last() const
Return the last object in the list. Returns 0 when list is empty.
TString fSourceInfoTags[kNumSourceInfos]
void AddClassDataMembersRecursively(TBaseClass *bc)
Add data members of fCurrentClass and of bc to datamembers, recursively.
const TString & GetLastUpdateTag() const
UInt_t InContext(Int_t context) const
checks whether we are in a parse context, return the entry closest to the current context...
TList * GetListOfDataMembers(Bool_t load=kTRUE)
Return list containing the TDataMembers of a class.
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
void DecrementMethodCount(const char *name)
reduce method count for method called name, removing it from fMethodCounts once the count reaches 0...
void ToLower()
Change string to lower-case.
Bool_t CopyHtmlFile(const char *sourceName, const char *destName="")
Copy file to HTML directory.
Each ROOT method (see TMethod) has a linked list of its arguments.
void GetCurrentModule(TString &out_module) const
Return the name of module for which sources are currently parsed.
const TString & GetDocStyle() const
TString & Prepend(const char *cs)
const char * GetFullTypeName() const
Get full type description of method argument, e.g.: "class TDirectory*".
void WriteClassDoc(std::ostream &out, Bool_t first=kTRUE)
Write the class description depending (among others) on fClassDocState.
virtual Int_t GetOverloadIdx() const =0
TMethod * GetMethodAllAny(const char *method)
Return pointer to method without looking at parameters.
virtual void DecorateEntityBegin(TString &str, Ssiz_t &pos, TDocParser::EParseContext type)
Add some colors etc to a source entity, contained in str.
virtual void AddLast(TObject *obj)
Add object at the end of the list.
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
const TString & GetClassDocTag() const
TString & Replace(Ssiz_t pos, Ssiz_t n, const char *s)
virtual void Sort(Bool_t order=kSortAscending)
Sort linked list.
virtual void DecorateEntityEnd(TString &str, Ssiz_t &pos, TDocParser::EParseContext type)
Add some colors etc to a source entity, contained in str.
void RemoveCommentContext(Bool_t cxxcomment)
remove the top-most comment context that matches cxxcomment,
virtual Bool_t ProcessComment()
virtual void ExpandCPPLine(TString &line, Ssiz_t &pos)
Expand preprocessor statements.
void WriteSourceLine(std::ostream &out)
Write fLineSource to out.
void SetCounter(Int_t count)
Long_t Property() const
Get property description word. For meaning of bits see EProperty.
void Convert(std::ostream &out, std::istream &in, const char *relpath, Bool_t isCode, Bool_t interpretDirectives)
Parse text file "in", add links etc, and write output to "out".
virtual ~TDocParser()
destructor, checking whether all methods have been found for gDebug > 3
virtual const char * PrependPathName(const char *dir, TString &name)
Concatenate a directory and a file name.
static Bool_t Strip(TString &s)
strips ' ', tabs, and newlines from both sides of str
Long_t Property() const
Get property description word. For meaning of bits see EProperty.
virtual bool GetFileNameFromInclude(const char *included, TString &out_fsname) const
Set out_fsname to the full pathname corresponding to a file included as "included".
TDataType * GetDataType() const
Ssiz_t First(char c) const
Find first occurrence of a character c.
void WriteHtmlFooter(std::ostream &out, const char *dir, const char *lastUpdate, const char *author, const char *copyright, const char *footer)
Write HTML footer.
const TList * GetListForObject(const char *name) const
Return the THashTable's list (bucket) in which obj can be found based on its hash; see THashTable::Ge...
virtual void GetModuleNameForClass(TString &module, TClass *cl) const
Return the module name for a given class.
void SetParser(TDocParser *parser)
Set the parser, and fDocOutput, fHtml from that.
virtual void Parse(std::ostream &out)
Locate methods, starting in the source file, then inline, then immediately inside the class declarati...
static Bool_t IsWord(UChar_t c)
Check if c is a valid first character for C++ name.
virtual TClass * IsDirective(const TString &line, Ssiz_t pos, const TString &word, Bool_t &begin) const
return whether word at line's pos is a valid directive, and returns its TDocDirective's TClass object...
virtual void AdjustSourcePath(TString &line, const char *relpath="../")
adjust the path of links for source files, which are in src/, but need to point to relpath (usually "...
const TString & GetAuthorTag() const
virtual TList * GetListOfMethodArgs()
Returns methodarg list and additionally updates fDataMember in TMethod by calling FindDataMember();...
void WriteMethod(std::ostream &out, TString &ret, TString &name, TString ¶ms, Bool_t isconst, const char *file, TString &anchor, TString &codeOneLiner)
Write a method, forwarding to TClassDocOutput.
virtual void ReferenceEntity(TSubString &str, TClass *entity, const char *comment=0)
Create a reference to a class documentation page.
virtual TObject * FindObject(const char *name) const
Must be redefined in derived classes.
virtual TObject * First() const
Return the first object in the list. Returns 0 when list is empty.
virtual Bool_t IsSortable() const
R__EXTERN TSystem * gSystem
TString fCurrentMethodTag
Basic data type descriptor (datatype information is obtained from CINT).
virtual const char * ReplaceSpecialChars(char c)
Replace ampersand, less-than and greater-than character, writing to out.
static void AnchorFromLine(const TString &line, TString &anchor)
Create an anchor from the given line, by hashing it and convertig the hash into a custom base64 strin...
virtual void NameSpace2FileName(TString &name)
Replace "::" in name by "__" Replace "<", ">", " ", ",", "~", "=" in name by "_" Replace "A::X<A::Y>"...
virtual TObject * Remove(TObject *obj)
Remove object from the list.
virtual Bool_t HandleDirective(TString &keyword, Ssiz_t &pos, TString &word, Ssiz_t &copiedToCommentUpTo)
Process directives to the documentation engine, like "Begin_Html" / "End_Html", "Begin_Macro" / "End_...
Bool_t BeginsWith(const char *s, ECaseCompare cmp=kExact) const
Collection abstract base class.
const char * GetName() const
Returns name of object.
static Bool_t IsName(UChar_t c)
Check if c is a valid C++ name character.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
std::map< std::string, Int_t > fMethodCounts
TVirtualMutex * GetMakeClassMutex() const
TSubString Strip(EStripType s=kTrailing, char c=' ') const
Return a substring of self stripped at beginning and/or end.
The ROOT global object gROOT contains a list of all defined classes.
void LocateMethodsInHeaderInline(std::ostream &out)
Given fCurrentClass, look for methods in its header file, and extract documentation to out...
enum TDocParser::@86 fClassDocState
virtual Int_t Compare(const TObject *obj) const
Compare abstract method.
virtual TObject * At(Int_t idx) const
Returns the object at position idx. Returns 0 if idx is out of range.
Global variables class (global variables are obtained from CINT).
virtual TMethod * GetMethod() const =0
Bool_t InheritsFrom(const char *cl) const
Return kTRUE if this class inherits from a class with name "classname".
virtual bool GetDeclFileName(TClass *cl, Bool_t filesys, TString &out_name) const
Return declaration file name; return the full path if filesys is true.
Each class (see TClass) has a linked list of its base class(es).
void LocateMethodsInHeaderClassDecl(std::ostream &out)
Given fCurrentClass, look for methods in its header file's class declaration block, and extract documentation to out, while beautifying the header file in parallel.
void Rehash(Int_t newCapacity)
Rehash the hashlist.
virtual void FixupAuthorSourceInfo(TString &authors)
Special author treatment; called when TDocParser::fSourceInfo[kInfoAuthor] is set.
TString & Remove(Ssiz_t pos)
TString fSourceInfo[kNumSourceInfos]
void SetParameters(const char *params)
Given a string containing parameters in params, we call AddParameter() for each of them...
TObjArray * Tokenize(const TString &delim) const
This function is used to isolate sequential tokens in a TString.
std::set< UInt_t > fExtraLinesWithAnchor
virtual const char * GetTypeName() const
Get type of global variable, e,g.
virtual void DecorateKeywords(std::ostream &out, const char *text)
Expand keywords in text, writing to out.
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
static constexpr double s
const char * AsString() const
Return the date & time as a string (ctime() format).
#define R__LOCKGUARD(mutex)
EParseContext Context() const
Long_t Property() const
Get property description word. For meaning of bits see EProperty.
static TClass * GetClass(const char *name, Bool_t load=kTRUE, Bool_t silent=kFALSE)
Static method returning pointer to TClass of the specified class name.
virtual void Clear(Option_t *option="")
Remove all objects from the list.
std::list< UInt_t > fParseContext
Int_t Match(const TString &s, UInt_t start=0)
Runs a match on s against the regex 'this' was created with.
Mother of all ROOT objects.
virtual const char * GetEndTag() const =0
virtual TClass * GetClass(const char *name) const
Return pointer to class with name.
const TString & GetCopyrightTag() const
virtual void Add(TObject *obj)
Wrapper for PCRE library (Perl Compatible Regular Expressions).
virtual void RemoveAll(TCollection *col)
Remove all objects in collection col from this collection.
TDocOutput * GetDocOutput() const
Each ROOT class (see TClass) has a linked list of methods.
virtual void InitKeywords() const
fill C++ keywords into fgKeywords
TClass * GetClass() const
void LocateMethods(std::ostream &out, const char *filename, Bool_t lookForSourceInfo=kTRUE, Bool_t useDocxxStyle=kFALSE, Bool_t allowPureVirtual=kFALSE, const char *methodPattern=0, const char *sourceExt=0)
Collect methods from the source or header file called filename.
Int_t CountChar(Int_t c) const
Return number of times character c occurs in the string.
virtual TObjLink * LastLink() const
static std::set< std::string > fgKeywords
void AddClassMethodsRecursively(TBaseClass *bc)
Add accessible (i.e.
TDataMember * GetDataMember(const char *datamember) const
Return pointer to datamember object with name "datamember".
TMethod * GetMethodAny(const char *method)
Return pointer to method without looking at parameters.
virtual const char * GetName() const
Returns name of object.
virtual Int_t GetSize() const
const TPathDefinition & GetPathDefinition() const
Return the TModuleDefinition (or derived) object as set by SetModuleDefinition(); create and return a...
TList * GetListOfMethods(Bool_t load=kTRUE)
Return list containing the TMethods of a class.
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
void LocateMethodsInSource(std::ostream &out)
Given fCurrentClass, look for methods in its source file, and extract documentation to out...
virtual void DeleteOutput() const
This class stores the date and time with a precision of one second in an unsigned 32 bit word (950130...
virtual void AddLine(const TSubString &line)=0
void * New(ENewType defConstructor=kClassNew, Bool_t quiet=kFALSE) const
Return a pointer to a newly allocated object of this class.
const char * Data() const