Logo ROOT  
Reference Guide
TClassDocOutput.cxx
Go to the documentation of this file.
1// @(#)root/html:$Id$
2// Author: Axel Naumann 2007-01-09
3
4/*************************************************************************
5 * Copyright (C) 1995-2007, Rene Brun and Fons Rademakers. *
6 * All rights reserved. *
7 * *
8 * For the licensing terms see $ROOTSYS/LICENSE. *
9 * For the list of contributors see $ROOTSYS/README/CREDITS. *
10 *************************************************************************/
11
12#include "TClassDocOutput.h"
13
14#include "TBaseClass.h"
15#include "TClassEdit.h"
16#include "TDataMember.h"
17#include "TMethodArg.h"
18#include "TDataType.h"
19#include "TDocInfo.h"
20#include "TDocParser.h"
21#include "TEnv.h"
22#include "TError.h"
23#include "THtml.h"
24#include "TMethod.h"
25#include "TROOT.h"
26#include "TSystem.h"
27#include "TVirtualPad.h"
28#include "TVirtualMutex.h"
29#include "Riostream.h"
30#include <sstream>
31
32//______________________________________________________________________________
33//
34// Write the documentation for a class or namespace. The documentation is
35// parsed by TDocParser and then passed to TClassDocOutput to generate
36// the class doc header, the class description, members overview, and method
37// documentation. All generic output functionality is in TDocOutput; it is
38// re-used in this derived class.
39//
40// You usually do not use this class yourself; it is invoked indirectly by
41// THtml. Customization of the output should happen via the interfaces defined
42// by THtml.
43//______________________________________________________________________________
44
45
47
48////////////////////////////////////////////////////////////////////////////////
49/// Create an object given the invoking THtml object, and the TClass
50/// object that we will generate output for.
51
53 TDocOutput(html), fHierarchyLines(0), fCurrentClass(cl),
54 fCurrentClassesTypedefs(typedefs), fParser(0)
55{
56 fParser = new TDocParser(*this, fCurrentClass);
57}
58
59////////////////////////////////////////////////////////////////////////////////
60/// Destructor, deletes fParser
61
63{
64 delete fParser;
65}
66
67////////////////////////////////////////////////////////////////////////////////
68/// Create HTML files for a single class.
69///
70
72{
73 gROOT->GetListOfGlobals(kTRUE);
74
75 // create a filename
76 TString filename(fCurrentClass->GetName());
77 NameSpace2FileName(filename);
78
80
81 filename += ".html";
82
83 if (!force && !IsModified(fCurrentClass, kSource)
85 Printf(fHtml->GetCounterFormat(), "-no change-", fHtml->GetCounter(), filename.Data());
86 return;
87 }
88
89 // open class file
90 std::ofstream classFile(filename);
91
92 if (!classFile.good()) {
93 Error("Make", "Can't open file '%s' !", filename.Data());
94 return;
95 }
96
97 Printf(fHtml->GetCounterFormat(), "", fHtml->GetCounter(), filename.Data());
98
99 // write a HTML header for the classFile file
101 WriteClassDocHeader(classFile);
102
103 // copy .h file to the Html output directory
104 TString declf;
106 CopyHtmlFile(declf);
107
108 // process a '.cxx' file
109 fParser->Parse(classFile);
110
111 // write classFile footer
112 WriteHtmlFooter(classFile, "",
116}
117
118////////////////////////////////////////////////////////////////////////////////
119/// Write the list of functions
120
121void TClassDocOutput::ListFunctions(std::ostream& classFile)
122{
123 // loop to get a pointers to method names
124
125 classFile << std::endl << "<div id=\"functions\">" << std::endl;
126 TString mangled(fCurrentClass->GetName());
127 NameSpace2FileName(mangled);
128 classFile << "<h2><a id=\"" << mangled
129 << ":Function_Members\"></a>Function Members (Methods)</h2>" << std::endl;
130
131 const char* tab4nbsp="&nbsp;&nbsp;&nbsp;&nbsp;";
132 TString declFile;
135 classFile << "&nbsp;<br /><b>"
136 << tab4nbsp << "This is an abstract class, constructors will not be documented.<br />" << std::endl
137 << tab4nbsp << "Look at the <a href=\""
138 << gSystem->BaseName(declFile)
139 << "\">header</a> to check for available constructors.</b><br />" << std::endl;
140
141 Int_t minAccess = 0;
143 minAccess = TDocParser::kPublic;
144 for (Int_t access = TDocParser::kPublic; access >= minAccess; --access) {
145
146 const TList* methods = fParser->GetMethods((TDocParser::EAccess)access);
147 if (methods->GetEntries() == 0)
148 continue;
149
150 classFile << "<div class=\"access\" ";
151 const char* accessID [] = {"priv", "prot", "publ"};
152 const char* accesstxt[] = {"private", "protected", "public"};
153
154 classFile << "id=\"func" << accessID[access] << "\"><b>"
155 << accesstxt[access] << ":</b>" << std::endl
156 << "<table class=\"func\" id=\"tabfunc" << accessID[access] << "\" cellspacing=\"0\">" << std::endl;
157
158 TIter iMethWrap(methods);
159 TDocMethodWrapper *methWrap = 0;
160 while ((methWrap = (TDocMethodWrapper*) iMethWrap())) {
161 const TMethod* method = methWrap->GetMethod();
162
163 // it's a c'tor - Cint stores the class name as return type
164 Bool_t isctor = (!strcmp(method->GetName(), method->GetReturnTypeName()));
165 // it's a d'tor - Cint stores "void" as return type
166 Bool_t isdtor = (!isctor && method->GetName()[0] == '~');
167
168 classFile << "<tr class=\"func";
169 if (method->GetClass() != fCurrentClass)
170 classFile << "inh";
171 classFile << "\"><td class=\"funcret\">";
172 if (kIsVirtual & method->Property()) {
173 if (!isdtor)
174 classFile << "virtual ";
175 else
176 classFile << " virtual";
177 }
178
179 if (kIsStatic & method->Property())
180 classFile << "static ";
181
182 if (!isctor && !isdtor)
183 fParser->DecorateKeywords(classFile, method->GetReturnTypeName());
184
185 TString mangledM(method->GetClass()->GetName());
186 NameSpace2FileName(mangledM);
187 classFile << "</td><td class=\"funcname\"><a class=\"funcname\" href=\"";
188 if (method->GetClass() != fCurrentClass) {
189 TString htmlFile;
190 fHtml->GetHtmlFileName(method->GetClass(), htmlFile);
191 classFile << htmlFile;
192 }
193 classFile << "#" << mangledM;
194 classFile << ":";
195 mangledM = method->GetName();
196 NameSpace2FileName(mangledM);
197 Int_t overloadIdx = methWrap->GetOverloadIdx();
198 if (overloadIdx) {
199 mangledM += "@";
200 mangledM += overloadIdx;
201 }
202 classFile << mangledM << "\">";
203 if (method->GetClass() != fCurrentClass) {
204 classFile << "<span class=\"baseclass\">";
205 ReplaceSpecialChars(classFile, method->GetClass()->GetName());
206 classFile << "::</span>";
207 }
208 ReplaceSpecialChars(classFile, method->GetName());
209 classFile << "</a>";
210
211 fParser->DecorateKeywords(classFile, const_cast<TMethod*>(method)->GetSignature());
212 bool propSignal = false;
213 bool propMenu = false;
214 bool propToggle = false;
215 bool propGetter = false;
216 if (method->GetTitle()) {
217 propSignal = (strstr(method->GetTitle(), "*SIGNAL*"));
218 propMenu = (strstr(method->GetTitle(), "*MENU*"));
219 propToggle = (strstr(method->GetTitle(), "*TOGGLE*"));
220 propGetter = (strstr(method->GetTitle(), "*GETTER"));
221 if (propSignal || propMenu || propToggle || propGetter) {
222 classFile << "<span class=\"funcprop\">";
223 if (propSignal) classFile << "<abbr title=\"emits a signal\">SIGNAL</abbr> ";
224 if (propMenu) classFile << "<abbr title=\"has a popup menu entry\">MENU</abbr> ";
225 if (propToggle) classFile << "<abbr title=\"toggles a state\">TOGGLE</abbr> ";
226 if (propGetter) {
227 TString getter(method->GetTitle());
228 Ssiz_t posGetter = getter.Index("*GETTER=");
229 getter.Remove(0, posGetter + 8);
230 classFile << "<abbr title=\"use " + getter + "() as getter\">GETTER</abbr> ";
231 }
232 classFile << "</span>";
233 }
234 }
235 classFile << "</td></tr>" << std::endl;
236 }
237 classFile << std::endl << "</table></div>" << std::endl;
238 }
239
240 classFile << "</div>" << std::endl; // class="functions"
241}
242
243////////////////////////////////////////////////////////////////////////////////
244/// Write the list of data members and enums
245
246void TClassDocOutput::ListDataMembers(std::ostream& classFile)
247{
248 // make a loop on data members
255
256 if (!haveDataMembers) return;
257
258 classFile << std::endl << "<div id=\"datamembers\">" << std::endl;
259 TString mangled(fCurrentClass->GetName());
260 NameSpace2FileName(mangled);
261 classFile << "<h2><a name=\"" << mangled
262 << ":Data_Members\"></a>Data Members</h2>" << std::endl;
263
264 for (Int_t access = 5; access >= 0 && !fHtml->IsNamespace(fCurrentClass); --access) {
265 const TList* datamembers = 0;
266 if (access > 2) datamembers = fParser->GetEnums((TDocParser::EAccess) (access - 3));
267 else datamembers = fParser->GetDataMembers((TDocParser::EAccess) access);
268 if (datamembers->GetEntries() == 0)
269 continue;
270
271 classFile << "<div class=\"access\" ";
272 const char* what = "data";
273 if (access > 2) what = "enum";
274 const char* accessID [] = {"priv", "prot", "publ"};
275 const char* accesstxt[] = {"private", "protected", "public"};
276
277 classFile << "id=\"" << what << accessID[access%3] << "\"><b>"
278 << accesstxt[access%3] << ":</b>" << std::endl
279 << "<table class=\"data\" id=\"tab" << what << accessID[access%3] << "\" cellspacing=\"0\">" << std::endl;
280
281 TIter iDM(datamembers);
282 TDataMember *member = 0;
283 TString prevEnumName;
284 Bool_t prevIsInh = kTRUE;
285
286 while ((member = (TDataMember*) iDM())) {
287 Bool_t haveNewEnum = access > 2 && prevEnumName != member->GetTypeName();
288 if (haveNewEnum) {
289 if (prevEnumName.Length()) {
290 classFile << "<tr class=\"data";
291 if (prevIsInh)
292 classFile << "inh";
293 classFile << "\"><td class=\"datatype\">};</td><td></td><td></td></tr>" << std::endl;
294 }
295 prevEnumName = member->GetTypeName();
296 }
297
298 classFile << "<tr class=\"data";
299 prevIsInh = (member->GetClass() != fCurrentClass);
300 if (prevIsInh)
301 classFile << "inh";
302 classFile << "\"><td class=\"datatype\">";
303 if (haveNewEnum) {
304 TString enumName(member->GetTypeName());
305 TString myScope(fCurrentClass->GetName());
306 myScope += "::";
307 enumName.ReplaceAll(myScope, "");
308 if (enumName.EndsWith("::"))
309 enumName += "<i>[unnamed]</i>";
310 Ssiz_t startClassName = 0;
311 if (!enumName.BeginsWith("enum "))
312 classFile << "enum ";
313 else
314 startClassName = 5;
315
316 Ssiz_t endClassName = enumName.Last(':'); // need template handling here!
317 if (endClassName != kNPOS && endClassName > 0 && enumName[endClassName - 1] == ':') {
318 // TClass* cl = fHtml->GetClass(TString(enumName(startClassName, endClassName - startClassName - 1)));
319 TSubString substr(enumName(startClassName, endClassName - startClassName + 1));
320 // if (cl)
321 // ReferenceEntity(substr, cl);
322 enumName.Insert(substr.Start() + substr.Length(), "</span>");
323 enumName.Insert(substr.Start(), "<span class=\"baseclass\">");
324 }
325 classFile << enumName << " { ";
326 } else
327 if (access < 3) {
328 if (member->Property() & kIsStatic)
329 classFile << "static ";
330 std::string shortTypeName(fHtml->ShortType(member->GetFullTypeName()));
331 fParser->DecorateKeywords(classFile, shortTypeName.c_str());
332 }
333
334 TString mangledM(member->GetClass()->GetName());
335 NameSpace2FileName(mangledM);
336 classFile << "</td><td class=\"dataname\"><a ";
337 if (member->GetClass() != fCurrentClass) {
338 classFile << "href=\"";
339 TString htmlFile;
340 fHtml->GetHtmlFileName(member->GetClass(), htmlFile);
341 classFile << htmlFile << "#";
342 } else
343 classFile << "name=\"";
344 classFile << mangledM;
345 classFile << ":";
346 mangledM = member->GetName();
347 NameSpace2FileName(mangledM);
348 classFile << mangledM << "\">";
349 if (member->GetClass() == fCurrentClass)
350 classFile << "</a>";
351 if (access < 3 && member->GetClass() != fCurrentClass) {
352 classFile << "<span class=\"baseclass\">";
353 ReplaceSpecialChars(classFile, member->GetClass()->GetName());
354 classFile << "::</span>";
355 }
356 ReplaceSpecialChars(classFile, member->GetName());
357
358 // Add the dimensions to "array" members
359 for (Int_t indx = 0; indx < member->GetArrayDim(); ++indx)
360 if (member->GetMaxIndex(indx) <= 0)
361 break;
362 else
363 classFile << "[" << member->GetMaxIndex(indx) << "]";
364
365 if (member->GetClass() != fCurrentClass)
366 classFile << "</a>";
367 classFile << "</td>";
368 if (member->GetTitle() && member->GetTitle()[0]) {
369 classFile << "<td class=\"datadesc\">";
370 ReplaceSpecialChars(classFile, member->GetTitle());
371 } else classFile << "<td>";
372 classFile << "</td></tr>" << std::endl;
373 } // for members
374
375 if (prevEnumName.Length()) {
376 classFile << "<tr class=\"data";
377 if (prevIsInh)
378 classFile << "inh";
379 classFile << "\"><td class=\"datatype\">};</td><td></td><td></td></tr>" << std::endl;
380 }
381 classFile << std::endl << "</table></div>" << std::endl;
382 } // for access
383
384 classFile << "</div>" << std::endl; // datamembers
385}
386
387////////////////////////////////////////////////////////////////////////////////
388/// This function builds the class charts for one class in GraphViz/Dot format,
389/// i.e. the inheritance diagram, the include dependencies, and the library
390/// dependency.
391///
392/// Input: out - output file stream
393
395{
396 if (!fHtml->HaveDot())
397 return kFALSE;
398
399 TString title(fCurrentClass->GetName());
400 NameSpace2FileName(title);
401
402 TString dir("inh");
405
406 dir = "inhmem";
409
410 dir = "incl";
413
414 dir = "lib";
417
418 TString filenameInh(title);
419 gSystem->PrependPathName("inh", filenameInh);
420 gSystem->PrependPathName(fHtml->GetOutputDir(), filenameInh);
421 filenameInh += "_Inh";
422 if (!CreateDotClassChartInh(filenameInh + ".dot") || !RunDot(filenameInh, &out))
423 return kFALSE;
424
425 TString filenameInhMem(title);
426 gSystem->PrependPathName("inhmem", filenameInhMem);
427 gSystem->PrependPathName(fHtml->GetOutputDir(), filenameInhMem);
428 filenameInhMem += "_InhMem";
429 if (CreateDotClassChartInhMem(filenameInhMem + ".dot"))
430 RunDot(filenameInhMem, &out);
431
432 TString filenameIncl(title);
433 gSystem->PrependPathName("incl", filenameIncl);
434 gSystem->PrependPathName(fHtml->GetOutputDir(), filenameIncl);
435 filenameIncl += "_Incl";
436 if (CreateDotClassChartIncl(filenameIncl + ".dot"))
437 RunDot(filenameIncl, &out);
438
439 TString filenameLib(title);
440 gSystem->PrependPathName("lib", filenameLib);
441 gSystem->PrependPathName(fHtml->GetOutputDir(), filenameLib);
442 filenameLib += "_Lib";
443 if (CreateDotClassChartLib(filenameLib + ".dot"))
444 RunDot(filenameLib, &out);
445
446 out << "<div class=\"tabs\">" << std::endl
447 << "<a id=\"img" << title << "_Inh\" class=\"tabsel\" href=\"inh/" << title << "_Inh.png\" onclick=\"javascript:return SetImg('Charts','inh/" << title << "_Inh.png');\">Inheritance</a>" << std::endl
448 << "<a id=\"img" << title << "_InhMem\" class=\"tab\" href=\"inhmem/" << title << "_InhMem.png\" onclick=\"javascript:return SetImg('Charts','inhmem/" << title << "_InhMem.png');\">Inherited Members</a>" << std::endl
449 << "<a id=\"img" << title << "_Incl\" class=\"tab\" href=\"incl/" << title << "_Incl.png\" onclick=\"javascript:return SetImg('Charts','incl/" << title << "_Incl.png');\">Includes</a>" << std::endl
450 << "<a id=\"img" << title << "_Lib\" class=\"tab\" href=\"lib/" << title << "_Lib.png\" onclick=\"javascript:return SetImg('Charts','lib/" << title << "_Lib.png');\">Libraries</a><br/>" << std::endl
451 << "</div><div class=\"classcharts\"><div class=\"classchartswidth\"></div>" << std::endl
452 << "<img id=\"Charts\" alt=\"Class Charts\" class=\"classcharts\" usemap=\"#Map" << title << "_Inh\" src=\"inh/" << title << "_Inh.png\"/></div>" << std::endl;
453
454 return kTRUE;
455}
456
457////////////////////////////////////////////////////////////////////////////////
458/// This function builds the class tree for one class in HTML
459/// (inherited and succeeding classes, called recursively)
460///
461///
462/// Input: out - output file stream
463/// classPtr - pointer to the class
464/// dir - direction to traverse tree: up, down or both
465///
466
467void TClassDocOutput::ClassHtmlTree(std::ostream& out, TClass * classPtr,
468 ETraverse dir, int depth)
469{
470 if (dir == kBoth) {
471 out << "<!--INHERITANCE TREE-->" << std::endl;
472
473 // draw class tree into nested tables recursively
474 out << "<table><tr><td width=\"10%\"></td><td width=\"70%\">"
475 << "<a href=\"ClassHierarchy.html\">Inheritance Chart</a>:</td></tr>";
476 out << "<tr class=\"inhtree\"><td width=\"10%\"></td><td width=\"70%\">";
477
478 out << "<table class=\"inhtree\"><tr><td>" << std::endl;
479 out << "<table width=\"100%\" border=\"0\" ";
480 out << "cellpadding =\"0\" cellspacing=\"2\"><tr>" << std::endl;
481 } else {
482 out << "<table><tr>";
483 }
484
485 ////////////////////////////////////////////////////////
486 // Loop up to mother classes
487 if (dir == kUp || dir == kBoth) {
488
489 // make a loop on base classes
490 TBaseClass *inheritFrom;
491 TIter nextBase(classPtr->GetListOfBases());
492
493 UInt_t bgcolor=255-depth*8;
495 while ((inheritFrom = (TBaseClass *) nextBase())) {
496
497 if (first) {
498 out << "<td><table><tr>" << std::endl;
499 first = kFALSE;
500 } else
501 out << "</tr><tr>" << std::endl;
502 out << "<td bgcolor=\""
503 << Form("#%02x%02x%02x", bgcolor, bgcolor, bgcolor)
504 << "\" align=\"right\">" << std::endl;
505 // get a class
506 TClass *classInh = fHtml->GetClass((const char *) inheritFrom->GetName());
507 if (classInh)
508 ClassHtmlTree(out, classInh, kUp, depth+1);
509 else
510 out << "<tt>"
511 << (const char *) inheritFrom->GetName()
512 << "</tt>";
513 out << "</td>"<< std::endl;
514 }
515 if (!first) {
516 out << "</tr></table></td>" << std::endl; // put it in additional row in table
517 out << "<td>&larr;</td>";
518 }
519 }
520
521 out << "<td>" << std::endl; // put it in additional row in table
522 ////////////////////////////////////////////////////////
523 // Output Class Name
524
525 const char *className = classPtr->GetName();
526 TString htmlFile;
527 fHtml->GetHtmlFileName(classPtr, htmlFile);
528 TString anchor(className);
529 NameSpace2FileName(anchor);
530
531 if (dir == kUp) {
532 if (htmlFile) {
533 out << "<center><tt><a name=\"" << anchor;
534 out << "\" href=\"" << htmlFile << "\">";
535 ReplaceSpecialChars(out, className);
536 out << "</a></tt></center>" << std::endl;
537 } else
538 ReplaceSpecialChars(out, className);
539 }
540
541 if (dir == kBoth) {
542 if (htmlFile.Length()) {
543 out << "<center><big><b><tt><a name=\"" << anchor;
544 out << "\" href=\"" << htmlFile << "\">";
545 ReplaceSpecialChars(out, className);
546 out << "</a></tt></b></big></center>" << std::endl;
547 } else
548 ReplaceSpecialChars(out, className);
549 }
550
551 out << "</td>" << std::endl; // put it in additional row in table
552
553 ////////////////////////////////////////////////////////
554 // Loop down to child classes
555
556 if (dir == kDown || dir == kBoth) {
557
558 // 1. make a list of class names
559 // 2. use DescendHierarchy
560
561 out << "<td><table><tr>" << std::endl;
562 fHierarchyLines = 0;
563 DescendHierarchy(out,classPtr,10);
564
565 out << "</tr></table>";
566 if (dir==kBoth && fHierarchyLines>=10)
567 out << "</td><td align=\"left\">&nbsp;<a href=\"ClassHierarchy.html\">[more...]</a>";
568 out<<"</td>" << std::endl;
569
570 // free allocated memory
571 }
572
573 out << "</tr></table>" << std::endl;
574 if (dir == kBoth)
575 out << "</td></tr></table></td></tr></table>"<<std::endl;
576}
577
578
579////////////////////////////////////////////////////////////////////////////////
580/// It makes a graphical class tree
581///
582///
583/// Input: psCanvas - pointer to the current canvas
584/// classPtr - pointer to the class
585///
586
588{
589 if (!psCanvas || !fCurrentClass)
590 return;
591
592 TString filename(fCurrentClass->GetName());
593 NameSpace2FileName(filename);
594
596
597
598 filename += "_Tree.pdf";
599
600 if (IsModified(fCurrentClass, kTree) || force) {
601 // TCanvas already prints pdf being saved
602 // Printf(fHtml->GetCounterFormat(), "", "", filename);
603 fCurrentClass->Draw("same");
604 Int_t saveErrorIgnoreLevel = gErrorIgnoreLevel;
606 psCanvas->SaveAs(filename);
607 gErrorIgnoreLevel = saveErrorIgnoreLevel;
608 } else
609 Printf(fHtml->GetCounterFormat(), "-no change-", "", filename.Data());
610}
611
612////////////////////////////////////////////////////////////////////////////////
613/// Build the class tree for one class in GraphViz/Dot format
614///
615///
616/// Input: filename - output dot file incl. path
617
619{
620 std::ofstream outdot(filename);
621 outdot << "strict digraph G {" << std::endl
622 << "rankdir=RL;" << std::endl
623 << "ranksep=2;" << std::endl
624 << "nodesep=0;" << std::endl
625 << "size=\"8,10\";" << std::endl
626 << "ratio=auto;" << std::endl
627 << "margin=0;" << std::endl
628 << "node [shape=plaintext,fontsize=40,width=4,height=0.75];" << std::endl
629 << "\"" << fCurrentClass->GetName() << "\" [shape=ellipse];" << std::endl;
630
631 std::stringstream ssDep;
632 std::list<TClass*> writeBasesFor;
633 writeBasesFor.push_back(fCurrentClass);
634 Bool_t haveBases = fCurrentClass->GetListOfBases() &&
636 if (haveBases) {
637 outdot << "{" << std::endl;
638 while (!writeBasesFor.empty()) {
639 TClass* cl = writeBasesFor.front();
640 writeBasesFor.pop_front();
641 if (cl != fCurrentClass) {
642 outdot << " \"" << cl->GetName() << "\"";
643 const char* htmlFileName = fHtml->GetHtmlFileName(cl->GetName());
644 if (htmlFileName)
645 outdot << " [URL=\"" << htmlFileName << "\"]";
646 outdot << ";" << std::endl;
647 }
648 if (cl->GetListOfBases() && cl->GetListOfBases()->GetSize()) {
649 ssDep << " \"" << cl->GetName() << "\" -> {";
650 TIter iBase(cl->GetListOfBases());
651 TBaseClass* base = 0;
652 while ((base = (TBaseClass*)iBase())) {
653 ssDep << " \"" << base->GetName() << "\";";
654 writeBasesFor.push_back(base->GetClassPointer());
655 }
656 ssDep << "}" << std::endl;
657 }
658 }
659 outdot << "}" << std::endl; // cluster
660 }
661
662 std::map<TClass*, Int_t> derivesFromMe;
663 std::map<TClass*, unsigned int> entriesPerDerived;
664 std::set<TClass*> wroteNode;
665 wroteNode.insert(fCurrentClass);
666 static const unsigned int maxClassesPerDerived = 20;
667 fHtml->GetDerivedClasses(fCurrentClass, derivesFromMe);
668 outdot << "{" << std::endl;
669 for (Int_t level = 1; kTRUE; ++level) {
670 Bool_t levelExists = kFALSE;
671 for (std::map<TClass*, Int_t>::iterator iDerived = derivesFromMe.begin();
672 iDerived != derivesFromMe.end(); ++iDerived) {
673 if (iDerived->second != level) continue;
674 levelExists = kTRUE;
675 TIter iBaseOfDerived(iDerived->first->GetListOfBases());
676 TBaseClass* baseDerived = 0;
677 Bool_t writeNode = kFALSE;
678 TClass* writeAndMoreFor = 0;
679 while ((baseDerived = (TBaseClass*) iBaseOfDerived())) {
680 TClass* clBaseDerived = baseDerived->GetClassPointer();
681 if (clBaseDerived->InheritsFrom(fCurrentClass)
682 && wroteNode.find(clBaseDerived) != wroteNode.end()) {
683 unsigned int& count = entriesPerDerived[clBaseDerived];
684 if (count < maxClassesPerDerived) {
685 writeNode = kTRUE;
686 ssDep << "\"" << iDerived->first->GetName() << "\" -> \""
687 << clBaseDerived->GetName() << "\";" << std::endl;
688 ++count;
689 } else if (count == maxClassesPerDerived) {
690 writeAndMoreFor = clBaseDerived;
691 ssDep << "\"...andmore" << clBaseDerived->GetName() << "\"-> \""
692 << clBaseDerived->GetName() << "\";" << std::endl;
693 ++count;
694 }
695 }
696 }
697
698 if (writeNode) {
699 wroteNode.insert(iDerived->first);
700 outdot << " \"" << iDerived->first->GetName() << "\"";
701 const char* htmlFileName = fHtml->GetHtmlFileName(iDerived->first->GetName());
702 if (htmlFileName)
703 outdot << " [URL=\"" << htmlFileName << "\"]";
704 outdot << ";" << std::endl;
705 } else if (writeAndMoreFor) {
706 outdot << " \"...andmore" << writeAndMoreFor->GetName()
707 << "\" [label=\"...and more\",fontname=\"Times-Italic\",fillcolor=lightgrey,style=filled];" << std::endl;
708 }
709 }
710 if (!levelExists) break;
711 }
712 outdot << "}" << std::endl; // cluster
713
714 outdot << ssDep.str();
715
716 outdot << "}" << std::endl; // digraph
717
718 return kTRUE;
719}
720
721////////////////////////////////////////////////////////////////////////////////
722/// Build the class tree of inherited members for one class in GraphViz/Dot format
723///
724/// Input: filename - output dot file incl. path
725
727 std::ofstream outdot(filename);
728 outdot << "strict digraph G {" << std::endl
729 << "ratio=auto;" << std::endl
730 << "rankdir=RL;" << std::endl
731 << "compound=true;" << std::endl
732 << "constraint=false;" << std::endl
733 << "ranksep=0.1;" << std::endl
734 << "nodesep=0;" << std::endl
735 << "margin=0;" << std::endl;
736 outdot << " node [style=filled,width=0.7,height=0.15,fixedsize=true,shape=plaintext,fontsize=10];" << std::endl;
737
738 std::stringstream ssDep;
739 const int numColumns = 3;
740
741 std::list<TClass*> writeBasesFor;
742 writeBasesFor.push_back(fCurrentClass);
743 while (!writeBasesFor.empty()) {
744 TClass* cl = writeBasesFor.front();
745 writeBasesFor.pop_front();
746
747 const char* htmlFileName = fHtml->GetHtmlFileName(cl->GetName());
748
749 outdot << "subgraph \"cluster" << cl->GetName() << "\" {" << std::endl
750 << " color=lightgray;" << std::endl
751 << " label=\"" << cl->GetName() << "\";" << std::endl;
752 if (cl != fCurrentClass && htmlFileName)
753 outdot << " URL=\"" << htmlFileName << "\"" << std::endl;
754
755 //Bool_t haveMembers = (cl->GetListOfDataMembers() && cl->GetListOfDataMembers()->GetSize());
756 Bool_t haveFuncs = cl->GetListOfMethods() && cl->GetListOfMethods()->GetSize();
757
758 // DATA MEMBERS
759 {
760 // make sure each member name is listed only once
761 // that's useless for data members, but symmetric to what we have for methods
762 std::map<std::string, TDataMember*> dmMap;
763
764 {
765 TIter iDM(cl->GetListOfDataMembers());
766 TDataMember* dm = 0;
767 while ((dm = (TDataMember*) iDM()))
768 dmMap[dm->GetName()] = dm;
769 }
770
771 outdot << "subgraph \"clusterData0" << cl->GetName() << "\" {" << std::endl
772 << " color=white;" << std::endl
773 << " label=\"\";" << std::endl
774 << " \"clusterNode0" << cl->GetName() << "\" [height=0,width=0,style=invis];" << std::endl;
775 TString prevColumnNode;
776 Int_t pos = dmMap.size();
777 Int_t column = 0;
778 Int_t newColumnEvery = (pos + numColumns - 1) / numColumns;
779 for (std::map<std::string, TDataMember*>::iterator iDM = dmMap.begin();
780 iDM != dmMap.end(); ++iDM, --pos) {
781 TDataMember* dm = iDM->second;
782 TString nodeName(cl->GetName());
783 nodeName += "::";
784 nodeName += dm->GetName();
785 if (iDM == dmMap.begin())
786 prevColumnNode = nodeName;
787
788 outdot << "\"" << nodeName << "\" [label=\""
789 << dm->GetName() << "\"";
790 if (dm->Property() & kIsPrivate)
791 outdot << ",color=\"#FFCCCC\"";
792 else if (dm->Property() & kIsProtected)
793 outdot << ",color=\"#FFFF77\"";
794 else
795 outdot << ",color=\"#CCFFCC\"";
796 outdot << "];" << std::endl;
797 if (pos % newColumnEvery == 1) {
798 ++column;
799 outdot << "};" << std::endl // end dataR
800 << "subgraph \"clusterData" << column << cl->GetName() << "\" {" << std::endl
801 << " color=white;" << std::endl
802 << " label=\"\";" << std::endl
803 << " \"clusterNode" << column << cl->GetName() << "\" [height=0,width=0,style=invis];" << std::endl;
804 } else if (iDM != dmMap.begin() && pos % newColumnEvery == 0) {
805 ssDep << "\"" << prevColumnNode
806 << "\" -> \"" << nodeName << "\""<< " [style=invis,weight=100];" << std::endl;
807 prevColumnNode = nodeName;
808 }
809 }
810
811 while (column < numColumns - 1) {
812 ++column;
813 outdot << " \"clusterNode" << column << cl->GetName() << "\" [height=0,width=0,style=invis];" << std::endl;
814 }
815
816 outdot << "};" << std::endl; // subgraph dataL/R
817 } // DATA MEMBERS
818
819 // FUNCTION MEMBERS
820 if (haveFuncs) {
821 // make sure each member name is listed only once
822 std::map<std::string, TMethod*> methMap;
823
824 {
825 TIter iMeth(cl->GetListOfMethods());
826 TMethod* meth = 0;
827 while ((meth = (TMethod*) iMeth()))
828 methMap[meth->GetName()] = meth;
829 }
830
831 outdot << "subgraph \"clusterFunc0" << cl->GetName() << "\" {" << std::endl
832 << " color=white;" << std::endl
833 << " label=\"\";" << std::endl
834 << " \"clusterNode0" << cl->GetName() << "\" [height=0,width=0,style=invis];" << std::endl;
835
836 TString prevColumnNodeFunc;
837 Int_t pos = methMap.size();
838 Int_t column = 0;
839 Int_t newColumnEvery = (pos + numColumns - 1) / numColumns;
840 for (std::map<std::string, TMethod*>::iterator iMeth = methMap.begin();
841 iMeth != methMap.end(); ++iMeth, --pos) {
842 TMethod* meth = iMeth->second;
843 TString nodeName(cl->GetName());
844 nodeName += "::";
845 nodeName += meth->GetName();
846 if (iMeth == methMap.begin())
847 prevColumnNodeFunc = nodeName;
848
849 outdot << "\"" << nodeName << "\" [label=\"" << meth->GetName() << "\"";
850 if (cl != fCurrentClass &&
852 outdot << ",color=\"#777777\"";
853 else if (meth->Property() & kIsPrivate)
854 outdot << ",color=\"#FFCCCC\"";
855 else if (meth->Property() & kIsProtected)
856 outdot << ",color=\"#FFFF77\"";
857 else
858 outdot << ",color=\"#CCFFCC\"";
859 outdot << "];" << std::endl;
860 if (pos % newColumnEvery == 1) {
861 ++column;
862 outdot << "};" << std::endl // end funcR
863 << "subgraph \"clusterFunc" << column << cl->GetName() << "\" {" << std::endl
864 << " color=white;" << std::endl
865 << " label=\"\";" << std::endl;
866 } else if (iMeth != methMap.begin() && pos % newColumnEvery == 0) {
867 ssDep << "\"" << prevColumnNodeFunc
868 << "\" -> \"" << nodeName << "\""<< " [style=invis,weight=100];" << std::endl;
869 prevColumnNodeFunc = nodeName;
870 }
871 }
872 outdot << "};" << std::endl; // subgraph funcL/R
873 }
874
875 outdot << "}" << std::endl; // cluster class
876
877 for (Int_t pos = 0; pos < numColumns - 1; ++pos)
878 ssDep << "\"clusterNode" << pos << cl->GetName() << "\" -> \"clusterNode" << pos + 1 << cl->GetName() << "\" [style=invis];" << std::endl;
879
880 if (cl->GetListOfBases() && cl->GetListOfBases()->GetSize()) {
881 TIter iBase(cl->GetListOfBases());
882 TBaseClass* base = 0;
883 while ((base = (TBaseClass*)iBase())) {
884 ssDep << " \"clusterNode" << numColumns - 1 << cl->GetName() << "\" -> "
885 << " \"clusterNode0" << base->GetName() << "\" [ltail=\"cluster" << cl->GetName()
886 << "\",lhead=\"cluster" << base->GetName() << "\"";
887 if (base != cl->GetListOfBases()->First())
888 ssDep << ",weight=0";
889 ssDep << "];" << std::endl;
890 writeBasesFor.push_back(base->GetClassPointer());
891 }
892 }
893 }
894
895 outdot << ssDep.str();
896
897 outdot << "}" << std::endl; // digraph
898
899 return kTRUE;
900}
901
902////////////////////////////////////////////////////////////////////////////////
903/// Build the include dependency graph for one class in
904/// GraphViz/Dot format
905///
906/// Input: filename - output dot file incl. path
907
909 R__LOCKGUARD(GetHtml()->GetMakeClassMutex());
910
911 std::map<std::string, std::string> filesToParse;
912 std::list<std::string> listFilesToParse;
913 TString declFileName;
914 TString implFileName;
915 fHtml->GetImplFileName(fCurrentClass, kFALSE, implFileName);
916 if (fHtml->GetDeclFileName(fCurrentClass, kFALSE, declFileName)) {
917 TString real;
919 filesToParse[declFileName.Data()] = real.Data();
920 listFilesToParse.push_back(declFileName.Data());
921 }
922 }
923 /* do it only for the header
924 if (implFileName && strlen(implFileName)) {
925 char* real = gSystem->Which(fHtml->GetInputPath(), implFileName, kReadPermission);
926 if (real) {
927 filesToParse[implFileName] = real;
928 listFilesToParse.push_back(implFileName);
929 delete real;
930 }
931 }
932 */
933
934 std::ofstream outdot(filename);
935 outdot << "strict digraph G {" << std::endl
936 << "ratio=compress;" << std::endl
937 << "rankdir=TB;" << std::endl
938 << "concentrate=true;" << std::endl
939 << "ranksep=0;" << std::endl
940 << "nodesep=0;" << std::endl
941 << "size=\"8,10\";" << std::endl
942 << "node [fontsize=20,shape=plaintext];" << std::endl;
943
944 for (std::list<std::string>::iterator iFile = listFilesToParse.begin();
945 iFile != listFilesToParse.end(); ++iFile) {
946 std::ifstream in(filesToParse[*iFile].c_str());
947 std::string line;
948 while (in && !in.eof()) {
949 std::getline(in, line);
950 size_t pos = 0;
951 while (line[pos] == ' ' || line[pos] == '\t') ++pos;
952 if (line[pos] != '#') continue;
953 ++pos;
954 while (line[pos] == ' ' || line[pos] == '\t') ++pos;
955 if (line.compare(pos, 8, "include ") != 0) continue;
956 pos += 8;
957 while (line[pos] == ' ' || line[pos] == '\t') ++pos;
958 if (line[pos] != '"' && line[pos] != '<')
959 continue;
960 char delim = line[pos];
961 if (delim == '<') delim = '>';
962 ++pos;
963 line.erase(0, pos);
964 pos = 0;
965 pos = line.find(delim);
966 if (pos == std::string::npos) continue;
967 line.erase(pos);
968 if (filesToParse.find(line) == filesToParse.end()) {
969 TString sysfilename;
970 if (!GetHtml()->GetPathDefinition().GetFileNameFromInclude(line.c_str(), sysfilename))
971 continue;
972 listFilesToParse.push_back(line);
973 filesToParse[line] = sysfilename;
974 if (*iFile == implFileName.Data() || *iFile == declFileName.Data())
975 outdot << "\"" << *iFile << "\" [style=filled,fillcolor=lightgray];" << std::endl;
976 }
977 outdot << "\"" << *iFile << "\" -> \"" << line << "\";" << std::endl;
978 }
979 }
980
981 outdot << "}" << std::endl; // digraph
982
983 return kTRUE;
984}
985
986////////////////////////////////////////////////////////////////////////////////
987/// Build the library dependency graph for one class in
988/// GraphViz/Dot format
989///
990/// Input: filename - output dot file incl. path
991
993 std::ofstream outdot(filename);
994 outdot << "strict digraph G {" << std::endl
995 << "ratio=auto;" << std::endl
996 << "rankdir=RL;" << std::endl
997 << "compound=true;" << std::endl
998 << "constraint=false;" << std::endl
999 << "ranksep=0.7;" << std::endl
1000 << "nodesep=0.3;" << std::endl
1001 << "size=\"8,8\";" << std::endl
1002 << "ratio=compress;" << std::endl;
1003
1005 outdot << "\"All Libraries\" [URL=\"LibraryDependencies.html\",shape=box,rank=max,fillcolor=lightgray,style=filled];" << std::endl;
1006
1007 if (libs.Length()) {
1008 TString firstLib(libs);
1009 Ssiz_t end = firstLib.Index(' ');
1010 if (end != kNPOS) {
1011 firstLib.Remove(end, firstLib.Length());
1012 libs.Remove(0, end + 1);
1013 } else libs = "";
1014
1015 {
1016 Ssiz_t posExt = firstLib.First(".");
1017 if (posExt != kNPOS)
1018 firstLib.Remove(posExt, firstLib.Length());
1019 }
1020
1021 outdot << "\"All Libraries\" -> \"" << firstLib << "\" [style=invis];" << std::endl;
1022 outdot << "\"" << firstLib << "\" -> {" << std::endl;
1023
1024 if (firstLib != "libCore")
1025 libs += " libCore";
1026 if (firstLib != "libCint")
1027 libs += " libCint";
1028 TString thisLib;
1029 for (Ssiz_t pos = 0; pos < libs.Length(); ++pos)
1030 if (libs[pos] != ' ')
1031 thisLib += libs[pos];
1032 else if (thisLib.Length()) {
1033 Ssiz_t posExt = thisLib.First(".");
1034 if (posExt != kNPOS)
1035 thisLib.Remove(posExt, thisLib.Length());
1036 outdot << " \"" << thisLib << "\";";
1037 thisLib = "";
1038 }
1039 // remaining lib
1040 if (thisLib.Length()) {
1041 Ssiz_t posExt = thisLib.First(".");
1042 if (posExt != kNPOS)
1043 thisLib.Remove(posExt, thisLib.Length());
1044 outdot << " \"" << thisLib << "\";";
1045 thisLib = "";
1046 }
1047 outdot << "}" << std::endl; // dependencies
1048 } else
1049 outdot << "\"No rlibmap information available.\"" << std::endl;
1050
1051 outdot << "}" << std::endl; // digraph
1052
1053 return kTRUE;
1054}
1055
1056////////////////////////////////////////////////////////////////////////////////
1057/// Create the hierarchical class list part for the current class's
1058/// base classes. docFileName contains doc for fCurrentClass.
1059///
1060
1061void TClassDocOutput::CreateClassHierarchy(std::ostream& out, const char* docFileName)
1062{
1063 // Find basic base classes
1065 if (!bases || bases->IsEmpty())
1066 return;
1067
1068 out << "<hr />" << std::endl;
1069
1070 out << "<table><tr><td><ul><li><tt>";
1071 if (docFileName) {
1072 out << "<a name=\"" << fCurrentClass->GetName() << "\" href=\""
1073 << docFileName << "\">";
1075 out << "</a>";
1076 } else {
1078 }
1079
1080 // find derived classes
1081 out << "</tt></li></ul></td>";
1082 fHierarchyLines = 0;
1084
1085 out << "</tr></table>" << std::endl;
1086}
1087
1088////////////////////////////////////////////////////////////////////////////////
1089/// Create a hierarchical class list
1090/// The algorithm descends from the base classes and branches into
1091/// all derived classes. Mixing classes are displayed several times.
1092///
1093///
1094
1096{
1097 const char* title = "ClassHierarchy";
1098 TString filename(title);
1100
1101 // open out file
1102 std::ofstream dotout(filename + ".dot");
1103
1104 if (!dotout.good()) {
1105 Error("CreateHierarchy", "Can't open file '%s.dot' !",
1106 filename.Data());
1107 return kFALSE;
1108 }
1109
1110 dotout << "digraph G {" << std::endl
1111 << "ratio=auto;" << std::endl
1112 << "rankdir=RL;" << std::endl;
1113
1114 // loop on all classes
1115 TClassDocInfo* cdi = 0;
1116 TIter iClass(fHtml->GetListOfClasses());
1117 while ((cdi = (TClassDocInfo*)iClass())) {
1118
1119 TDictionary *dict = cdi->GetClass();
1120 TClass *cl = dynamic_cast<TClass*>(dict);
1121 if (cl == 0) {
1122 if (!dict)
1123 Warning("THtml::CreateHierarchy", "skipping class %s\n", cdi->GetName());
1124 continue;
1125 }
1126
1127 // Find immediate base classes
1128 TList *bases = cl->GetListOfBases();
1129 if (bases && !bases->IsEmpty()) {
1130 dotout << "\"" << cdi->GetName() << "\" -> { ";
1131 TIter iBase(bases);
1132 TBaseClass* base = 0;
1133 while ((base = (TBaseClass*) iBase())) {
1134 // write out current class
1135 if (base != bases->First())
1136 dotout << "; ";
1137 dotout << "\"" << base->GetName() << "\"";
1138 }
1139 dotout << "};" << std::endl;
1140 } else
1141 // write out current class - no bases
1142 dotout << "\"" << cdi->GetName() << "\";" << std::endl;
1143
1144 }
1145
1146 dotout << "}";
1147 dotout.close();
1148
1149 std::ofstream out(filename + ".html");
1150 if (!out.good()) {
1151 Error("CreateHierarchy", "Can't open file '%s.html' !",
1152 filename.Data());
1153 return kFALSE;
1154 }
1155
1156 Printf(fHtml->GetCounterFormat(), "", fHtml->GetCounter(), (filename + ".html").Data());
1157 // write out header
1158 WriteHtmlHeader(out, "Class Hierarchy");
1159 out << "<h1>Class Hierarchy</h1>" << std::endl;
1160
1161 WriteSearch(out);
1162
1163 RunDot(filename, &out);
1164
1165 out << "<img usemap=\"#Map" << title << "\" src=\"" << title << ".png\"/>" << std::endl;
1166 // write out footer
1167 WriteHtmlFooter(out);
1168 return kTRUE;
1169}
1170
1171////////////////////////////////////////////////////////////////////////////////
1172/// Open a Class.cxx.html file, where Class is defined by classPtr, and .cxx.html by extension
1173/// It's created in fHtml->GetOutputDir()/src. If successful, the HTML header is written to out.
1174
1175void TClassDocOutput::CreateSourceOutputStream(std::ostream& out, const char* extension,
1176 TString& sourceHtmlFileName)
1177{
1178 TString sourceHtmlDir("src");
1179 gSystem->PrependPathName(fHtml->GetOutputDir(), sourceHtmlDir);
1180 // create directory if necessary
1181 {
1182 R__LOCKGUARD(GetHtml()->GetMakeClassMutex());
1183
1184 if (gSystem->AccessPathName(sourceHtmlDir))
1185 gSystem->MakeDirectory(sourceHtmlDir);
1186 }
1187 sourceHtmlFileName = fCurrentClass->GetName();
1188 NameSpace2FileName(sourceHtmlFileName);
1189 gSystem->PrependPathName(sourceHtmlDir, sourceHtmlFileName);
1190 sourceHtmlFileName += extension;
1191 dynamic_cast<std::ofstream&>(out).open(sourceHtmlFileName);
1192 if (!out) {
1193 Warning("LocateMethodsInSource", "Can't open beautified source file '%s' for writing!",
1194 sourceHtmlFileName.Data());
1195 sourceHtmlFileName.Remove(0);
1196 return;
1197 }
1198
1199 // write a HTML header
1200 TString title(fCurrentClass->GetName());
1201 title += " - source file";
1202 WriteHtmlHeader(out, title, "../", fCurrentClass);
1203 out << "<div id=\"codeAndLineNumbers\"><pre class=\"listing\">" << std::endl;
1204}
1205
1206////////////////////////////////////////////////////////////////////////////////
1207/// Descend hierarchy recursively
1208/// loop over all classes and look for classes with base class basePtr
1209
1210void TClassDocOutput::DescendHierarchy(std::ostream& out, TClass* basePtr, Int_t maxLines, Int_t depth)
1211{
1212 if (maxLines)
1213 if (fHierarchyLines >= maxLines) {
1214 out << "<td></td>" << std::endl;
1215 return;
1216 }
1217
1218 UInt_t numClasses = 0;
1219
1220 TClassDocInfo* cdi = 0;
1221 TIter iClass(fHtml->GetListOfClasses());
1222 while ((cdi = (TClassDocInfo*)iClass()) && (!maxLines || fHierarchyLines<maxLines)) {
1223
1224 TClass *classPtr = dynamic_cast<TClass*>(cdi->GetClass());
1225 if (!classPtr) continue;
1226
1227 // find base classes with same name as basePtr
1228 TList* bases=classPtr->GetListOfBases();
1229 if (!bases) continue;
1230
1231 TBaseClass *inheritFrom=(TBaseClass*)bases->FindObject(basePtr->GetName());
1232 if (!inheritFrom) continue;
1233
1234 if (!numClasses)
1235 out << "<td>&larr;</td><td><table><tr>" << std::endl;
1236 else
1237 out << "</tr><tr>"<<std::endl;
1239 numClasses++;
1240 UInt_t bgcolor=255-depth*8;
1241 out << "<td bgcolor=\""
1242 << Form("#%02x%02x%02x", bgcolor, bgcolor, bgcolor)
1243 << "\">";
1244 out << "<table><tr><td>" << std::endl;
1245
1246 TString htmlFile(cdi->GetHtmlFileName());
1247 if (htmlFile.Length()) {
1248 out << "<center><tt><a name=\"" << cdi->GetName() << "\" href=\""
1249 << htmlFile << "\">";
1250 ReplaceSpecialChars(out, cdi->GetName());
1251 out << "</a></tt></center>";
1252 } else {
1253 ReplaceSpecialChars(out, cdi->GetName());
1254 }
1255 // write title
1256 // commented out for now because it reduces overview
1257 /*
1258 len = strlen(classNames[i]);
1259 for (Int_t w = 0; w < (maxLen - len + 2); w++)
1260 out << ".";
1261 out << " ";
1262
1263 out << "<a name=\"Title:";
1264 out << classPtr->GetName();
1265 out << "\">";
1266 ReplaceSpecialChars(out, classPtr->GetTitle());
1267 out << "</a></tt>" << std::endl;
1268 */
1269
1270 out << "</td>" << std::endl;
1271 DescendHierarchy(out,classPtr,maxLines, depth+1);
1272 out << "</tr></table></td>" << std::endl;
1273
1274 } // loop over all classes
1275 if (numClasses)
1276 out << "</tr></table></td>" << std::endl;
1277 else
1278 out << "<td></td>" << std::endl;
1279}
1280
1281////////////////////////////////////////////////////////////////////////////////
1282/// Create an output file with a graphical representation of the class
1283/// inheritance. If force, replace existing output file.
1284/// This routine does nothing if fHtml->HaveDot() is true - use
1285/// ClassDotCharts() instead!
1286
1287void TClassDocOutput::MakeTree(Bool_t force /*= kFALSE*/)
1288{
1289 // class tree only if no dot, otherwise it's part of charts
1290 if (!fCurrentClass || fHtml->HaveDot())
1291 return;
1292
1293 TString htmlFile;
1295 if (htmlFile.Length()
1296 && (htmlFile.BeginsWith("http://")
1297 || htmlFile.BeginsWith("https://")
1298 || gSystem->IsAbsoluteFileName(htmlFile))
1299 ) {
1300 htmlFile.Remove(0);
1301 }
1302
1303 if (!htmlFile.Length()) {
1304 TString what(fCurrentClass->GetName());
1305 what += " (source not found)";
1306 Printf(fHtml->GetCounterFormat(), "-skipped-", "", what.Data());
1307 return;
1308 }
1309
1310 R__LOCKGUARD(GetHtml()->GetMakeClassMutex());
1311
1312 // Create a canvas without linking against GUI libs
1313 Bool_t wasBatch = gROOT->IsBatch();
1314 if (!wasBatch)
1315 gROOT->SetBatch();
1316 TVirtualPad *psCanvas = (TVirtualPad*)gROOT->ProcessLineFast("new TCanvas(\"R__THtml\",\"psCanvas\",0,0,1000,1200);");
1317 if (!wasBatch)
1318 gROOT->SetBatch(kFALSE);
1319
1320 if (!psCanvas) {
1321 Error("MakeTree", "Cannot create a TCanvas!");
1322 return;
1323 }
1324
1325 // make a class tree
1326 ClassTree(psCanvas, force);
1327
1328 psCanvas->Close();
1329 delete psCanvas;
1330}
1331
1332////////////////////////////////////////////////////////////////////////////////
1333/// Called by TDocParser::LocateMethods(), this hook writes out the class description
1334/// found by TDocParser. It's even called if none is found, i.e. if the first method
1335/// has occurred before a class description is found, so missing class descriptions
1336/// can be handled.
1337/// For HTML, its creates the description block, the list of functions and data
1338/// members, and the inheritance tree or, if Graphviz's dot is found, the class charts.
1339
1340void TClassDocOutput::WriteClassDescription(std::ostream& out, const TString& description)
1341{
1342 // Class Description Title
1343 out << "<div class=\"dropshadow\"><div class=\"withshadow\">";
1344 TString anchor(fCurrentClass->GetName());
1345 NameSpace2FileName(anchor);
1346 out << "<h1><a name=\"" << anchor;
1347 out << ":description\"></a>";
1348
1350 out << "namespace ";
1351 else
1352 out << "class ";
1354
1355
1356 // make a loop on base classes
1357 Bool_t first = kTRUE;
1358 TBaseClass *inheritFrom;
1359 TIter nextBase(fCurrentClass->GetListOfBases());
1360
1361 while ((inheritFrom = (TBaseClass *) nextBase())) {
1362 if (first) {
1363 out << ": ";
1364 first = kFALSE;
1365 } else
1366 out << ", ";
1367 Long_t property = inheritFrom->Property();
1368 if (property & kIsPrivate)
1369 out << "private ";
1370 else if (property & kIsProtected)
1371 out << "protected ";
1372 else
1373 out << "public ";
1374
1375 // get a class
1376 TClass *classInh = fHtml->GetClass(inheritFrom->GetName());
1377
1378 TString htmlFile;
1379 fHtml->GetHtmlFileName(classInh, htmlFile);
1380
1381 if (htmlFile.Length()) {
1382 // make a link to the base class
1383 out << "<a href=\"" << htmlFile << "\">";
1384 ReplaceSpecialChars(out, inheritFrom->GetName());
1385 out << "</a>";
1386 } else
1387 ReplaceSpecialChars(out, inheritFrom->GetName());
1388 }
1389 out << "</h1>" << std::endl;
1390
1391 out << "<div class=\"classdescr\">" << std::endl;
1392
1393 if (description.Length())
1394 out << "<pre>" << description << "</pre>";
1395
1396 // typedefs pointing to this class:
1398 out << "<h4>This class is also known as (typedefs to this class)</h4>";
1400 bool firsttd = true;
1401 TDataType* dt = 0;
1402 while ((dt = (TDataType*) iTD())) {
1403 if (!firsttd)
1404 out << ", ";
1405 else firsttd = false;
1406 fParser->DecorateKeywords(out, dt->GetName());
1407 }
1408 }
1409
1410 out << "</div>" << std::endl
1411 << "</div></div>" << std::endl;
1412
1413 ListFunctions(out);
1414 ListDataMembers(out);
1415
1416 // create dot class charts or an html inheritance tree
1417 out << "<h2><a id=\"" << anchor
1418 << ":Class_Charts\"></a>Class Charts</h2>" << std::endl;
1420 if (!ClassDotCharts(out))
1422
1423 // header for the following function docs:
1424 out << "<h2>Function documentation</h2>" << std::endl;
1425}
1426
1427
1428////////////////////////////////////////////////////////////////////////////////
1429/// Write out the introduction of a class description (shortcuts and links)
1430
1431void TClassDocOutput::WriteClassDocHeader(std::ostream& classFile)
1432{
1433 classFile << "<a name=\"TopOfPage\"></a>" << std::endl;
1434
1435
1436 // show box with lib, include
1437 // needs to go first to allow title on the left
1438 TString sTitle(fCurrentClass->GetName());
1439 ReplaceSpecialChars(sTitle);
1441 sTitle.Prepend("namespace ");
1442 else
1443 sTitle.Prepend("class ");
1444
1445 TString sInclude;
1446 TString sLib;
1447 const char* lib=fCurrentClass->GetSharedLibs();
1449 if (lib) {
1450 char* libDup=StrDup(lib);
1451 char* libDupSpace=strchr(libDup,' ');
1452 if (libDupSpace) *libDupSpace=0;
1453 char* libDupEnd=libDup+strlen(libDup);
1454 while (libDupEnd!=libDup)
1455 if (*(--libDupEnd)=='.') {
1456 *libDupEnd=0;
1457 break;
1458 }
1459 sLib = libDup;
1460 delete[] libDup;
1461 }
1462 classFile << "<script type=\"text/javascript\">WriteFollowPageBox('"
1463 << sTitle << "','" << sLib << "','" << sInclude << "');</script>" << std::endl;
1464
1465 TString modulename;
1467 TModuleDocInfo* module = (TModuleDocInfo*) fHtml->GetListOfModules()->FindObject(modulename);
1468 WriteTopLinks(classFile, module, fCurrentClass->GetName(), kFALSE);
1469
1470 classFile << "<div class=\"descrhead\"><div class=\"descrheadcontent\">" << std::endl // descrhead line 3
1471 << "<span class=\"descrtitle\">Source:</span>" << std::endl;
1472
1473 // make a link to the '.cxx' file
1474 TString classFileName(fCurrentClass->GetName());
1475 NameSpace2FileName(classFileName);
1476
1477 TString headerFileName;
1478 fHtml->GetDeclFileName(fCurrentClass, kFALSE, headerFileName);
1479 TString sourceFileName;
1480 fHtml->GetImplFileName(fCurrentClass, kFALSE, sourceFileName);
1481 if (headerFileName.Length())
1482 classFile << "<a class=\"descrheadentry\" href=\"src/" << classFileName
1483 << ".h.html\">header file</a>" << std::endl;
1484 else
1485 classFile << "<a class=\"descrheadentry\"> </a>" << std::endl;
1486
1487 if (sourceFileName.Length())
1488 classFile << "<a class=\"descrheadentry\" href=\"src/" << classFileName
1489 << ".cxx.html\">source file</a>" << std::endl;
1490 else
1491 classFile << "<a class=\"descrheadentry\"> </a>" << std::endl;
1492
1494 // make a link to the inheritance tree (postscript)
1495 classFile << "<a class=\"descrheadentry\" href=\"" << classFileName << "_Tree.pdf\"";
1496 classFile << ">inheritance tree (.pdf)</a> ";
1497 }
1498
1499 const TString& viewCVSLink = GetHtml()->GetViewCVS();
1500 Bool_t mustReplace = viewCVSLink.Contains("%f");
1501 if (viewCVSLink.Length()) {
1502 if (headerFileName.Length()) {
1503 TString link(viewCVSLink);
1504 TString sHeader(headerFileName);
1505 if (GetHtml()->GetProductName() && !strcmp(GetHtml()->GetProductName(), "ROOT")) {
1506 Ssiz_t posInclude = sHeader.Index("/include/");
1507 if (posInclude != kNPOS) {
1508 // Cut off ".../include", i.e. keep leading '/'
1509 sHeader.Remove(0, posInclude + 8);
1510 } else {
1511 // no /include/; maybe /inc?
1512 posInclude = sHeader.Index("/inc/");
1513 if (posInclude != kNPOS) {
1514 sHeader = "/";
1515 sHeader += sInclude;
1516 }
1517 }
1518 if (sourceFileName && strstr(sourceFileName, "src")) {
1519 TString src(sourceFileName);
1520 src.Remove(src.Index("src"), src.Length());
1521 src += "inc";
1522 sHeader.Prepend(src);
1523 } else {
1525 Ssiz_t posEndLib = src.Index(' ');
1526 if (posEndLib != kNPOS)
1527 src.Remove(posEndLib, src.Length());
1528 if (src.BeginsWith("lib"))
1529 src.Remove(0, 3);
1530 posEndLib = src.Index('.');
1531 if (posEndLib != kNPOS)
1532 src.Remove(posEndLib, src.Length());
1533 src.ToLower();
1534 src += "/inc";
1535 sHeader.Prepend(src);
1536 }
1537 if (sHeader.BeginsWith("tmva/inc/TMVA"))
1538 sHeader.Remove(8, 5);
1539 }
1540 if (mustReplace) link.ReplaceAll("%f", sHeader);
1541 else link += sHeader;
1542 classFile << "<a class=\"descrheadentry\" href=\"" << link << "\">viewVC header</a> ";
1543 } else
1544 classFile << "<a class=\"descrheadentry\"> </a> ";
1545 if (sourceFileName.Length()) {
1546 TString link(viewCVSLink);
1547 if (mustReplace) link.ReplaceAll("%f", sourceFileName);
1548 else link += sourceFileName;
1549 classFile << "<a class=\"descrheadentry\" href=\"" << link << "\">viewVC source</a> ";
1550 } else
1551 classFile << "<a class=\"descrheadentry\"> </a> ";
1552 }
1553
1554 TString currClassNameMangled(fCurrentClass->GetName());
1555 NameSpace2FileName(currClassNameMangled);
1556
1557 TString wikiLink = GetHtml()->GetWikiURL();
1558 if (wikiLink.Length()) {
1559 if (wikiLink.Contains("%c")) wikiLink.ReplaceAll("%c", currClassNameMangled);
1560 else wikiLink += currClassNameMangled;
1561 classFile << "<a class=\"descrheadentry\" href=\"" << wikiLink << "\">wiki</a> ";
1562 }
1563
1564 classFile << std::endl << "</div></div>" << std::endl; // descrhead line 3
1565
1566 classFile << "<div class=\"descrhead\"><div class=\"descrheadcontent\">" << std::endl // descrhead line 4
1567 << "<span class=\"descrtitle\">Sections:</span>" << std::endl
1568 << "<a class=\"descrheadentry\" href=\"#" << currClassNameMangled;
1570 classFile << ":description\">namespace description</a> ";
1571 else
1572 classFile << ":description\">class description</a> ";
1573 classFile << std::endl
1574 << "<a class=\"descrheadentry\" href=\"#" << currClassNameMangled << ":Function_Members\">function members</a>" << std::endl
1575 << "<a class=\"descrheadentry\" href=\"#" << currClassNameMangled << ":Data_Members\">data members</a>" << std::endl
1576 << "<a class=\"descrheadentry\" href=\"#" << currClassNameMangled << ":Class_Charts\">class charts</a>" << std::endl
1577 << "</div></div>" << std::endl // descrhead line 4
1578 << "</div>" << std::endl; // toplinks, from TDocOutput::WriteTopLinks
1579
1580 WriteLocation(classFile, module, fCurrentClass->GetName());
1581}
1582
1583
1584////////////////////////////////////////////////////////////////////////////////
1585/// Write method name with return type ret and parameters param to out.
1586/// Build a link using file and anchor. Cooment it with comment, and
1587/// show the code codeOneLiner (set if the func consists of only one line
1588/// of code, immediately surrounded by "{","}"). Also updates fMethodNames's
1589/// count of method names.
1590
1591void TClassDocOutput::WriteMethod(std::ostream& out, TString& ret,
1592 TString& name, TString& params,
1593 const char* filename, TString& anchor,
1594 TString& comment, TString& codeOneLiner,
1595 TDocMethodWrapper* guessedMethod)
1596{
1598 out << "<div class=\"funcdoc\"><span class=\"funcname\">"
1599 << ret << " <a class=\"funcname\" name=\"";
1600 TString mangled(fCurrentClass->GetName());
1601 NameSpace2FileName(mangled);
1602 out << mangled << ":";
1603 mangled = name;
1604 NameSpace2FileName(mangled);
1605 if (guessedMethod && guessedMethod->GetOverloadIdx()) {
1606 mangled += "@";
1607 mangled += guessedMethod->GetOverloadIdx();
1608 }
1609 out << mangled << "\" href=\"src/" << filename;
1610 if (anchor.Length())
1611 out << "#" << anchor;
1612 out << "\">";
1614 out << "</a>";
1615 if (guessedMethod) {
1616 out << "(";
1617 TMethodArg* arg;
1618 TIter iParam(guessedMethod->GetMethod()->GetListOfMethodArgs());
1619 Bool_t first = kTRUE;
1620 while ((arg = (TMethodArg*) iParam())) {
1621 if (!first) out << ", ";
1622 else first = kFALSE;
1623 TString paramGuessed(arg->GetFullTypeName());
1624 paramGuessed += " ";
1625 paramGuessed += arg->GetName();
1626 if (arg->GetDefault() && strlen(arg->GetDefault())) {
1627 paramGuessed += " = ";
1628 paramGuessed += arg->GetDefault();
1629 }
1630 fParser->DecorateKeywords(paramGuessed);
1631 out << paramGuessed;
1632 }
1633 out << ")";
1634 if (guessedMethod->GetMethod()->Property() & kIsConstMethod)
1635 out << " const";
1636 } else {
1637 fParser->DecorateKeywords(params);
1638 out << params;
1639 }
1640 out << "</span><br />" << std::endl;
1641
1642 if (comment.Length())
1643 out << "<div class=\"funccomm\"><pre>" << comment << "</pre></div>" << std::endl;
1644
1645 if (codeOneLiner.Length()) {
1646 out << std::endl << "<div class=\"code\"><code class=\"inlinecode\">"
1647 << codeOneLiner << "</code></div>" << std::endl
1648 << "<div style=\"clear:both;\"></div>" << std::endl;
1649 codeOneLiner.Remove(0);
1650 }
1651 out << "</div>" << std::endl;
1652}
1653
1654
1655
const Ssiz_t kNPOS
Definition: RtypesCore.h:111
int Int_t
Definition: RtypesCore.h:41
int Ssiz_t
Definition: RtypesCore.h:63
unsigned int UInt_t
Definition: RtypesCore.h:42
const Bool_t kFALSE
Definition: RtypesCore.h:88
long Long_t
Definition: RtypesCore.h:50
bool Bool_t
Definition: RtypesCore.h:59
const Bool_t kTRUE
Definition: RtypesCore.h:87
#define ClassImp(name)
Definition: Rtypes.h:365
@ kIsConstMethod
Definition: TDictionary.h:93
@ kIsPrivate
Definition: TDictionary.h:76
@ kIsAbstract
Definition: TDictionary.h:71
@ kIsStatic
Definition: TDictionary.h:79
@ kIsProtected
Definition: TDictionary.h:75
@ kIsVirtual
Definition: TDictionary.h:72
const Int_t kWarning
Definition: TError.h:38
R__EXTERN Int_t gErrorIgnoreLevel
Definition: TError.h:105
char name[80]
Definition: TGX11.cxx:109
#define gROOT
Definition: TROOT.h:415
char * Form(const char *fmt,...)
void Printf(const char *fmt,...)
char * StrDup(const char *str)
Duplicate the string str.
Definition: TString.cxx:2490
R__EXTERN TSystem * gSystem
Definition: TSystem.h:560
#define R__LOCKGUARD(mutex)
const char * extension
Definition: civetweb.c:7793
Each class (see TClass) has a linked list of its base class(es).
Definition: TBaseClass.h:33
TClass * GetClassPointer(Bool_t load=kTRUE)
Get pointer to the base class TClass.
Definition: TBaseClass.cxx:63
Long_t Property() const
Get property description word. For meaning of bits see EProperty.
Definition: TBaseClass.cxx:134
virtual const char * GetName() const
Returns name of object.
Definition: TDocInfo.cxx:26
const char * GetHtmlFileName() const
Definition: TDocInfo.h:60
TDictionary * GetClass() const
Definition: TDocInfo.h:58
virtual void WriteMethod(std::ostream &out, TString &ret, TString &name, TString &params, const char *file, TString &anchor, TString &comment, TString &codeOneLiner, TDocMethodWrapper *guessedMethod)
Write method name with return type ret and parameters param to out.
void DescendHierarchy(std::ostream &out, TClass *basePtr, Int_t maxLines=0, Int_t depth=1)
Descend hierarchy recursively loop over all classes and look for classes with base class basePtr.
TList * fCurrentClassesTypedefs
void MakeTree(Bool_t force=kFALSE)
Create an output file with a graphical representation of the class inheritance.
virtual void WriteClassDescription(std::ostream &out, const TString &description)
Called by TDocParser::LocateMethods(), this hook writes out the class description found by TDocParser...
Bool_t CreateDotClassChartLib(const char *filename)
Build the library dependency graph for one class in GraphViz/Dot format.
Bool_t CreateDotClassChartInh(const char *filename)
Build the class tree for one class in GraphViz/Dot format.
void ClassTree(TVirtualPad *canvas, Bool_t force=kFALSE)
It makes a graphical class tree.
Bool_t CreateDotClassChartIncl(const char *filename)
Build the include dependency graph for one class in GraphViz/Dot format.
TDocParser * fParser
virtual void ListDataMembers(std::ostream &classFile)
Write the list of data members and enums.
TClass * fCurrentClass
void CreateSourceOutputStream(std::ostream &out, const char *extension, TString &filename)
Open a Class.cxx.html file, where Class is defined by classPtr, and .cxx.html by extension It's creat...
virtual void WriteClassDocHeader(std::ostream &classFile)
Write out the introduction of a class description (shortcuts and links)
void Class2Html(Bool_t force=kFALSE)
Create HTML files for a single class.
void CreateClassHierarchy(std::ostream &out, const char *docFileName)
Create the hierarchical class list part for the current class's base classes.
virtual ~TClassDocOutput()
Destructor, deletes fParser.
Bool_t CreateDotClassChartInhMem(const char *filename)
Build the class tree of inherited members for one class in GraphViz/Dot format.
void ClassHtmlTree(std::ostream &out, TClass *classPtr, ETraverse dir=kBoth, int depth=1)
This function builds the class tree for one class in HTML (inherited and succeeding classes,...
TClassDocOutput(THtml &html, TClass *cl, TList *typedefs)
Create an object given the invoking THtml object, and the TClass object that we will generate output ...
Bool_t CreateHierarchyDot()
Create a hierarchical class list The algorithm descends from the base classes and branches into all d...
friend class TDocParser
virtual void ListFunctions(std::ostream &classFile)
Write the list of functions.
Bool_t ClassDotCharts(std::ostream &out)
This function builds the class charts for one class in GraphViz/Dot format, i.e.
TClass instances represent classes, structs and namespaces in the ROOT type system.
Definition: TClass.h:75
TList * GetListOfMethods(Bool_t load=kTRUE)
Return list containing the TMethods of a class.
Definition: TClass.cxx:3655
TList * GetListOfDataMembers(Bool_t load=kTRUE)
Return list containing the TDataMembers of a class.
Definition: TClass.cxx:3606
TList * GetListOfBases()
Return list containing the TBaseClass(es) of a class.
Definition: TClass.cxx:3496
Long_t Property() const
Set TObject::fBits and fStreamerType to cache information about the class.
Definition: TClass.cxx:5788
const char * GetSharedLibs()
Get the list of shared libraries containing the code for class cls.
Definition: TClass.cxx:3483
void Draw(Option_t *option="")
Draw detailed class inheritance structure.
Definition: TClass.cxx:2425
TMethod * GetMethodAny(const char *method)
Return pointer to method without looking at parameters.
Definition: TClass.cxx:4215
Bool_t InheritsFrom(const char *cl) const
Return kTRUE if this class inherits from a class with name "classname".
Definition: TClass.cxx:4708
virtual Int_t GetEntries() const
Definition: TCollection.h:177
virtual Bool_t IsEmpty() const
Definition: TCollection.h:186
virtual Int_t GetSize() const
Return the capacity of the collection, i.e.
Definition: TCollection.h:182
All ROOT classes may have RTTI (run time type identification) support added.
Definition: TDataMember.h:31
Int_t GetMaxIndex(Int_t dim) const
Return maximum index for array dimension "dim".
Int_t GetArrayDim() const
Return number of array dimensions.
const char * GetTypeName() const
Get type of data member, e,g.: "class TDirectory*" -> "TDirectory".
const char * GetFullTypeName() const
Get full type description of data member, e,g.: "class TDirectory*".
Long_t Property() const
Get property description word. For meaning of bits see EProperty.
TClass * GetClass() const
Definition: TDataMember.h:73
Basic data type descriptor (datatype information is obtained from CINT).
Definition: TDataType.h:44
This class defines an abstract interface that must be implemented by all classes that contain diction...
Definition: TDictionary.h:162
virtual Int_t GetOverloadIdx() const =0
virtual TMethod * GetMethod() const =0
virtual Bool_t IsModified(TClass *classPtr, EFileType type)
Check if file is modified.
virtual void NameSpace2FileName(TString &name)
Replace "::" in name by "__" Replace "<", ">", " ", ",", "~", "=" in name by "_" Replace "A::X<A::Y>"...
void WriteTopLinks(std::ostream &out, TModuleDocInfo *module, const char *classname=0, Bool_t withLocation=kTRUE)
Write the first part of the links shown ontop of each doc page; one <div> has to be closed by caller ...
Bool_t CopyHtmlFile(const char *sourceName, const char *destName="")
Copy file to HTML directory.
Definition: TDocOutput.cxx:592
void WriteHtmlFooter(std::ostream &out, const char *dir, const char *lastUpdate, const char *author, const char *copyright, const char *footer)
Write HTML footer.
virtual const char * ReplaceSpecialChars(char c)
Replace ampersand, less-than and greater-than character, writing to out.
Bool_t RunDot(const char *filename, std::ostream *outMap=0, EGraphvizTool gvwhat=kDot)
Run filename".dot", creating filename".png", and - if outMap is !=0, filename".map",...
THtml * fHtml
Definition: TDocOutput.h:46
THtml * GetHtml()
Definition: TDocOutput.h:90
void WriteHtmlHeader(std::ostream &out, const char *titleNoSpecial, const char *dir, TClass *cls, const char *header)
Write HTML header.
virtual void WriteSearch(std::ostream &out)
Write a search link or a search box, based on THtml::GetSearchStemURL() and THtml::GetSearchEngine().
void WriteLocation(std::ostream &out, TModuleDocInfo *module, const char *classname=0)
make a link to the description
const TList * GetMethods(EAccess access) const
Definition: TDocParser.h:170
const char * GetSourceInfo(ESourceInfo type) const
Definition: TDocParser.h:177
const TList * GetDataMembers(EAccess access) const
Definition: TDocParser.h:175
@ kInfoLastUpdate
Definition: TDocParser.h:55
@ kInfoCopyright
Definition: TDocParser.h:57
const TList * GetEnums(EAccess access) const
Definition: TDocParser.h:176
virtual void DecorateKeywords(std::ostream &out, const char *text)
Expand keywords in text, writing to out.
Definition: TDocParser.cxx:450
virtual void Parse(std::ostream &out)
Locate methods, starting in the source file, then inline, then immediately inside the class declarati...
Long_t Property() const
Get property description word. For meaning of bits see EProperty.
Definition: TFunction.cxx:183
const char * GetReturnTypeName() const
Get full type description of function return type, e,g.: "class TDirectory*".
Definition: TFunction.cxx:140
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.
Definition: THtml.cxx:571
Definition: THtml.h:40
const char * GetCounter() const
Definition: THtml.h:323
const TString & GetViewCVS() const
Definition: THtml.h:313
const char * ShortType(const char *name) const
Get short type name, i.e. with default templates removed.
Definition: THtml.cxx:2510
virtual TClass * GetClass(const char *name) const
Return pointer to class with name.
Definition: THtml.cxx:2066
static Bool_t IsNamespace(const TClass *cl)
Check whether cl is a namespace.
Definition: THtml.cxx:2192
const char * GetCounterFormat() const
Definition: THtml.h:303
const TList * GetListOfModules() const
Definition: THtml.h:340
Bool_t HaveDot()
Check whether dot is available in $PATH or in the directory set by SetDotPath()
Definition: THtml.cxx:1403
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
Definition: THtml.cxx:1954
virtual bool GetDeclFileName(TClass *cl, Bool_t filesys, TString &out_name) const
Return declaration file name; return the full path if filesys is true.
Definition: THtml.cxx:2095
const TString & GetWikiURL() const
Definition: THtml.h:314
virtual void GetHtmlFileName(TClass *classPtr, TString &filename) const
Return real HTML filename.
Definition: THtml.cxx:1991
virtual void GetModuleNameForClass(TString &module, TClass *cl) const
Return the module name for a given class.
Definition: THtml.cxx:1530
const TString & GetOutputDir(Bool_t createDir=kTRUE) const
Return the output directory as set by SetOutputDir().
Definition: THtml.cxx:2167
virtual bool GetImplFileName(TClass *cl, Bool_t filesys, TString &out_name) const
Return implementation file name.
Definition: THtml.cxx:2103
const TList * GetListOfClasses() const
Definition: THtml.h:341
const TPathDefinition & GetPathDefinition() const
Return the TModuleDefinition (or derived) object as set by SetModuleDefinition(); create and return a...
Definition: THtml.cxx:1331
A doubly linked list.
Definition: TList.h:44
virtual TObject * FindObject(const char *name) const
Find an object in this list using its name.
Definition: TList.cxx:575
virtual TObject * First() const
Return the first object in the list. Returns 0 when list is empty.
Definition: TList.cxx:656
Each ROOT method (see TMethod) has a linked list of its arguments.
Definition: TMethodArg.h:31
const char * GetFullTypeName() const
Get full type description of method argument, e.g.: "class TDirectory*".
Definition: TMethodArg.cxx:75
const char * GetDefault() const
Get default value of method argument.
Definition: TMethodArg.cxx:58
Each ROOT class (see TClass) has a linked list of methods.
Definition: TMethod.h:38
TClass * GetClass() const
Definition: TMethod.h:55
virtual TList * GetListOfMethodArgs()
Returns methodarg list and additionally updates fDataMember in TMethod by calling FindDataMember();.
Definition: TMethod.cxx:306
virtual const char * GetTitle() const
Returns title of object.
Definition: TNamed.h:48
virtual const char * GetName() const
Returns name of object.
Definition: TNamed.h:47
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
Definition: TObject.cxx:866
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Definition: TObject.cxx:880
Basic string class.
Definition: TString.h:131
Ssiz_t Length() const
Definition: TString.h:405
void ToLower()
Change string to lower-case.
Definition: TString.cxx:1125
TString & Insert(Ssiz_t pos, const char *s)
Definition: TString.h:644
Bool_t EndsWith(const char *pat, ECaseCompare cmp=kExact) const
Return true if string ends with the specified string.
Definition: TString.cxx:2177
Ssiz_t First(char c) const
Find first occurrence of a character c.
Definition: TString.cxx:499
const char * Data() const
Definition: TString.h:364
TString & ReplaceAll(const TString &s1, const TString &s2)
Definition: TString.h:687
Ssiz_t Last(char c) const
Find last occurrence of a character c.
Definition: TString.cxx:892
Bool_t BeginsWith(const char *s, ECaseCompare cmp=kExact) const
Definition: TString.h:610
TString & Prepend(const char *cs)
Definition: TString.h:656
TString & Remove(Ssiz_t pos)
Definition: TString.h:668
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Definition: TString.h:619
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
Definition: TString.h:634
A zero length substring is legal.
Definition: TString.h:77
Ssiz_t Start() const
Definition: TString.h:115
Ssiz_t Length() const
Definition: TString.h:114
virtual int MakeDirectory(const char *name)
Make a directory.
Definition: TSystem.cxx:835
virtual const char * PrependPathName(const char *dir, TString &name)
Concatenate a directory and a file name.
Definition: TSystem.cxx:1072
virtual Bool_t AccessPathName(const char *path, EAccessMode mode=kFileExists)
Returns FALSE if one can access a file using the specified access mode.
Definition: TSystem.cxx:1287
virtual const char * BaseName(const char *pathname)
Base name of a file name. Base name of /user/root is root.
Definition: TSystem.cxx:942
virtual Bool_t IsAbsoluteFileName(const char *dir)
Return true if dir is an absolute pathname.
Definition: TSystem.cxx:959
TVirtualPad is an abstract base class for the Pad and Canvas classes.
Definition: TVirtualPad.h:50
virtual void SaveAs(const char *filename="", Option_t *option="") const =0
Save this object in the file specified by filename.
virtual void Close(Option_t *option="")=0
TLine * line
TClass * GetClass(T *)
Definition: TClass.h:608
Definition: first.py:1