13#include "RConfigure.h"
44 class THtmlThreadInfo {
46 THtmlThreadInfo(
THtml* html,
bool force): fHtml(html), fForce(force) {}
47 Bool_t GetForce()
const {
return fForce;}
48 THtml* GetHtml()
const {
return fHtml;}
75 if (fHtml && html && html != fHtml) {
76 Error(
"SetOwner()",
"Object already owned by an THtml instance!");
77 fHtml->HelperDeleted(
this);
107 out_modulename =
"USER";
108 if (!cl)
return false;
118 TString inputdir = GetOwner()->GetInputPath();
137 while (out_modulename[0] ==
'.')
138 out_modulename.
Remove(0, 1);
140 while (out_modulename[0] ==
'/')
141 out_modulename.
Remove(0, 1);
142 while (out_modulename.
EndsWith(
"/"))
145 if (!out_modulename[0])
146 out_modulename = trailingInclude;
148 if (!out_modulename[0])
149 out_modulename = trailingInclude;
159 pos = out_modulename.
Index(
"/inc/");
161 out_modulename.
Remove(pos);
164 while (out_modulename.
EndsWith(
"/"))
168 if (out_modulename ==
"MATH/GENVECTOR")
169 out_modulename =
"MATHCORE";
170 else if (out_modulename ==
"MATH/MATRIX")
171 out_modulename =
"SMATRIX";
172 else if (!out_modulename.
Length()) {
174 if (strstr(
cname,
"::SMatrix<") || strstr(
cname,
"::SVector<"))
175 out_modulename =
"SMATRIX";
176 else if (strstr(
cname,
"::TArrayProxy<") || strstr(
cname,
"::TClaArrayProxy<")
177 || strstr(
cname,
"::TImpProxy<") || strstr(
cname,
"::TClaImpProxy<"))
178 out_modulename =
"TREEPLAYER";
186 out_modulename.
Remove(0,3);
187 pos = out_modulename.
Index(
'.');
191 if (!out_modulename.
Length()) {
192 out_modulename =
"USER";
208 THtml* owner = GetOwner();
241 while (clname.
Tokenize(token, from,
"::") ) {
265 return GetFileName(cl,
true, out_filename, out_fsys, fse);
282 return GetFileName(cl,
false, out_filename, out_fsys, fse);
291 static const char* delim[] = {
"/",
"\\\\"};
292 for (
int i = 0; i < 2; ++i) {
293 const char*
d = delim[i];
320 if (!
filename.EndsWith(filesysname)) {
327 if (fse) *fse = fsentry;
354 NormalizePath(clfile);
356 out_filename = clfile;
363 if (clfile ==
"include/TMathBase.h") {
364 clfile =
"math/mathcore/inc/TMath.h";
365 out_filename = clfile;
374 longestMatch = inclDir.
Length();
376 if (longestMatch !=
kNPOS) {
377 clfile.
Remove(0, longestMatch);
381 GetOwner()->GetPathDefinition().GetFileNameFromInclude(asincl, clfile);
382 out_filename = clfile;
385 filesysname = MatchFileSysName(out_filename, fse);
386 if (filesysname[0]) {
387 clfile = out_filename;
393 int templateLevel = 0;
396 for (; start >= 0 && (templateLevel || filesysname[start] !=
':'); --start) {
397 if (filesysname[start] ==
'>')
399 else if (filesysname[start] ==
'<') {
405 filesysname = filesysname(start + 1, end - start - 1);
409 filesysname +=
".cxx";
410 out_filename = filesysname;
411 filesysname = MatchFileSysName(out_filename, fse);
412 if (filesysname[0]) {
413 clfile = out_filename;
417 if (!decl && !clfile.
Length()) {
422 if (GetFileName(cl,
true, filesysname, declSysFileName)) {
426 filesysname.
Remove(posExt);
427 filesysname +=
".cxx";
428 out_filename = filesysname;
429 filesysname = MatchFileSysName(out_filename, fse);
430 if (filesysname[0]) {
431 clfile = out_filename;
436 if (clfile.
Length() && !decl) {
442 static const char* vetoClasses[] = {
"math/mathcore/",
"math/mathmore/",
"math/genvector/",
443 "math/minuit2/",
"math/smatrix/"};
444 for (
unsigned int i = 0; i <
sizeof(vetoClasses) /
sizeof(
char*); ++i) {
445 if (clfile.
Contains(vetoClasses[i])) {
448 if (strcmp(cl->
GetName(),
"TComplex")
449 && strcmp(cl->
GetName(),
"TMath")
450 && strncmp(cl->
GetName(),
"TKDTree", 7)
451 && strcmp(cl->
GetName(),
"TVirtualFitter")
452 && strncmp(cl->
GetName(),
"TRandom", 7)) {
470 SplitClassIntoDirFile(out_filename, possiblePath, possibleFileName);
473 if (possibleFileName.
Length()) {
475 possibleFileName +=
".h";
477 possibleFileName +=
".cxx";
479 if (possiblePath.
Length())
482 possiblePath +=
"inc/";
484 possiblePath +=
"src/";
485 out_filename = possiblePath +
"/" + possibleFileName;
491 if (possiblePath.
Length())
492 ExpandSearchPath(possiblePath);
493 else possiblePath=
".";
497 NormalizePath(out_fsys);
516 if (!GetDocDir(module, moduledoc))
525 while (macropath.
Tokenize(macrodirpart, pos,
":")) {
526 out_dir += moduledoc +
"/" + macrodirpart +
":";
546 doc_dir =
"$ROOTSYS";
552 doc_dir += module +
"/";
553 doc_dir += GetOwner()->GetPathInfo().fDocPath;
575 if (!cl || !GetOwner())
return false;
582 bool includePathMatches =
false;
588 if (out_dir[0] ==
'/' || out_dir[0] ==
'\\')
590 includePathMatches =
true;
593 if (!includePathMatches) {
602 if (posInc ==
kNPOS)
return true;
603 hdr.
Remove(0, posInc + 5);
607 return (out_dir.
Length());
623 if (!included)
return false;
625 out_fsname = included;
628 const TList* bucket = GetOwner()->GetLocalFiles()->
GetEntries().GetListForObject(incBase);
629 if (!bucket)
return false;
633 TIter iEntry(bucket);
636 if (incBase != entry->
GetName())
continue;
639 for (
int i = arrSubDirs->
GetEntries() - 1; parent && i >= 0; --i) {
641 if (!subdir.
Length() || subdir ==
".")
643 if (subdir == parent->
GetName())
664 if (
gDebug > 0 || GetLevel() < 2)
665 Info(
"Recurse",
"scanning %s...", path);
669 const char* direntry = 0;
671 if (!direntry[0] || direntry[0] ==
'.' || regexp.
Match(direntry))
continue;
672 TString entryPath(dir + direntry);
689 subdir->
Recurse(db, entryPath);
691 int delen = strlen(direntry);
693 if (strcmp(direntry + delen - 4,
".cxx")
694 && strcmp(direntry + delen - 2,
".h")
695 && strcmp(direntry + delen - 4,
".hxx"))
718 Warning(
"Fill",
"Cannot read InputPath \"%s\"!", dir.
Data());
726 Warning(
"Fill",
"InputPath \"%s\" already present as \"%s\"!", dir.
Data(), prevroot->
GetName());
737 Warning(
"Fill",
"Cannot read InputPath \"%s\"!", dir.
Data());
1006// This is the description block. //
1010<p>The environment variable Root.Html.Description
1011(see: <a href="http://root.cern.ch/root/html/TEnv.html">TEnv</a>) contains
1012the delimiter string (default value: <tt>//_________________</tt>). It means
1013that you can also write your class description block like this:</p>
1015 //_____________________________________________________________
1016 // A description of the class starts with the line above, and
1017 // will take place here !
1020<p>Note that <b><i>everything</i></b> until the first non-commented line is considered
1021as a valid class description block.</p>
1023<h4><a name="syntax:classidx">III.2 Class index</a></h4>
1025<p>All classes to be documented will have an entry in the ClassIndex.html,
1026showing their name with a link to their documentation page and a miniature
1027description. This description for e.g. the class MyClass has to be given
1028in MyClass's header as a comment right after ClassDef(MyClass, n).</p>
1030<h4><a name="syntax:meth">III.3 Method documentation</a></h4>
1031<p>A member function description block starts immediately after '{'
1032and looks like this:</p>
1034 void TWorld::HelloWorldFunc(string *text)
1036 // This is an example of description for the
1037 // TWorld member function
1039 helloWorld.Print( text );
1042Like in a class description block, <b><i>everything</i></b> until the first
1043non-commented line is considered as a valid member function
1046If the rootrc variable <tt>Root.Html.DescriptionStyle</tt> is set to
1047<tt>Doc++</tt> THtml will also look for method documentation in front of
1048the function implementation. This feature is not recommended; source code
1049making use of this does not comply to the ROOT documentation standards, which
1050means future versions of THtml might not support it anymore.
1052<h4><a name="syntax:datamem">III.4 Data member documentation</a></h4>
1054<p>Data members are documented by putting a C++ comment behind their
1055declaration in the header file, e.g.</p>
1057 int fIAmADataMember; // this is a data member
1061<h3><a name="directive">IV. Documentation directives</a></h3>
1062<em>NOTE that THtml does not yet support nested directives
1063(i.e. latex inside html etc)!</em>
1065<h4><a name="directive:html">IV.1 <tt>BEGIN<!-- -->_HTML</tt> <tt>END<!-- -->_HTML</tt>: include 'raw' HTML</a></h4>
1067<p>You can insert pure html code into your documentation comments. During the
1068generation of the documentation, this code will be inserted as is
1069into the html file.</p>
1070<p>Pure html code must be surrounded by the keywords
1071<tt>BEGIN<!-- -->_HTML</tt> and <tt>END<!-- -->_HTML</tt>, where the
1073An example of pure html code is this class description you are reading right now.
1075<a href="http://root.cern.ch/root/html/TDocHtmlDirective.html">TDocHtmlDirective</a>
1076object to process this directive.</p>
1078<h4><a name="directive:macro">IV.2 <tt>BEGIN<!-- -->_MACRO</tt> <tt>END<!-- -->_MACRO</tt>: include a picture generated by a macro</a></h4>
1080<p>THtml can create images from scripts. You can either call an external
1081script by surrounding it by "begin_macro"/"end_macro", or include an unnamed
1082macro within these keywords. The macro should return a pointer to an object;
1083this object will then be saved as a GIF file.</p>
1084<p>Objects deriving from
1085<a href="http://root.cern.ch/root/html/TGObject.html">TGObject</a> (GUI elements)
1086will need to run in graphics mode (non-batch). You must specify this as a parameter:
1087"Begin_macro(GUI)...".
1088To create a second tab that displays the source of the macro you can specify
1089the argument "Begin_macro(source)...".
1090Of course you can combine them,
1091e.g. as "Begin_macro(source,gui)...".
1093<a href="http://root.cern.ch/root/html/TDocMacroDirective.html">TDocMacroDirective</a>
1094object to process this directive.</p>
1095<p>This is an example:</p> END_HTML
1098 TCanvas* macro_example_canvas = new TCanvas("macro_example_canvas", "", 150, 150);
1099 macro_example_canvas->SetBorderSize(0);
1100 macro_example_canvas->SetFillStyle(1001);
1101 macro_example_canvas->SetFillColor(kWhite);
1102 macro_example_canvas->cd();
1103 TArc* macro_example_arc = new TArc(0.5,0.32,0.11,180,360);
1104 macro_example_arc->Draw();
1105 TEllipse* macro_example_ellipsis = new TEllipse(0.42,0.58,0.014,0.014,0,360,0);
1106 macro_example_ellipsis->SetFillStyle(0);
1107 macro_example_ellipsis->Draw();
1108 macro_example_ellipsis = new TEllipse(0.58,0.58,0.014,0.014,0,360,0);
1109 macro_example_ellipsis->SetFillStyle(0);
1110 macro_example_ellipsis->Draw();
1111 macro_example_ellipsis = new TEllipse(0.50,0.48,0.22,0.32,0,360,0);
1112 macro_example_ellipsis->SetFillStyle(0);
1113 macro_example_ellipsis->Draw();
1114 TLine* macro_example_line = new TLine(0.48,0.53,0.52,0.41);
1115 macro_example_line->Draw();
1116 return macro_example_canvas;
1121<h4><a name="directive:latex">IV.3 <tt>BEGIN<!-- -->_LATEX</tt> <tt>END<!-- -->_LATEX</tt>: include a latex picture</a></h4>
1123<p>You can specify <a href="http://root.cern.ch/root/html/TLatex.html">TLatex</a>
1124style text and let THtml convert it into an image by surrounding it by "Begin_Latex", "End_Latex".
1125You can have multiple lines, and e.g. align each line at the '=' sign by passing
1126the argument <tt>separator='='</tt>. You can also specify how to align these parts;
1127if you want the part left of the separator to be right aligned, and the right part
1128to be left aligned, you could specify <tt>align='rl'</tt>.
1129THtml uses a `<a href="http://root.cern.ch/root/html/TDocLatexDirective.html">TDocLatexDirective</a>`
1130object to process the directive.
1131This is an example output with arguments `<tt>separator='=', align='rl'</tt>:</p>`
1132END_HTML BEGIN_LATEX(separator='=', align='rl')#%kappa(x)^{2}=sin(x)^{x}
1133x=#%chi^{2} END_LATEX
1137<h3><a name="index">V. Product and module index</a></h3>
1139<p><a href="#THtml:MakeIndex">THtml::MakeIndex()</a> will generate index files for classes
1140and types, all modules, and the product which you can set by
1141<a href="#THtml:SetProductName">THtml::SetProductName()</a>.
1142THtml will make use of external documentation in the module and product index,
1143either by linking it or by including it.
1144The files for modules are searched based on the source file directory of the
1145module's classes.</p>
1147<p>A filename starting with "index." will be included in the index page;
1148all other files will be linked.
1149Only files ending on <tt>.html</tt> or <tt>.txt</tt> will be taken into account;
1150the text files will first be run through
1151<a href="#THtml:Convert">THtml::Convert()</a>.
1152You can see an example <a href="http://root.cern.ch/root/html/HIST_Index.html">here</a>;
1153the part between "Index of HIST classes" and "Jump to" is created by parsing
1154the module's doc directory.</p>
1156<h3><a name="aux">VI. Auxiliary files: style sheet, JavaScript, help page</a></h3>
1158<p>The documentation pages share a common set of javascript and CSS files. They
1159are generated automatically when running <a href="#THtml:MakeAll">MakeAll()</a>;
1160they can be generated on
1161demand by calling <a href="#THtml:CreateAuxiliaryFiles">CreateAuxiliaryFiles()</a>.</p>
1164<h3><a name="charts">VII. Class Charts</a></h3>
1165THtml can generate a number of graphical representations for a class, which
1166are displayed as a tabbed set of imaged on-top of the class description.
1167It can show the inheritance, inherited and hidden members, directly and
1168indirectly included files, and library dependencies.
1170These graphs are generated using the <a href="http://www.graphviz.org/">Graphviz</a>
1171package. You can install it from <a href="http://www.graphviz.org">http://www.graphviz.org</a>.
1172You can either put it into your $PATH, or tell THtml where to find it by calling
1173<a href="#THtml:SetDotDir">SetDotDir()</a>.
1176<h3><a name="confvar">VIII. Configuration variables</a></h3>
1178<p>Here is a list of all configuration variables that are known to THtml.
1179You can set them in your .rootrc file, see
1180<a href="http://root.cern.ch/root/html/TEnv.html">TEnv</a>.</p>
1183 Root.Html.OutputDir (default: htmldoc)
1184 Root.Html.SourceDir (default: .:src/:include/)
1185 Root.Html.Author (default: // Author:) - start tag for authors
1186 Root.Html.LastUpdate (default: // @(#)) - start tag for last update
1187 Root.Html.Copyright (default: * Copyright) - start tag for copyright notice
1188 Root.Html.Description (default: //____________________ ) - start tag for class descr
1189 Root.Html.HomePage (default: ) - URL to the user defined home page
1190 Root.Html.Header (default: ) - location of user defined header
1191 Root.Html.Footer (default: ) - location of user defined footer
1192 Root.Html.Root (default: ) - URL of Root's class documentation
1193 Root.Html.SearchEngine (default: ) - link to the search engine
1194 Root.Html.Search (default: ) - link to search by replacing "%s" with user input
1195 Root.Html.ViewCVS (default: ) - URL of ViewCVS base
1196 Root.Html.XWho (default: http://consult.cern.ch/xwho/people?) - URL of CERN's xWho
1197 Root.Html.Charset (default: ISO-8859-1) - HTML character set
1200<h3><a name="how">IX. Behind the scene</a></h3>
1202<p>Internally, THtml is just an API class that sets up the list of known
1203classes, and forwards API invocations to the "work horses".
1204<a href="http://root.cern.ch/root/html/TDocOutput.html">TDocOutput</a>
1205generates the output by letting a
1206<a href="http://root.cern.ch/root/html/TDocParser.html">TDocParser</a>
1207object parse the sources, which in turn invokes objects deriving from
1208<a href="http://root.cern.ch/root/html/TDocDirective.html">TDocDirective</a>
1209to process directives.</p>
1267 if (
gHtml ==
this) {
1285 const char pathDelimiter =
1399 if (lib && strlen(lib)) {
1400 std::map<std::string, TString>::const_iterator iUrl =
fLinkInfo.
fLibURLs.find(lib);
1418 Info(
"HaveDot",
"Checking for Graphviz (dot)...");
1424 Info(
"HaveDot",
"Running: %s", runDot.
Data());
1441 for (
int i = 0; who && i < 3; ++i)
1442 if (who == helpers[i])
1443 helpers[i] = who = 0;
1471 const char *dirname ,
const char *relpath ,
1472 Int_t includeOutput ,
1473 const char* context )
1487 dir = dfltdir.
Data();
1497 char *cRealFilename =
1500 if (!cRealFilename) {
1505 TString realFilename = cRealFilename;
1506 delete[] cRealFilename;
1509 std::ifstream sourceFile;
1510 sourceFile.open(realFilename, std::ios::in);
1512 if (!sourceFile.good()) {
1513 Error(
"Convert",
"Can't open file '%s' !", realFilename.
Data());
1519 "Directory '%s' doesn't exist, or it's write protected !", dir);
1530 Warning(
"Convert",
"Output requested but cannot initialize graphics: GUI and GL windows not be available");
1531 output.Convert(sourceFile, realFilename, tmp1, title, relpath, includeOutput, context,
fGClient);
1542 module =
"(UNKNOWN)";
1560 Info(
"CreateListOfClasses",
"Initializing - this might take a while...");
1572 if (filter && (!filter[0] || !strcmp(filter,
"*")))
1577 bool skipROOTClasses =
false;
1578 std::set<std::string> rootLibs;
1579 TList classesDeclFileNotFound;
1580 TList classesImplFileNotFound;
1583 for (
Int_t i = -1; i < totalNumberOfClasses; i++) {
1586 const char *
cname = 0;
1587 if (i < 0)
cname =
"TObject";
1592 if (i >= 0 && !strcmp(
cname,
"TObject")) {
1598 if (strstr(
cname,
"__gnu_cxx::"))
continue;
1600 if (!strcmp(
cname,
"timespec"))
continue;
1602 if (!strncmp(
cname,
"tuple<", 6))
continue;
1607 if (!classPtr)
continue;
1610 cname = shortName.c_str();
1637 skipROOTClasses =
true;
1638 Info(
"CreateListOfClasses",
"Cannot find header file for TObject at %s given the input path %s.",
1640 Info(
"CreateListOfClasses",
"Assuming documentation is not for ROOT classes, or you need to pass "
1641 "the proper directory to THtml::SetInputDir() so I can find %s.", classPtr->
GetDeclFileName());
1666 if (skipROOTClasses) {
1669 size_t posSpace = lib.find(
' ');
1670 if (posSpace != std::string::npos)
1671 lib.erase(posSpace);
1672 if (rootLibs.find(lib) == rootLibs.end()) {
1675 if (sLib.
Index(
'.') == -1) {
1683 classesDeclFileNotFound.
AddLast(classPtr);
1684 else rootLibs.insert(lib);
1688 static const char* rootClassesToIgnore[] =
1689 {
"ColorStruct_t",
"CpuInfo_t",
"Event_t",
"FileStat_t",
"GCValues_t",
"MemInfo_t",
1690 "PictureAttributes_t",
"Point_t",
"ProcInfo_t",
"ROOT",
"ROOT::Fit",
1691 "Rectangle_t",
"RedirectHandle_t",
"Segment_t",
"SetWindowAttributes_t",
1692 "SysInfo_t",
"TCint",
"UserGroup_t",
"WindowAttributes_t",
"timespec", 0};
1693 static const char* rootClassStemsToIgnore[] =
1694 {
"ROOT::Math",
"TKDTree",
"TMatrixT",
"TParameter",
"vector", 0 };
1695 static size_t rootClassStemsToIgnoreLen[] = {0, 0, 0, 0, 0};
1696 static std::set<std::string> setRootClassesToIgnore;
1697 if (setRootClassesToIgnore.empty()) {
1698 for (
int ii = 0; rootClassesToIgnore[ii]; ++ii)
1699 setRootClassesToIgnore.insert(rootClassesToIgnore[ii]);
1700 for (
int ii = 0; rootClassStemsToIgnore[ii]; ++ii)
1701 rootClassStemsToIgnoreLen[ii] = strlen(rootClassStemsToIgnore[ii]);
1704 if (setRootClassesToIgnore.find(
cname) == setRootClassesToIgnore.end()) {
1705 bool matched =
false;
1706 for (
int ii = 0; !matched && rootClassStemsToIgnore[ii]; ++ii)
1707 matched = !strncmp(
cname, rootClassStemsToIgnore[ii], rootClassStemsToIgnoreLen[ii]);
1709 classesDeclFileNotFound.
AddLast(classPtr);
1718 classesDeclFileNotFound.
AddLast(classPtr);
1729 classesImplFileNotFound.
AddLast(classPtr);
1732 if (!htmlfilename.
Length())
1750 if (!modulename.
Length() || modulename ==
"USER")
1759 if (parentModuleName.
Length() && parentModuleName !=
".") {
1765 while (parentModuleName.
Tokenize(token, pos,
"/")) {
1766 if (!token.
Length() || token ==
".")
continue;
1789 Info(
"CreateListOfClasses",
"Adding class %s, module %s (%sselected)",
1796 bool cannotFind =
false;
1797 if (!classesDeclFileNotFound.
IsEmpty()) {
1798 Warning(
"CreateListOfClasses",
1799 "Cannot find the header for the following classes [reason]:");
1800 TIter iClassesDeclFileNotFound(&classesDeclFileNotFound);
1802 while ((iClass = (
TClass*)iClassesDeclFileNotFound())) {
1807 Warning(
"CreateListOfClasses",
" %s [header file is unknown]", iClass->
GetName());
1812 Warning(
"CreateListOfClasses",
1813 "Cannot find the source file for the following classes [reason]:");
1814 TIter iClassesDeclFileNotFound(&classesImplFileNotFound);
1816 while ((iClass = (
TClass*)iClassesDeclFileNotFound())) {
1821 Info(
"CreateListOfClasses",
" %s [source file is unknown, add \"ClassImpl(%s)\" to source file if it exists]",
1826 Warning(
"CreateListOfClasses",
"THtml cannot find all headers and sources. ");
1827 Warning(
"CreateListOfClasses",
1828 "You might need to adjust the input path (currently %s) by calling THtml::SetInputDir()",
1836 while ((dt = (
TDataType*) iTypedef())) {
1837 if (dt->
GetType() != -1)
continue;
1842 Info(
"CreateListOfClasses",
"Adding typedef %s to class %s",
1845 bool inNamespace =
true;
1847 Ssiz_t posTemplate = surroundingNamespace.
Last(
'>');
1848 inNamespace = inNamespace && (posTemplate ==
kNPOS);
1850 Ssiz_t posColumn = surroundingNamespace.
Last(
':');
1851 if (posColumn !=
kNPOS) {
1852 surroundingNamespace.
Remove(posColumn - 1);
1854 inNamespace = inNamespace && (!clSurrounding ||
IsNamespace(clSurrounding));
1859 output.NameSpace2FileName(htmlfilename);
1860 htmlfilename +=
".html";
1885 Warning(
"CreateListOfClasses",
"Product not set. You should call gHtml->SetProductName(\"MyProductName\");");
1887 if (
GetViewCVS().Contains(
"http://root.cern.ch/"))
1898 Info(
"CreateListOfClasses",
"Initializing - DONE.");
1908 output.CreateTypeIndex();
1909 output.CreateClassTypeDefs();
1926 Warning(
"CopyFileFromEtcDir",
"Could not copy %s to %s", inFile.
Data(), outFile.
Data());
1939 output.CreateHierarchy();
1970 if (!candidate)
continue;
1973 TClass* currentBaseOfCandidate = candidate;
1974 while (currentBaseOfCandidate != cl) {
1976 if (!bases)
continue;
1983 currentBaseOfCandidate = clBase;
1987 derived[candidate] = level;
2004 if (!classPtr)
return;
2016 const char *colon = strchr(cFilename,
':');
2019 libName =
TString(cFilename, colon - cFilename);
2029 if (posSpace !=
kNPOS)
2033 libnameBase.
Remove(0, 3);
2037 if (libnameBase.
Length())
2038 libName = libnameBase;
2045 htmlFileName =
GetURL(libName);
2047 htmlFileName =
"./";
2049 if (htmlFileName.
Length()) {
2053 output.NameSpace2FileName(className);
2078 if(!name1 || !name1[0])
return 0;
2080 if (strstr(name1,
"ROOT::")==name1) {
2082 if (!strncmp(name1 + 6,
"Math", 4)) ret =
kFALSE;
2130 bool determine = (!cdi);
2132 if (!determine) determine |= decl && !filesys && !cdi->
GetDeclFileName()[0];
2134 if (!determine) determine |= !decl && !filesys && !cdi->
GetImplFileName()[0];
2159 if (filesys) out_name = sysname;
2160 else out_name =
name;
2184 Long_t sId, sFlags, sModtime;
2188 if (st || !(sFlags & 2)) {
2190 Error(
"GetOutputDir",
"output directory %s is an existing file",
2230 if (numthreads == 1) {
2243 if (numthreads == -1) {
2246 numthreads = sysinfo.
fCpus;
2252 THtmlThreadInfo hti(
this, force);
2261 while (--numthreads >= 0) {
2264 threads.
Add(thread);
2267 TIter iThread(&threads);
2271 while (wait && (thread = (
TThread*) iThread()))
2278 while ((thread = (
TThread*) iThread()))
2299 Error(
"MakeClass",
"Unknown class '%s'!", className);
2321 if (!currentClass) {
2324 Error(
"MakeClass",
"Class '%s' is known, but I cannot find its TClass object!", cdi->
GetName());
2341 what +=
" (sources not found)";
2354 const THtmlThreadInfo* hti = (
const THtmlThreadInfo*)info;
2357 while ((classinfo = hti->GetHtml()->GetNextClass()))
2358 hti->GetHtml()->MakeClass(classinfo, hti->GetForce());
2375 output.CreateTypeIndex();
2376 output.CreateClassTypeDefs();
2377 output.CreateModuleIndex();
2378 output.CreateClassIndex();
2379 output.CreateProductIndex();
2382 output.CreateHierarchy();
2399 Error(
"MakeTree",
"Unknown class '%s' !", className);
2522 const char* tmplt = strchr(
name,
'<');
2523 if (!tmplt)
return name;
2524 tmplt = strrchr(tmplt,
':');
2525 if (tmplt >
name && tmplt[-1] ==
':') {
R__EXTERN TClassTable * gClassTable
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char filename
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char cname
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t src
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void reg
void Printf(const char *fmt,...)
Formats a string in a circular formatting buffer and prints the string.
R__EXTERN const char * gProgName
Bool_t R_ISDIR(Int_t mode)
R__EXTERN TSystem * gSystem
R__EXTERN TVirtualMutex * gGlobalMutex
#define R__LOCKGUARD(mutex)
Each class (see TClass) has a linked list of its base class(es).
TClass * GetClassPointer(Bool_t load=kTRUE)
Get pointer to the base class TClass.
const char * GetImplFileName() const
Bool_t HaveSource() const
const char * GetImplFileSysName() const
void SetDeclFileName(const char *name)
TModuleDocInfo * GetModule() const
void SetImplFileSysName(const char *fsname)
virtual const char * GetName() const
Returns name of object.
void SetImplFileName(const char *name)
void SetModule(TModuleDocInfo *module)
void SetSelected(Bool_t sel=kTRUE)
const char * GetHtmlFileName() const
void SetDeclFileSysName(const char *fsname)
Bool_t IsSelected() const
const char * GetDeclFileSysName() const
void SetHtmlFileName(const char *name)
TList & GetListOfTypedefs()
const char * GetDeclFileName() const
TDictionary * GetClass() const
void MakeTree(Bool_t force=kFALSE)
Create an output file with a graphical representation of the class inheritance.
void Class2Html(Bool_t force=kFALSE)
Create HTML files for a single class.
static char * Next()
Returns next class from sorted class table.
TClass instances represent classes, structs and namespaces in the ROOT type system.
const char * GetImplFileName() const
TList * GetListOfBases()
Return list containing the TBaseClass(es) of a class.
ClassInfo_t * GetClassInfo() const
Bool_t InheritsFrom(const char *cl) const override
Return kTRUE if this class inherits from a class with name "classname".
const char * GetSharedLibs()
Get the list of shared libraries containing the code for class cls.
Long_t Property() const override
Returns the properties of the TClass as a bit field stored as a Long_t value.
const char * GetDeclFileName() const
Return name of the file containing the declaration of this class.
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 Int_t GetEntries() const
virtual void SetOwner(Bool_t enable=kTRUE)
Set whether this collection is the owner (enable==true) of its content.
virtual Bool_t IsEmpty() const
virtual Int_t GetSize() const
Return the capacity of the collection, i.e.
Basic data type descriptor (datatype information is obtained from CINT).
const char * GetFullTypeName() const
Get full type description of typedef, e,g.: "class TDirectory*".
virtual Int_t GetValue(const char *name, Int_t dflt) const
Returns the integer value for a resource.
void Add(ULong64_t hash, Long64_t key, Long64_t value)
Add an (key,value) pair to the table. The key should be unique.
Long64_t GetValue(ULong64_t hash, Long64_t key)
Return the value belonging to specified key and hash value.
void Clear(Option_t *option="") override
Remove all objects from the list.
TObject * FindObject(const char *name) const override
Find object using its name.
void Add(TObject *obj) override
Add object to the hash table.
TString MatchFileSysName(TString &filename, TFileSysEntry **fse=0) const
Find filename in the list of system files; return the system file name and change filename to the fil...
virtual bool GetDeclFileName(const TClass *cl, TString &out_filename, TString &out_fsys, TFileSysEntry **fse=0) const
Determine cl's declaration file name.
void NormalizePath(TString &path) const
Remove "/./" and collapse "/subdir/../" to "/".
void SplitClassIntoDirFile(const TString &clname, TString &dir, TString &filename) const
Given a class name with a scope, split the class name into directory part and file name: A::B::C beco...
virtual bool GetImplFileName(const TClass *cl, TString &out_filename, TString &out_fsys, TFileSysEntry **fse=0) const
Determine cl's implementation file name.
virtual bool GetFileName(const TClass *cl, bool decl, TString &out_filename, TString &out_fsys, TFileSysEntry **fse=0) const
Common implementation for GetDeclFileName(), GetImplFileName()
void ExpandSearchPath(TString &path) const
Create all permutations of path and THtml's input path: path being PP/ and THtml's input being ....
const TString & GetIgnore() const
THashTable & GetEntries()
Int_t GetMaxLevel() const
void Fill()
Recursively fill entries by parsing the path specified in GetName(); can be a THtml::GetDirDelimiter(...
void Recurse(TFileSysDB *db, const char *path)
Recursively fill entries by parsing the contents of path.
const char * GetName() const
Returns name of object.
TFileSysDir * GetParent() const
virtual void GetFullName(TString &fullname, Bool_t asIncluded) const
virtual ~THelperBase()
Helper's destructor.
void SetOwner(THtml *html)
Set the THtml object owning this object; if it's already set to a different THtml object than issue a...
virtual bool GetModule(TClass *cl, TFileSysEntry *fse, TString &out_modulename) const
Set out_modulename to cl's module name; return true if it's valid.
virtual bool GetIncludeAs(TClass *cl, TString &out_include_as) const
Determine the path and filename used in an include statement for the header file of the given class.
virtual bool GetFileNameFromInclude(const char *included, TString &out_fsname) const
Set out_fsname to the full pathname corresponding to a file included as "included".
virtual bool GetMacroPath(const TString &module, TString &out_dir) const
Determine the path to look for macros (see TDocMacroDirective) for classes from a given module.
virtual bool GetDocDir(const TString &module, TString &doc_dir) const
Determine the module's documentation directory.
Legacy ROOT documentation system.
void SetModuleDefinition(const TModuleDefinition &md)
Set the module defining object to be used; can also be a user derived object (a la traits).
THtml()
Create a THtml object.
virtual void CreateStyleSheet() const
Write the default ROOT style sheet.
const TString & GetViewCVS() const
DocEntityInfo_t fDocEntityInfo
const char * ShortType(const char *name) const
Get short type name, i.e. with default templates removed.
void SetPathDefinition(const TPathDefinition &pd)
Set the path defining object to be used; can also be a user derived object (a la traits).
virtual TClass * GetClass(const char *name) const
Return pointer to class with name.
const TString & GetInputPath() const
static Bool_t IsNamespace(const TClass *cl)
Check whether cl is a namespace.
void CreateListOfClasses(const char *filter)
Create the list of all known classes.
void SetOutputDir(const char *dir)
Set the directory where the HTML pages should be written to.
const TString & GetProductName() const
TVirtualMutex * fMakeClassMutex
void SetInputDir(const char *dir)
Set the directory containing the source files.
virtual bool GetDeclImplFileName(TClass *cl, bool filesys, bool decl, TString &out_name) const
Combined implementation for GetDeclFileName(), GetImplFileName(): Return declaration / implementation...
static void * MakeClassThreaded(void *info)
Entry point of worker threads for multi-threaded MakeAll().
void SetImplFileName(TClass *cl, const char *filename)
Explicitly set a impl file name for TClass cl.
void AddMacroPath(const char *path)
Add path to the directories to be searched for macro files that are to be executed via the TDocMacroD...
void SetDeclFileName(TClass *cl, const char *filename)
Explicitly set a decl file name for TClass cl.
void MakeTree(const char *className, Bool_t force=kFALSE)
Make an inheritance tree.
Int_t fThreadedClassCount
const TModuleDefinition & GetModuleDefinition() const
Return the TModuleDefinition (or derived) object as set by SetModuleDefinition(); create and return a...
TFileDefinition * fFileDef
void CreateHierarchy()
Create the inheritance hierarchy diagram for all classes.
static void LoadAllLibs()
Load all libraries known to ROOT via the rootmap system.
Bool_t HaveDot()
Check whether dot is available in $PATH or in the directory set by SetDotPath()
virtual void CreateAuxiliaryFiles() const
copy CSS, javascript file, etc to the output dir
void SetFileDefinition(const TFileDefinition &fd)
Set the file defining object to be used; can also be a user derived object (a la traits).
void MakeAll(Bool_t force=kFALSE, const char *filter="*", int numthreads=1)
Produce documentation for all the classes specified in the filter (by default "*") To process all cla...
void SetLocalFiles() const
Fill the files available in the file system below fPathInfo.fInputPath.
void GetDerivedClasses(TClass *cl, std::map< TClass *, Int_t > &derived) const
fill derived with all classes inheriting from cl and their inheritance distance to cl
void MakeClass(const char *className, Bool_t force=kFALSE)
Make HTML files for a single class.
virtual ~THtml()
Default destructor.
virtual bool GetDeclFileName(TClass *cl, Bool_t filesys, TString &out_name) const
Return declaration file name; return the full path if filesys is true.
TModuleDefinition * fModuleDef
void Convert(const char *filename, const char *title, const char *dirname="", const char *relpath="../", Int_t includeOutput=kNoOutput, const char *context="")
It converts a single text file to HTML.
void CreateListOfTypes()
Create index of all data types and a page for each typedef-to-class.
const PathInfo_t & GetPathInfo() const
virtual void CreateJavascript() const
Write the default ROOT style sheet.
void SetFoundDot(Bool_t found=kTRUE)
Set whether "dot" (a GraphViz utility) is available.
void SetViewCVS(const char *url)
OutputStyle_t fOutputStyle
virtual const char * GetEtcDir() const
Get the directory containing THtml's auxiliary files ($ROOTSYS/etc/html)
const TString & GetMacroPath() const
static const char * GetDirDelimiter()
virtual void GetHtmlFileName(TClass *classPtr, TString &filename) const
Return real HTML filename.
void MakeIndex(const char *filter="*")
Create the index files for the product, modules, all types, etc.
TClassDocInfo * GetNextClass()
Return the next class to be generated for MakeClassThreaded.
virtual void GetModuleNameForClass(TString &module, TClass *cl) const
Return the module name for a given class.
const TString & GetOutputDir(Bool_t createDir=kTRUE) const
Return the output directory as set by SetOutputDir().
TVirtualMutex * GetMakeClassMutex() const
void HelperDeleted(THelperBase *who)
Inform the THtml object that one of its helper objects was deleted.
TPathDefinition * fPathDef
virtual bool GetImplFileName(TClass *cl, Bool_t filesys, TString &out_name) const
Return implementation file name.
TIter * fThreadedClassIter
const TPathDefinition & GetPathDefinition() const
Return the TModuleDefinition (or derived) object as set by SetModuleDefinition(); create and return a...
const TFileDefinition & GetFileDefinition() const
Return the TFileDefinition (or derived) object as set by SetFileDefinition(); create and return a TFi...
Bool_t CopyFileFromEtcDir(const char *filename) const
Copy a file from $ROOTSYS/etc/html into GetOutputDir()
const char * GetURL(const char *lib=0) const
Get the documentation URL for library lib.
void Clear(Option_t *option="") override
Remove all objects from the list.
void Add(TObject *obj) override
void AddLast(TObject *obj) override
Add object at the end of the list.
TObject * At(Int_t idx) const override
Returns the object at position idx. Returns 0 if idx is out of range.
virtual void Sort(Bool_t order=kSortAscending)
Sort linked list.
void SetSelected(Bool_t sel=kTRUE)
void AddClass(TClassDocInfo *cl)
The TNamed class is the base class for all named ROOT classes.
const char * GetName() const override
Returns name of object.
Int_t GetEntries() const override
Return the number of objects in array (i.e.
Collectable string class.
Mother of all ROOT objects.
virtual const char * GetName() const
Returns name of object.
virtual TObject * Clone(const char *newname="") const
Make a clone of an object using the Streamer facility.
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
virtual const char * GetTitle() const
Returns title of object.
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
Wrapper for PCRE library (Perl Compatible Regular Expressions).
Int_t Match(const TString &s, UInt_t start=0)
Runs a match on s against the regex 'this' was created with.
static const TString & GetEtcDir()
Get the sysconfig directory in the installation. Static utility function.
static const TString & GetLibDir()
Get the library directory in the installation. Static utility function.
void ToLower()
Change string to lower-case.
Bool_t EndsWith(const char *pat, ECaseCompare cmp=kExact) const
Return true if string ends with the specified string.
Ssiz_t First(char c) const
Find first occurrence of a character c.
const char * Data() const
TString & ReplaceAll(const TString &s1, const TString &s2)
Ssiz_t Last(char c) const
Find last occurrence of a character c.
TObjArray * Tokenize(const TString &delim) const
This function is used to isolate sequential tokens in a TString.
Bool_t BeginsWith(const char *s, ECaseCompare cmp=kExact) const
TString & Remove(Ssiz_t pos)
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
virtual UInt_t LoadAllLibraries()
Load all libraries known to ROOT via the rootmap system.
virtual Bool_t ExpandPathName(TString &path)
Expand a pathname getting rid of special shell characters like ~.
virtual void FreeDirectory(void *dirp)
Free a directory.
virtual void * OpenDirectory(const char *name)
Open a directory. Returns 0 if directory does not exist.
virtual int CopyFile(const char *from, const char *to, Bool_t overwrite=kFALSE)
Copy a file.
virtual char * ConcatFileName(const char *dir, const char *name)
Concatenate a directory and a file name. User must delete returned string.
virtual const char * FindFile(const char *search, TString &file, EAccessMode mode=kFileExists)
Find location of file in a search path.
virtual int MakeDirectory(const char *name)
Make a directory.
virtual Int_t Exec(const char *shellcmd)
Execute a command.
virtual int GetSysInfo(SysInfo_t *info) const
Returns static system info, like OS type, CPU type, number of CPUs RAM size, etc into the SysInfo_t s...
virtual int Load(const char *module, const char *entry="", Bool_t system=kFALSE)
Load a shared library.
int GetPathInfo(const char *path, Long_t *id, Long_t *size, Long_t *flags, Long_t *modtime)
Get info about a file: id, size, flags, modification time.
virtual const char * PrependPathName(const char *dir, TString &name)
Concatenate a directory and a file name.
virtual Bool_t AccessPathName(const char *path, EAccessMode mode=kFileExists)
Returns FALSE if one can access a file using the specified access mode.
virtual const char * GetDirEntry(void *dirp)
Get a directory entry. Returns 0 if no more entries.
virtual const char * BaseName(const char *pathname)
Base name of a file name. Base name of /user/root is root.
virtual Bool_t IsAbsoluteFileName(const char *dir)
Return true if dir is an absolute pathname.
virtual void Sleep(UInt_t milliSec)
Sleep milliSec milli seconds.
virtual char * Which(const char *search, const char *file, EAccessMode mode=kFileExists)
Find location of file in a search path.
virtual Bool_t ProcessEvents()
Process pending events (GUI, timers, sockets).
virtual const char * GetSoExt() const
Get the shared library extension.
virtual TString GetDirName(const char *pathname)
Return the directory name in pathname.
<div class="legacybox"><h2>Legacy Code</h2> TThread is a legacy interface: there will be no bug fixes...
Long_t Join(void **ret=nullptr)
Join this thread.
Int_t Run(void *arg=nullptr, const int affinity=-1)
Start the thread.
virtual TVirtualMutex * Factory(Bool_t=kFALSE)=0
bool IsStdClass(const char *type)
return true if the class belongs to the std namespace
std::string ShortType(const char *typeDesc, int mode)
Return the absolute type of typeDesc.
THashList fShortClassNames
std::map< std::string, TString > fLibURLs