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