Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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
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
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
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 = line.find(delim);
964 if (pos == std::string::npos) continue;
965 line.erase(pos);
966 if (filesToParse.find(line) == filesToParse.end()) {
967 TString sysfilename;
968 if (!GetHtml()->GetPathDefinition().GetFileNameFromInclude(line.c_str(), sysfilename))
969 continue;
970 listFilesToParse.push_back(line);
971 filesToParse[line] = sysfilename;
972 if (*iFile == implFileName.Data() || *iFile == declFileName.Data())
973 outdot << "\"" << *iFile << "\" [style=filled,fillcolor=lightgray];" << std::endl;
974 }
975 outdot << "\"" << *iFile << "\" -> \"" << line << "\";" << std::endl;
976 }
977 }
978
979 outdot << "}" << std::endl; // digraph
980
981 return kTRUE;
982}
983
984////////////////////////////////////////////////////////////////////////////////
985/// Build the library dependency graph for one class in
986/// GraphViz/Dot format
987///
988/// Input: filename - output dot file incl. path
989
991 std::ofstream outdot(filename);
992 outdot << "strict digraph G {" << std::endl
993 << "ratio=auto;" << std::endl
994 << "rankdir=RL;" << std::endl
995 << "compound=true;" << std::endl
996 << "constraint=false;" << std::endl
997 << "ranksep=0.7;" << std::endl
998 << "nodesep=0.3;" << std::endl
999 << "size=\"8,8\";" << std::endl
1000 << "ratio=compress;" << std::endl;
1001
1003 outdot << "\"All Libraries\" [URL=\"LibraryDependencies.html\",shape=box,rank=max,fillcolor=lightgray,style=filled];" << std::endl;
1004
1005 if (libs.Length()) {
1006 TString firstLib(libs);
1007 Ssiz_t end = firstLib.Index(' ');
1008 if (end != kNPOS) {
1009 firstLib.Remove(end, firstLib.Length());
1010 libs.Remove(0, end + 1);
1011 } else libs = "";
1012
1013 {
1014 Ssiz_t posExt = firstLib.First(".");
1015 if (posExt != kNPOS)
1016 firstLib.Remove(posExt, firstLib.Length());
1017 }
1018
1019 outdot << "\"All Libraries\" -> \"" << firstLib << "\" [style=invis];" << std::endl;
1020 outdot << "\"" << firstLib << "\" -> {" << std::endl;
1021
1022 if (firstLib != "libCore")
1023 libs += " libCore";
1024 if (firstLib != "libCint")
1025 libs += " libCint";
1026 TString thisLib;
1027 for (Ssiz_t pos = 0; pos < libs.Length(); ++pos)
1028 if (libs[pos] != ' ')
1029 thisLib += libs[pos];
1030 else if (thisLib.Length()) {
1031 Ssiz_t posExt = thisLib.First(".");
1032 if (posExt != kNPOS)
1033 thisLib.Remove(posExt, thisLib.Length());
1034 outdot << " \"" << thisLib << "\";";
1035 thisLib = "";
1036 }
1037 // remaining lib
1038 if (thisLib.Length()) {
1039 Ssiz_t posExt = thisLib.First(".");
1040 if (posExt != kNPOS)
1041 thisLib.Remove(posExt, thisLib.Length());
1042 outdot << " \"" << thisLib << "\";";
1043 thisLib = "";
1044 }
1045 outdot << "}" << std::endl; // dependencies
1046 } else
1047 outdot << "\"No rlibmap information available.\"" << std::endl;
1048
1049 outdot << "}" << std::endl; // digraph
1050
1051 return kTRUE;
1052}
1053
1054////////////////////////////////////////////////////////////////////////////////
1055/// Create the hierarchical class list part for the current class's
1056/// base classes. docFileName contains doc for fCurrentClass.
1057///
1058
1059void TClassDocOutput::CreateClassHierarchy(std::ostream& out, const char* docFileName)
1060{
1061 // Find basic base classes
1063 if (!bases || bases->IsEmpty())
1064 return;
1065
1066 out << "<hr />" << std::endl;
1067
1068 out << "<table><tr><td><ul><li><tt>";
1069 if (docFileName) {
1070 out << "<a name=\"" << fCurrentClass->GetName() << "\" href=\""
1071 << docFileName << "\">";
1073 out << "</a>";
1074 } else {
1076 }
1077
1078 // find derived classes
1079 out << "</tt></li></ul></td>";
1080 fHierarchyLines = 0;
1082
1083 out << "</tr></table>" << std::endl;
1084}
1085
1086////////////////////////////////////////////////////////////////////////////////
1087/// Create a hierarchical class list
1088/// The algorithm descends from the base classes and branches into
1089/// all derived classes. Mixing classes are displayed several times.
1090///
1091///
1092
1094{
1095 const char* title = "ClassHierarchy";
1096 TString filename(title);
1098
1099 // open out file
1100 std::ofstream dotout(filename + ".dot");
1101
1102 if (!dotout.good()) {
1103 Error("CreateHierarchy", "Can't open file '%s.dot' !",
1104 filename.Data());
1105 return kFALSE;
1106 }
1107
1108 dotout << "digraph G {" << std::endl
1109 << "ratio=auto;" << std::endl
1110 << "rankdir=RL;" << std::endl;
1111
1112 // loop on all classes
1113 TClassDocInfo* cdi = 0;
1114 TIter iClass(fHtml->GetListOfClasses());
1115 while ((cdi = (TClassDocInfo*)iClass())) {
1116
1117 TDictionary *dict = cdi->GetClass();
1118 TClass *cl = dynamic_cast<TClass*>(dict);
1119 if (cl == 0) {
1120 if (!dict)
1121 Warning("THtml::CreateHierarchy", "skipping class %s\n", cdi->GetName());
1122 continue;
1123 }
1124
1125 // Find immediate base classes
1126 TList *bases = cl->GetListOfBases();
1127 if (bases && !bases->IsEmpty()) {
1128 dotout << "\"" << cdi->GetName() << "\" -> { ";
1129 TIter iBase(bases);
1130 TBaseClass* base = 0;
1131 while ((base = (TBaseClass*) iBase())) {
1132 // write out current class
1133 if (base != bases->First())
1134 dotout << "; ";
1135 dotout << "\"" << base->GetName() << "\"";
1136 }
1137 dotout << "};" << std::endl;
1138 } else
1139 // write out current class - no bases
1140 dotout << "\"" << cdi->GetName() << "\";" << std::endl;
1141
1142 }
1143
1144 dotout << "}";
1145 dotout.close();
1146
1147 std::ofstream out(filename + ".html");
1148 if (!out.good()) {
1149 Error("CreateHierarchy", "Can't open file '%s.html' !",
1150 filename.Data());
1151 return kFALSE;
1152 }
1153
1154 Printf(fHtml->GetCounterFormat(), "", fHtml->GetCounter(), (filename + ".html").Data());
1155 // write out header
1156 WriteHtmlHeader(out, "Class Hierarchy");
1157 out << "<h1>Class Hierarchy</h1>" << std::endl;
1158
1159 WriteSearch(out);
1160
1161 RunDot(filename, &out);
1162
1163 out << "<img usemap=\"#Map" << title << "\" src=\"" << title << ".png\"/>" << std::endl;
1164 // write out footer
1165 WriteHtmlFooter(out);
1166 return kTRUE;
1167}
1168
1169////////////////////////////////////////////////////////////////////////////////
1170/// Open a Class.cxx.html file, where Class is defined by classPtr, and .cxx.html by extension
1171/// It's created in fHtml->GetOutputDir()/src. If successful, the HTML header is written to out.
1172
1173void TClassDocOutput::CreateSourceOutputStream(std::ostream& out, const char* extension,
1174 TString& sourceHtmlFileName)
1175{
1176 TString sourceHtmlDir("src");
1177 gSystem->PrependPathName(fHtml->GetOutputDir(), sourceHtmlDir);
1178 // create directory if necessary
1179 {
1180 R__LOCKGUARD(GetHtml()->GetMakeClassMutex());
1181
1182 if (gSystem->AccessPathName(sourceHtmlDir))
1183 gSystem->MakeDirectory(sourceHtmlDir);
1184 }
1185 sourceHtmlFileName = fCurrentClass->GetName();
1186 NameSpace2FileName(sourceHtmlFileName);
1187 gSystem->PrependPathName(sourceHtmlDir, sourceHtmlFileName);
1188 sourceHtmlFileName += extension;
1189 dynamic_cast<std::ofstream&>(out).open(sourceHtmlFileName);
1190 if (!out) {
1191 Warning("LocateMethodsInSource", "Can't open beautified source file '%s' for writing!",
1192 sourceHtmlFileName.Data());
1193 sourceHtmlFileName.Remove(0);
1194 return;
1195 }
1196
1197 // write a HTML header
1198 TString title(fCurrentClass->GetName());
1199 title += " - source file";
1200 WriteHtmlHeader(out, title, "../", fCurrentClass);
1201 out << "<div id=\"codeAndLineNumbers\"><pre class=\"listing\">" << std::endl;
1202}
1203
1204////////////////////////////////////////////////////////////////////////////////
1205/// Descend hierarchy recursively
1206/// loop over all classes and look for classes with base class basePtr
1207
1208void TClassDocOutput::DescendHierarchy(std::ostream& out, TClass* basePtr, Int_t maxLines, Int_t depth)
1209{
1210 if (maxLines)
1211 if (fHierarchyLines >= maxLines) {
1212 out << "<td></td>" << std::endl;
1213 return;
1214 }
1215
1216 UInt_t numClasses = 0;
1217
1218 TClassDocInfo* cdi = 0;
1219 TIter iClass(fHtml->GetListOfClasses());
1220 while ((cdi = (TClassDocInfo*)iClass()) && (!maxLines || fHierarchyLines<maxLines)) {
1221
1222 TClass *classPtr = dynamic_cast<TClass*>(cdi->GetClass());
1223 if (!classPtr) continue;
1224
1225 // find base classes with same name as basePtr
1226 TList* bases=classPtr->GetListOfBases();
1227 if (!bases) continue;
1228
1229 TBaseClass *inheritFrom=(TBaseClass*)bases->FindObject(basePtr->GetName());
1230 if (!inheritFrom) continue;
1231
1232 if (!numClasses)
1233 out << "<td>&larr;</td><td><table><tr>" << std::endl;
1234 else
1235 out << "</tr><tr>"<<std::endl;
1237 numClasses++;
1238 UInt_t bgcolor=255-depth*8;
1239 out << "<td bgcolor=\""
1240 << Form("#%02x%02x%02x", bgcolor, bgcolor, bgcolor)
1241 << "\">";
1242 out << "<table><tr><td>" << std::endl;
1243
1244 TString htmlFile(cdi->GetHtmlFileName());
1245 if (htmlFile.Length()) {
1246 out << "<center><tt><a name=\"" << cdi->GetName() << "\" href=\""
1247 << htmlFile << "\">";
1248 ReplaceSpecialChars(out, cdi->GetName());
1249 out << "</a></tt></center>";
1250 } else {
1251 ReplaceSpecialChars(out, cdi->GetName());
1252 }
1253 // write title
1254 // commented out for now because it reduces overview
1255 /*
1256 len = strlen(classNames[i]);
1257 for (Int_t w = 0; w < (maxLen - len + 2); w++)
1258 out << ".";
1259 out << " ";
1260
1261 out << "<a name=\"Title:";
1262 out << classPtr->GetName();
1263 out << "\">";
1264 ReplaceSpecialChars(out, classPtr->GetTitle());
1265 out << "</a></tt>" << std::endl;
1266 */
1267
1268 out << "</td>" << std::endl;
1269 DescendHierarchy(out,classPtr,maxLines, depth+1);
1270 out << "</tr></table></td>" << std::endl;
1271
1272 } // loop over all classes
1273 if (numClasses)
1274 out << "</tr></table></td>" << std::endl;
1275 else
1276 out << "<td></td>" << std::endl;
1277}
1278
1279////////////////////////////////////////////////////////////////////////////////
1280/// Create an output file with a graphical representation of the class
1281/// inheritance. If force, replace existing output file.
1282/// This routine does nothing if fHtml->HaveDot() is true - use
1283/// ClassDotCharts() instead!
1284
1285void TClassDocOutput::MakeTree(Bool_t force /*= kFALSE*/)
1286{
1287 // class tree only if no dot, otherwise it's part of charts
1288 if (!fCurrentClass || fHtml->HaveDot())
1289 return;
1290
1291 TString htmlFile;
1293 if (htmlFile.Length()
1294 && (htmlFile.BeginsWith("http://")
1295 || htmlFile.BeginsWith("https://")
1296 || gSystem->IsAbsoluteFileName(htmlFile))
1297 ) {
1298 htmlFile.Remove(0);
1299 }
1300
1301 if (!htmlFile.Length()) {
1303 what += " (source not found)";
1304 Printf(fHtml->GetCounterFormat(), "-skipped-", "", what.Data());
1305 return;
1306 }
1307
1308 R__LOCKGUARD(GetHtml()->GetMakeClassMutex());
1309
1310 // Create a canvas without linking against GUI libs
1311 Bool_t wasBatch = gROOT->IsBatch();
1312 if (!wasBatch)
1313 gROOT->SetBatch();
1314 TVirtualPad *psCanvas = (TVirtualPad*)gROOT->ProcessLineFast("new TCanvas(\"R__THtml\",\"psCanvas\",0,0,1000,1200);");
1315 if (!wasBatch)
1317
1318 if (!psCanvas) {
1319 Error("MakeTree", "Cannot create a TCanvas!");
1320 return;
1321 }
1322
1323 // make a class tree
1324 ClassTree(psCanvas, force);
1325
1326 psCanvas->Close();
1327 delete psCanvas;
1328}
1329
1330////////////////////////////////////////////////////////////////////////////////
1331/// Called by TDocParser::LocateMethods(), this hook writes out the class description
1332/// found by TDocParser. It's even called if none is found, i.e. if the first method
1333/// has occurred before a class description is found, so missing class descriptions
1334/// can be handled.
1335/// For HTML, its creates the description block, the list of functions and data
1336/// members, and the inheritance tree or, if Graphviz's dot is found, the class charts.
1337
1338void TClassDocOutput::WriteClassDescription(std::ostream& out, const TString& description)
1339{
1340 // Class Description Title
1341 out << "<div class=\"dropshadow\"><div class=\"withshadow\">";
1342 TString anchor(fCurrentClass->GetName());
1343 NameSpace2FileName(anchor);
1344 out << "<h1><a name=\"" << anchor;
1345 out << ":description\"></a>";
1346
1348 out << "namespace ";
1349 else
1350 out << "class ";
1352
1353
1354 // make a loop on base classes
1355 Bool_t first = kTRUE;
1356 TBaseClass *inheritFrom;
1357 TIter nextBase(fCurrentClass->GetListOfBases());
1358
1359 while ((inheritFrom = (TBaseClass *) nextBase())) {
1360 if (first) {
1361 out << ": ";
1362 first = kFALSE;
1363 } else
1364 out << ", ";
1365 Long_t property = inheritFrom->Property();
1366 if (property & kIsPrivate)
1367 out << "private ";
1368 else if (property & kIsProtected)
1369 out << "protected ";
1370 else
1371 out << "public ";
1372
1373 // get a class
1374 TClass *classInh = fHtml->GetClass(inheritFrom->GetName());
1375
1376 TString htmlFile;
1377 fHtml->GetHtmlFileName(classInh, htmlFile);
1378
1379 if (htmlFile.Length()) {
1380 // make a link to the base class
1381 out << "<a href=\"" << htmlFile << "\">";
1382 ReplaceSpecialChars(out, inheritFrom->GetName());
1383 out << "</a>";
1384 } else
1385 ReplaceSpecialChars(out, inheritFrom->GetName());
1386 }
1387 out << "</h1>" << std::endl;
1388
1389 out << "<div class=\"classdescr\">" << std::endl;
1390
1391 if (description.Length())
1392 out << "<pre>" << description << "</pre>";
1393
1394 // typedefs pointing to this class:
1396 out << "<h4>This class is also known as (typedefs to this class)</h4>";
1398 bool firsttd = true;
1399 TDataType* dt = 0;
1400 while ((dt = (TDataType*) iTD())) {
1401 if (!firsttd)
1402 out << ", ";
1403 else firsttd = false;
1404 fParser->DecorateKeywords(out, dt->GetName());
1405 }
1406 }
1407
1408 out << "</div>" << std::endl
1409 << "</div></div>" << std::endl;
1410
1411 ListFunctions(out);
1412 ListDataMembers(out);
1413
1414 // create dot class charts or an html inheritance tree
1415 out << "<h2><a id=\"" << anchor
1416 << ":Class_Charts\"></a>Class Charts</h2>" << std::endl;
1418 if (!ClassDotCharts(out))
1420
1421 // header for the following function docs:
1422 out << "<h2>Function documentation</h2>" << std::endl;
1423}
1424
1425
1426////////////////////////////////////////////////////////////////////////////////
1427/// Write out the introduction of a class description (shortcuts and links)
1428
1429void TClassDocOutput::WriteClassDocHeader(std::ostream& classFile)
1430{
1431 classFile << "<a name=\"TopOfPage\"></a>" << std::endl;
1432
1433
1434 // show box with lib, include
1435 // needs to go first to allow title on the left
1436 TString sTitle(fCurrentClass->GetName());
1437 ReplaceSpecialChars(sTitle);
1439 sTitle.Prepend("namespace ");
1440 else
1441 sTitle.Prepend("class ");
1442
1443 TString sInclude;
1444 TString sLib;
1445 const char* lib=fCurrentClass->GetSharedLibs();
1447 if (lib) {
1448 char* libDup=StrDup(lib);
1449 char* libDupSpace=strchr(libDup,' ');
1450 if (libDupSpace) *libDupSpace=0;
1451 char* libDupEnd=libDup+strlen(libDup);
1452 while (libDupEnd!=libDup)
1453 if (*(--libDupEnd)=='.') {
1454 *libDupEnd=0;
1455 break;
1456 }
1457 sLib = libDup;
1458 delete[] libDup;
1459 }
1460 classFile << "<script type=\"text/javascript\">WriteFollowPageBox('"
1461 << sTitle << "','" << sLib << "','" << sInclude << "');</script>" << std::endl;
1462
1463 TString modulename;
1465 TModuleDocInfo* module = (TModuleDocInfo*) fHtml->GetListOfModules()->FindObject(modulename);
1466 WriteTopLinks(classFile, module, fCurrentClass->GetName(), kFALSE);
1467
1468 classFile << "<div class=\"descrhead\"><div class=\"descrheadcontent\">" << std::endl // descrhead line 3
1469 << "<span class=\"descrtitle\">Source:</span>" << std::endl;
1470
1471 // make a link to the '.cxx' file
1472 TString classFileName(fCurrentClass->GetName());
1473 NameSpace2FileName(classFileName);
1474
1475 TString headerFileName;
1476 fHtml->GetDeclFileName(fCurrentClass, kFALSE, headerFileName);
1477 TString sourceFileName;
1478 fHtml->GetImplFileName(fCurrentClass, kFALSE, sourceFileName);
1479 if (headerFileName.Length())
1480 classFile << "<a class=\"descrheadentry\" href=\"src/" << classFileName
1481 << ".h.html\">header file</a>" << std::endl;
1482 else
1483 classFile << "<a class=\"descrheadentry\"> </a>" << std::endl;
1484
1485 if (sourceFileName.Length())
1486 classFile << "<a class=\"descrheadentry\" href=\"src/" << classFileName
1487 << ".cxx.html\">source file</a>" << std::endl;
1488 else
1489 classFile << "<a class=\"descrheadentry\"> </a>" << std::endl;
1490
1492 // make a link to the inheritance tree (postscript)
1493 classFile << "<a class=\"descrheadentry\" href=\"" << classFileName << "_Tree.pdf\"";
1494 classFile << ">inheritance tree (.pdf)</a> ";
1495 }
1496
1497 const TString& viewCVSLink = GetHtml()->GetViewCVS();
1498 Bool_t mustReplace = viewCVSLink.Contains("%f");
1499 if (viewCVSLink.Length()) {
1500 if (headerFileName.Length()) {
1501 TString link(viewCVSLink);
1502 TString sHeader(headerFileName);
1503 if (GetHtml()->GetProductName() && !strcmp(GetHtml()->GetProductName(), "ROOT")) {
1504 Ssiz_t posInclude = sHeader.Index("/include/");
1505 if (posInclude != kNPOS) {
1506 // Cut off ".../include", i.e. keep leading '/'
1507 sHeader.Remove(0, posInclude + 8);
1508 } else {
1509 // no /include/; maybe /inc?
1510 posInclude = sHeader.Index("/inc/");
1511 if (posInclude != kNPOS) {
1512 sHeader = "/";
1513 sHeader += sInclude;
1514 }
1515 }
1516 if (sourceFileName && strstr(sourceFileName, "src")) {
1517 TString src(sourceFileName);
1518 src.Remove(src.Index("src"), src.Length());
1519 src += "inc";
1520 sHeader.Prepend(src);
1521 } else {
1523 Ssiz_t posEndLib = src.Index(' ');
1524 if (posEndLib != kNPOS)
1525 src.Remove(posEndLib, src.Length());
1526 if (src.BeginsWith("lib"))
1527 src.Remove(0, 3);
1528 posEndLib = src.Index('.');
1529 if (posEndLib != kNPOS)
1530 src.Remove(posEndLib, src.Length());
1531 src.ToLower();
1532 src += "/inc";
1533 sHeader.Prepend(src);
1534 }
1535 if (sHeader.BeginsWith("tmva/inc/TMVA"))
1536 sHeader.Remove(8, 5);
1537 }
1538 if (mustReplace) link.ReplaceAll("%f", sHeader);
1539 else link += sHeader;
1540 classFile << "<a class=\"descrheadentry\" href=\"" << link << "\">viewVC header</a> ";
1541 } else
1542 classFile << "<a class=\"descrheadentry\"> </a> ";
1543 if (sourceFileName.Length()) {
1544 TString link(viewCVSLink);
1545 if (mustReplace) link.ReplaceAll("%f", sourceFileName);
1546 else link += sourceFileName;
1547 classFile << "<a class=\"descrheadentry\" href=\"" << link << "\">viewVC source</a> ";
1548 } else
1549 classFile << "<a class=\"descrheadentry\"> </a> ";
1550 }
1551
1552 TString currClassNameMangled(fCurrentClass->GetName());
1553 NameSpace2FileName(currClassNameMangled);
1554
1555 TString wikiLink = GetHtml()->GetWikiURL();
1556 if (wikiLink.Length()) {
1557 if (wikiLink.Contains("%c")) wikiLink.ReplaceAll("%c", currClassNameMangled);
1558 else wikiLink += currClassNameMangled;
1559 classFile << "<a class=\"descrheadentry\" href=\"" << wikiLink << "\">wiki</a> ";
1560 }
1561
1562 classFile << std::endl << "</div></div>" << std::endl; // descrhead line 3
1563
1564 classFile << "<div class=\"descrhead\"><div class=\"descrheadcontent\">" << std::endl // descrhead line 4
1565 << "<span class=\"descrtitle\">Sections:</span>" << std::endl
1566 << "<a class=\"descrheadentry\" href=\"#" << currClassNameMangled;
1568 classFile << ":description\">namespace description</a> ";
1569 else
1570 classFile << ":description\">class description</a> ";
1571 classFile << std::endl
1572 << "<a class=\"descrheadentry\" href=\"#" << currClassNameMangled << ":Function_Members\">function members</a>" << std::endl
1573 << "<a class=\"descrheadentry\" href=\"#" << currClassNameMangled << ":Data_Members\">data members</a>" << std::endl
1574 << "<a class=\"descrheadentry\" href=\"#" << currClassNameMangled << ":Class_Charts\">class charts</a>" << std::endl
1575 << "</div></div>" << std::endl // descrhead line 4
1576 << "</div>" << std::endl; // toplinks, from TDocOutput::WriteTopLinks
1577
1578 WriteLocation(classFile, module, fCurrentClass->GetName());
1579}
1580
1581
1582////////////////////////////////////////////////////////////////////////////////
1583/// Write method name with return type ret and parameters param to out.
1584/// Build a link using file and anchor. Cooment it with comment, and
1585/// show the code codeOneLiner (set if the func consists of only one line
1586/// of code, immediately surrounded by "{","}"). Also updates fMethodNames's
1587/// count of method names.
1588
1589void TClassDocOutput::WriteMethod(std::ostream& out, TString& ret,
1590 TString& name, TString& params,
1591 const char* filename, TString& anchor,
1592 TString& comment, TString& codeOneLiner,
1593 TDocMethodWrapper* guessedMethod)
1594{
1596 out << "<div class=\"funcdoc\"><span class=\"funcname\">"
1597 << ret << " <a class=\"funcname\" name=\"";
1598 TString mangled(fCurrentClass->GetName());
1599 NameSpace2FileName(mangled);
1600 out << mangled << ":";
1601 mangled = name;
1602 NameSpace2FileName(mangled);
1603 if (guessedMethod && guessedMethod->GetOverloadIdx()) {
1604 mangled += "@";
1605 mangled += guessedMethod->GetOverloadIdx();
1606 }
1607 out << mangled << "\" href=\"src/" << filename;
1608 if (anchor.Length())
1609 out << "#" << anchor;
1610 out << "\">";
1612 out << "</a>";
1613 if (guessedMethod) {
1614 out << "(";
1615 TMethodArg* arg;
1616 TIter iParam(guessedMethod->GetMethod()->GetListOfMethodArgs());
1617 Bool_t first = kTRUE;
1618 while ((arg = (TMethodArg*) iParam())) {
1619 if (!first) out << ", ";
1620 else first = kFALSE;
1621 TString paramGuessed(arg->GetFullTypeName());
1622 paramGuessed += " ";
1623 paramGuessed += arg->GetName();
1624 if (arg->GetDefault() && strlen(arg->GetDefault())) {
1625 paramGuessed += " = ";
1626 paramGuessed += arg->GetDefault();
1627 }
1628 fParser->DecorateKeywords(paramGuessed);
1629 out << paramGuessed;
1630 }
1631 out << ")";
1632 if (guessedMethod->GetMethod()->Property() & kIsConstMethod)
1633 out << " const";
1634 } else {
1635 fParser->DecorateKeywords(params);
1636 out << params;
1637 }
1638 out << "</span><br />" << std::endl;
1639
1640 if (comment.Length())
1641 out << "<div class=\"funccomm\"><pre>" << comment << "</pre></div>" << std::endl;
1642
1643 if (codeOneLiner.Length()) {
1644 out << std::endl << "<div class=\"code\"><code class=\"inlinecode\">"
1645 << codeOneLiner << "</code></div>" << std::endl
1646 << "<div style=\"clear:both;\"></div>" << std::endl;
1647 codeOneLiner.Remove(0);
1648 }
1649 out << "</div>" << std::endl;
1650}
1651
1652
1653
long Long_t
Definition RtypesCore.h:54
constexpr Bool_t kFALSE
Definition RtypesCore.h:101
constexpr Ssiz_t kNPOS
Definition RtypesCore.h:124
constexpr Bool_t kTRUE
Definition RtypesCore.h:100
#define ClassImp(name)
Definition Rtypes.h:377
@ 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.cxx:37
Int_t gErrorIgnoreLevel
Definition TError.cxx:43
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char filename
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t src
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t property
char name[80]
Definition TGX11.cxx:110
#define gROOT
Definition TROOT.h:405
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
Definition TString.cxx:2467
void Printf(const char *fmt,...)
Formats a string in a circular formatting buffer and prints the string.
Definition TString.cxx:2481
char * StrDup(const char *str)
Duplicate the string str.
Definition TString.cxx:2535
R__EXTERN TSystem * gSystem
Definition TSystem.h:560
#define R__LOCKGUARD(mutex)
const char * extension
Definition civetweb.c:8024
Each class (see TClass) has a linked list of its base class(es).
Definition TBaseClass.h:33
Long_t Property() const override
Get property description word. For meaning of bits see EProperty.
TClass * GetClassPointer(Bool_t load=kTRUE)
Get pointer to the base class TClass.
virtual const char * GetName() const
Returns name of object.
Definition TDocInfo.cxx:25
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.
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:81
void Draw(Option_t *option="") override
Draw detailed class inheritance structure.
Definition TClass.cxx:2487
TList * GetListOfMethods(Bool_t load=kTRUE)
Return list containing the TMethods of a class.
Definition TClass.cxx:3812
TList * GetListOfDataMembers(Bool_t load=kTRUE)
Return list containing the TDataMembers of a class.
Definition TClass.cxx:3770
TList * GetListOfBases()
Return list containing the TBaseClass(es) of a class.
Definition TClass.cxx:3636
Bool_t InheritsFrom(const char *cl) const override
Return kTRUE if this class inherits from a class with name "classname".
Definition TClass.cxx:4874
const char * GetSharedLibs()
Get the list of shared libraries containing the code for class cls.
Definition TClass.cxx:3623
Long_t Property() const override
Returns the properties of the TClass as a bit field stored as a Long_t value.
Definition TClass.cxx:6086
TMethod * GetMethodAny(const char *method)
Return pointer to method without looking at parameters.
Definition TClass.cxx:4374
virtual Int_t GetEntries() const
virtual Bool_t IsEmpty() const
virtual Int_t GetSize() const
Return the capacity of the collection, i.e.
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".
Long_t Property() const override
Get property description word. For meaning of bits see EProperty.
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*".
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...
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.
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
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.
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 override
Get property description word. For meaning of bits see EProperty.
const char * GetReturnTypeName() const
Get full type description of function return type, e,g.: "class TDirectory*".
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
Legacy ROOT documentation system.
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:2520
virtual TClass * GetClass(const char *name) const
Return pointer to class with name.
Definition THtml.cxx:2076
static Bool_t IsNamespace(const TClass *cl)
Check whether cl is a namespace.
Definition THtml.cxx:2202
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:1411
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:1964
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:2105
const TString & GetWikiURL() const
Definition THtml.h:314
virtual void GetHtmlFileName(TClass *classPtr, TString &filename) const
Return real HTML filename.
Definition THtml.cxx:2001
virtual void GetModuleNameForClass(TString &module, TClass *cl) const
Return the module name for a given class.
Definition THtml.cxx:1540
const TString & GetOutputDir(Bool_t createDir=kTRUE) const
Return the output directory as set by SetOutputDir().
Definition THtml.cxx:2177
virtual bool GetImplFileName(TClass *cl, Bool_t filesys, TString &out_name) const
Return implementation file name.
Definition THtml.cxx:2113
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:1339
A doubly linked list.
Definition TList.h:38
TObject * FindObject(const char *name) const override
Find an object in this list using its name.
Definition TList.cxx:578
TObject * First() const override
Return the first object in the list. Returns 0 when list is empty.
Definition TList.cxx:659
Each ROOT method (see TMethod) has a linked list of its arguments.
Definition TMethodArg.h:36
const char * GetFullTypeName() const
Get full type description of method argument, e.g.: "class TDirectory*".
const char * GetDefault() const
Get default value of method argument.
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:307
const char * GetName() const override
Returns name of object.
Definition TNamed.h:47
const char * GetTitle() const override
Returns title of object.
Definition TNamed.h:48
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
Definition TObject.cxx:956
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Definition TObject.cxx:970
Basic string class.
Definition TString.h:139
Ssiz_t Length() const
Definition TString.h:421
TString & Insert(Ssiz_t pos, const char *s)
Definition TString.h:661
Bool_t EndsWith(const char *pat, ECaseCompare cmp=kExact) const
Return true if string ends with the specified string.
Definition TString.cxx:2222
Ssiz_t First(char c) const
Find first occurrence of a character c.
Definition TString.cxx:531
const char * Data() const
Definition TString.h:380
TString & ReplaceAll(const TString &s1, const TString &s2)
Definition TString.h:704
Ssiz_t Last(char c) const
Find last occurrence of a character c.
Definition TString.cxx:924
Bool_t BeginsWith(const char *s, ECaseCompare cmp=kExact) const
Definition TString.h:627
TString & Prepend(const char *cs)
Definition TString.h:673
TString & Remove(Ssiz_t pos)
Definition TString.h:685
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Definition TString.h:636
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
Definition TString.h:651
A zero length substring is legal.
Definition TString.h:85
Ssiz_t Start() const
Definition TString.h:123
Ssiz_t Length() const
Definition TString.h:122
virtual int MakeDirectory(const char *name)
Make a directory.
Definition TSystem.cxx:830
virtual const char * PrependPathName(const char *dir, TString &name)
Concatenate a directory and a file name.
Definition TSystem.cxx:1084
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:1299
virtual const char * BaseName(const char *pathname)
Base name of a file name. Base name of /user/root is root.
Definition TSystem.cxx:937
virtual Bool_t IsAbsoluteFileName(const char *dir)
Return true if dir is an absolute pathname.
Definition TSystem.cxx:954
TVirtualPad is an abstract base class for the Pad and Canvas classes.
Definition TVirtualPad.h:51
virtual void SetBatch(Bool_t batch=kTRUE)=0
void SaveAs(const char *filename="", Option_t *option="") const override=0
Save this object in the file specified by filename.
virtual void Close(Option_t *option="")=0
TLine * line
Definition first.py:1
static const char * what
Definition stlLoader.cc:6