46 ClassImp(TClassDocOutput);
52 TClassDocOutput::TClassDocOutput(THtml& html, TClass* cl, TList* typedefs):
53 TDocOutput(html), fHierarchyLines(0), fCurrentClass(cl),
54 fCurrentClassesTypedefs(typedefs), fParser(0)
56 fParser =
new TDocParser(*
this, fCurrentClass);
62 TClassDocOutput::~TClassDocOutput()
71 void TClassDocOutput::Class2Html(Bool_t force)
73 gROOT->GetListOfGlobals(kTRUE);
76 TString filename(fCurrentClass->GetName());
77 NameSpace2FileName(filename);
79 gSystem->PrependPathName(fHtml->GetOutputDir(), filename);
83 if (!force && !IsModified(fCurrentClass, kSource)
84 && !IsModified(fCurrentClass, kDoc)) {
85 Printf(fHtml->GetCounterFormat(),
"-no change-", fHtml->GetCounter(), filename.Data());
90 std::ofstream classFile(filename);
92 if (!classFile.good()) {
93 Error(
"Make",
"Can't open file '%s' !", filename.Data());
97 Printf(fHtml->GetCounterFormat(),
"", fHtml->GetCounter(), filename.Data());
100 WriteHtmlHeader(classFile, fCurrentClass->GetName(),
"", fCurrentClass);
101 WriteClassDocHeader(classFile);
105 if (fHtml->GetDeclFileName(fCurrentClass, kTRUE, declf))
109 fParser->Parse(classFile);
112 WriteHtmlFooter(classFile,
"",
113 fParser->GetSourceInfo(TDocParser::kInfoLastUpdate),
114 fParser->GetSourceInfo(TDocParser::kInfoAuthor),
115 fParser->GetSourceInfo(TDocParser::kInfoCopyright));
121 void TClassDocOutput::ListFunctions(std::ostream& classFile)
125 classFile << std::endl <<
"<div id=\"functions\">" << std::endl;
126 TString mangled(fCurrentClass->GetName());
127 NameSpace2FileName(mangled);
128 classFile <<
"<h2><a id=\"" << mangled
129 <<
":Function_Members\"></a>Function Members (Methods)</h2>" << std::endl;
131 const char* tab4nbsp=
" ";
133 fHtml->GetDeclFileName(fCurrentClass, kFALSE, declFile);
134 if (fCurrentClass->Property() & kIsAbstract)
135 classFile <<
" <br /><b>"
136 << tab4nbsp <<
"This is an abstract class, constructors will not be documented.<br />" << std::endl
137 << tab4nbsp <<
"Look at the <a href=\""
138 << gSystem->BaseName(declFile)
139 <<
"\">header</a> to check for available constructors.</b><br />" << std::endl;
142 if (fHtml->IsNamespace(fCurrentClass))
143 minAccess = TDocParser::kPublic;
144 for (Int_t access = TDocParser::kPublic; access >= minAccess; --access) {
146 const TList* methods = fParser->GetMethods((TDocParser::EAccess)access);
147 if (methods->GetEntries() == 0)
150 classFile <<
"<div class=\"access\" ";
151 const char* accessID [] = {
"priv",
"prot",
"publ"};
152 const char* accesstxt[] = {
"private",
"protected",
"public"};
154 classFile <<
"id=\"func" << accessID[access] <<
"\"><b>"
155 << accesstxt[access] <<
":</b>" << std::endl
156 <<
"<table class=\"func\" id=\"tabfunc" << accessID[access] <<
"\" cellspacing=\"0\">" << std::endl;
158 TIter iMethWrap(methods);
159 TDocMethodWrapper *methWrap = 0;
160 while ((methWrap = (TDocMethodWrapper*) iMethWrap())) {
161 const TMethod* method = methWrap->GetMethod();
164 Bool_t isctor = (!strcmp(method->GetName(), method->GetReturnTypeName()));
166 Bool_t isdtor = (!isctor && method->GetName()[0] ==
'~');
168 classFile <<
"<tr class=\"func";
169 if (method->GetClass() != fCurrentClass)
171 classFile <<
"\"><td class=\"funcret\">";
172 if (kIsVirtual & method->Property()) {
174 classFile <<
"virtual ";
176 classFile <<
" virtual";
179 if (kIsStatic & method->Property())
180 classFile <<
"static ";
182 if (!isctor && !isdtor)
183 fParser->DecorateKeywords(classFile, method->GetReturnTypeName());
185 TString mangledM(method->GetClass()->GetName());
186 NameSpace2FileName(mangledM);
187 classFile <<
"</td><td class=\"funcname\"><a class=\"funcname\" href=\"";
188 if (method->GetClass() != fCurrentClass) {
190 fHtml->GetHtmlFileName(method->GetClass(), htmlFile);
191 classFile << htmlFile;
193 classFile <<
"#" << mangledM;
195 mangledM = method->GetName();
196 NameSpace2FileName(mangledM);
197 Int_t overloadIdx = methWrap->GetOverloadIdx();
200 mangledM += overloadIdx;
202 classFile << mangledM <<
"\">";
203 if (method->GetClass() != fCurrentClass) {
204 classFile <<
"<span class=\"baseclass\">";
205 ReplaceSpecialChars(classFile, method->GetClass()->GetName());
206 classFile <<
"::</span>";
208 ReplaceSpecialChars(classFile, method->GetName());
211 fParser->DecorateKeywords(classFile, const_cast<TMethod*>(method)->GetSignature());
212 bool propSignal =
false;
213 bool propMenu =
false;
214 bool propToggle =
false;
215 bool propGetter =
false;
216 if (method->GetTitle()) {
217 propSignal = (strstr(method->GetTitle(),
"*SIGNAL*"));
218 propMenu = (strstr(method->GetTitle(),
"*MENU*"));
219 propToggle = (strstr(method->GetTitle(),
"*TOGGLE*"));
220 propGetter = (strstr(method->GetTitle(),
"*GETTER"));
221 if (propSignal || propMenu || propToggle || propGetter) {
222 classFile <<
"<span class=\"funcprop\">";
223 if (propSignal) classFile <<
"<abbr title=\"emits a signal\">SIGNAL</abbr> ";
224 if (propMenu) classFile <<
"<abbr title=\"has a popup menu entry\">MENU</abbr> ";
225 if (propToggle) classFile <<
"<abbr title=\"toggles a state\">TOGGLE</abbr> ";
227 TString getter(method->GetTitle());
228 Ssiz_t posGetter = getter.Index(
"*GETTER=");
229 getter.Remove(0, posGetter + 8);
230 classFile <<
"<abbr title=\"use " + getter +
"() as getter\">GETTER</abbr> ";
232 classFile <<
"</span>";
235 classFile <<
"</td></tr>" << std::endl;
237 classFile << std::endl <<
"</table></div>" << std::endl;
240 classFile <<
"</div>" << std::endl;
246 void TClassDocOutput::ListDataMembers(std::ostream& classFile)
249 Bool_t haveDataMembers = (fParser->GetDataMembers(TDocParser::kPrivate)->GetEntries() ||
250 fParser->GetDataMembers(TDocParser::kProtected)->GetEntries() ||
251 fParser->GetDataMembers(TDocParser::kPublic)->GetEntries() ||
252 fParser->GetEnums(TDocParser::kPublic)->GetEntries() ||
253 fParser->GetEnums(TDocParser::kProtected)->GetEntries() ||
254 fParser->GetEnums(TDocParser::kPrivate)->GetEntries());
256 if (!haveDataMembers)
return;
258 classFile << std::endl <<
"<div id=\"datamembers\">" << std::endl;
259 TString mangled(fCurrentClass->GetName());
260 NameSpace2FileName(mangled);
261 classFile <<
"<h2><a name=\"" << mangled
262 <<
":Data_Members\"></a>Data Members</h2>" << std::endl;
264 for (Int_t access = 5; access >= 0 && !fHtml->IsNamespace(fCurrentClass); --access) {
265 const TList* datamembers = 0;
266 if (access > 2) datamembers = fParser->GetEnums((TDocParser::EAccess) (access - 3));
267 else datamembers = fParser->GetDataMembers((TDocParser::EAccess) access);
268 if (datamembers->GetEntries() == 0)
271 classFile <<
"<div class=\"access\" ";
272 const char* what =
"data";
273 if (access > 2) what =
"enum";
274 const char* accessID [] = {
"priv",
"prot",
"publ"};
275 const char* accesstxt[] = {
"private",
"protected",
"public"};
277 classFile <<
"id=\"" << what << accessID[access%3] <<
"\"><b>"
278 << accesstxt[access%3] <<
":</b>" << std::endl
279 <<
"<table class=\"data\" id=\"tab" << what << accessID[access%3] <<
"\" cellspacing=\"0\">" << std::endl;
281 TIter iDM(datamembers);
282 TDataMember *member = 0;
283 TString prevEnumName;
284 Bool_t prevIsInh = kTRUE;
286 while ((member = (TDataMember*) iDM())) {
287 Bool_t haveNewEnum = access > 2 && prevEnumName != member->GetTypeName();
289 if (prevEnumName.Length()) {
290 classFile <<
"<tr class=\"data";
293 classFile <<
"\"><td class=\"datatype\">};</td><td></td><td></td></tr>" << std::endl;
295 prevEnumName = member->GetTypeName();
298 classFile <<
"<tr class=\"data";
299 prevIsInh = (member->GetClass() != fCurrentClass);
302 classFile <<
"\"><td class=\"datatype\">";
304 TString enumName(member->GetTypeName());
305 TString myScope(fCurrentClass->GetName());
307 enumName.ReplaceAll(myScope,
"");
308 if (enumName.EndsWith(
"::"))
309 enumName +=
"<i>[unnamed]</i>";
310 Ssiz_t startClassName = 0;
311 if (!enumName.BeginsWith(
"enum "))
312 classFile <<
"enum ";
316 Ssiz_t endClassName = enumName.Last(
':');
317 if (endClassName != kNPOS && endClassName > 0 && enumName[endClassName - 1] ==
':') {
319 TSubString substr(enumName(startClassName, endClassName - startClassName + 1));
322 enumName.Insert(substr.Start() + substr.Length(),
"</span>");
323 enumName.Insert(substr.Start(),
"<span class=\"baseclass\">");
325 classFile << enumName <<
" { ";
328 if (member->Property() & kIsStatic)
329 classFile <<
"static ";
330 std::string shortTypeName(fHtml->ShortType(member->GetFullTypeName()));
331 fParser->DecorateKeywords(classFile, shortTypeName.c_str());
334 TString mangledM(member->GetClass()->GetName());
335 NameSpace2FileName(mangledM);
336 classFile <<
"</td><td class=\"dataname\"><a ";
337 if (member->GetClass() != fCurrentClass) {
338 classFile <<
"href=\"";
340 fHtml->GetHtmlFileName(member->GetClass(), htmlFile);
341 classFile << htmlFile <<
"#";
343 classFile <<
"name=\"";
344 classFile << mangledM;
346 mangledM = member->GetName();
347 NameSpace2FileName(mangledM);
348 classFile << mangledM <<
"\">";
349 if (member->GetClass() == fCurrentClass)
351 if (access < 3 && member->GetClass() != fCurrentClass) {
352 classFile <<
"<span class=\"baseclass\">";
353 ReplaceSpecialChars(classFile, member->GetClass()->GetName());
354 classFile <<
"::</span>";
356 ReplaceSpecialChars(classFile, member->GetName());
359 for (Int_t indx = 0; indx < member->GetArrayDim(); ++indx)
360 if (member->GetMaxIndex(indx) <= 0)
363 classFile <<
"[" << member->GetMaxIndex(indx) <<
"]";
365 if (member->GetClass() != fCurrentClass)
367 classFile <<
"</td>";
368 if (member->GetTitle() && member->GetTitle()[0]) {
369 classFile <<
"<td class=\"datadesc\">";
370 ReplaceSpecialChars(classFile, member->GetTitle());
371 }
else classFile <<
"<td>";
372 classFile <<
"</td></tr>" << std::endl;
375 if (prevEnumName.Length()) {
376 classFile <<
"<tr class=\"data";
379 classFile <<
"\"><td class=\"datatype\">};</td><td></td><td></td></tr>" << std::endl;
381 classFile << std::endl <<
"</table></div>" << std::endl;
384 classFile <<
"</div>" << std::endl;
394 Bool_t TClassDocOutput::ClassDotCharts(std::ostream& out)
396 if (!fHtml->HaveDot())
399 TString title(fCurrentClass->GetName());
400 NameSpace2FileName(title);
403 gSystem->PrependPathName(fHtml->GetOutputDir(), dir);
404 gSystem->MakeDirectory(dir);
407 gSystem->PrependPathName(fHtml->GetOutputDir(), dir);
408 gSystem->MakeDirectory(dir);
411 gSystem->PrependPathName(fHtml->GetOutputDir(), dir);
412 gSystem->MakeDirectory(dir);
415 gSystem->PrependPathName(fHtml->GetOutputDir(), dir);
416 gSystem->MakeDirectory(dir);
418 TString filenameInh(title);
419 gSystem->PrependPathName(
"inh", filenameInh);
420 gSystem->PrependPathName(fHtml->GetOutputDir(), filenameInh);
421 filenameInh +=
"_Inh";
422 if (!CreateDotClassChartInh(filenameInh +
".dot") || !RunDot(filenameInh, &out))
425 TString filenameInhMem(title);
426 gSystem->PrependPathName(
"inhmem", filenameInhMem);
427 gSystem->PrependPathName(fHtml->GetOutputDir(), filenameInhMem);
428 filenameInhMem +=
"_InhMem";
429 if (CreateDotClassChartInhMem(filenameInhMem +
".dot"))
430 RunDot(filenameInhMem, &out);
432 TString filenameIncl(title);
433 gSystem->PrependPathName(
"incl", filenameIncl);
434 gSystem->PrependPathName(fHtml->GetOutputDir(), filenameIncl);
435 filenameIncl +=
"_Incl";
436 if (CreateDotClassChartIncl(filenameIncl +
".dot"))
437 RunDot(filenameIncl, &out);
439 TString filenameLib(title);
440 gSystem->PrependPathName(
"lib", filenameLib);
441 gSystem->PrependPathName(fHtml->GetOutputDir(), filenameLib);
442 filenameLib +=
"_Lib";
443 if (CreateDotClassChartLib(filenameLib +
".dot"))
444 RunDot(filenameLib, &out);
446 out <<
"<div class=\"tabs\">" << std::endl
447 <<
"<a id=\"img" << title <<
"_Inh\" class=\"tabsel\" href=\"inh/" << title <<
"_Inh.png\" onclick=\"javascript:return SetImg('Charts','inh/" << title <<
"_Inh.png');\">Inheritance</a>" << std::endl
448 <<
"<a id=\"img" << title <<
"_InhMem\" class=\"tab\" href=\"inhmem/" << title <<
"_InhMem.png\" onclick=\"javascript:return SetImg('Charts','inhmem/" << title <<
"_InhMem.png');\">Inherited Members</a>" << std::endl
449 <<
"<a id=\"img" << title <<
"_Incl\" class=\"tab\" href=\"incl/" << title <<
"_Incl.png\" onclick=\"javascript:return SetImg('Charts','incl/" << title <<
"_Incl.png');\">Includes</a>" << std::endl
450 <<
"<a id=\"img" << title <<
"_Lib\" class=\"tab\" href=\"lib/" << title <<
"_Lib.png\" onclick=\"javascript:return SetImg('Charts','lib/" << title <<
"_Lib.png');\">Libraries</a><br/>" << std::endl
451 <<
"</div><div class=\"classcharts\"><div class=\"classchartswidth\"></div>" << std::endl
452 <<
"<img id=\"Charts\" alt=\"Class Charts\" class=\"classcharts\" usemap=\"#Map" << title <<
"_Inh\" src=\"inh/" << title <<
"_Inh.png\"/></div>" << std::endl;
467 void TClassDocOutput::ClassHtmlTree(std::ostream& out, TClass * classPtr,
468 ETraverse dir,
int depth)
471 out <<
"<!--INHERITANCE TREE-->" << std::endl;
474 out <<
"<table><tr><td width=\"10%\"></td><td width=\"70%\">"
475 <<
"<a href=\"ClassHierarchy.html\">Inheritance Chart</a>:</td></tr>";
476 out <<
"<tr class=\"inhtree\"><td width=\"10%\"></td><td width=\"70%\">";
478 out <<
"<table class=\"inhtree\"><tr><td>" << std::endl;
479 out <<
"<table width=\"100%\" border=\"0\" ";
480 out <<
"cellpadding =\"0\" cellspacing=\"2\"><tr>" << std::endl;
482 out <<
"<table><tr>";
487 if (dir == kUp || dir == kBoth) {
490 TBaseClass *inheritFrom;
491 TIter nextBase(classPtr->GetListOfBases());
493 UInt_t bgcolor=255-depth*8;
494 Bool_t first = kTRUE;
495 while ((inheritFrom = (TBaseClass *) nextBase())) {
498 out <<
"<td><table><tr>" << std::endl;
501 out <<
"</tr><tr>" << std::endl;
502 out <<
"<td bgcolor=\""
503 << Form(
"#%02x%02x%02x", bgcolor, bgcolor, bgcolor)
504 <<
"\" align=\"right\">" << std::endl;
506 TClass *classInh = fHtml->GetClass((
const char *) inheritFrom->GetName());
508 ClassHtmlTree(out, classInh, kUp, depth+1);
511 << (
const char *) inheritFrom->GetName()
513 out <<
"</td>"<< std::endl;
516 out <<
"</tr></table></td>" << std::endl;
517 out <<
"<td>←</td>";
521 out <<
"<td>" << std::endl;
525 const char *className = classPtr->GetName();
527 fHtml->GetHtmlFileName(classPtr, htmlFile);
528 TString anchor(className);
529 NameSpace2FileName(anchor);
533 out <<
"<center><tt><a name=\"" << anchor;
534 out <<
"\" href=\"" << htmlFile <<
"\">";
535 ReplaceSpecialChars(out, className);
536 out <<
"</a></tt></center>" << std::endl;
538 ReplaceSpecialChars(out, className);
542 if (htmlFile.Length()) {
543 out <<
"<center><big><b><tt><a name=\"" << anchor;
544 out <<
"\" href=\"" << htmlFile <<
"\">";
545 ReplaceSpecialChars(out, className);
546 out <<
"</a></tt></b></big></center>" << std::endl;
548 ReplaceSpecialChars(out, className);
551 out <<
"</td>" << std::endl;
556 if (dir == kDown || dir == kBoth) {
561 out <<
"<td><table><tr>" << std::endl;
563 DescendHierarchy(out,classPtr,10);
565 out <<
"</tr></table>";
566 if (dir==kBoth && fHierarchyLines>=10)
567 out <<
"</td><td align=\"left\"> <a href=\"ClassHierarchy.html\">[more...]</a>";
568 out<<
"</td>" << std::endl;
573 out <<
"</tr></table>" << std::endl;
575 out <<
"</td></tr></table></td></tr></table>"<<std::endl;
587 void TClassDocOutput::ClassTree(TVirtualPad * psCanvas, Bool_t force)
589 if (!psCanvas || !fCurrentClass)
592 TString filename(fCurrentClass->GetName());
593 NameSpace2FileName(filename);
595 gSystem->PrependPathName(fHtml->GetOutputDir(), filename);
598 filename +=
"_Tree.pdf";
600 if (IsModified(fCurrentClass, kTree) || force) {
603 fCurrentClass->Draw(
"same");
604 Int_t saveErrorIgnoreLevel = gErrorIgnoreLevel;
605 gErrorIgnoreLevel = kWarning;
606 psCanvas->SaveAs(filename);
607 gErrorIgnoreLevel = saveErrorIgnoreLevel;
609 Printf(fHtml->GetCounterFormat(),
"-no change-",
"", filename.Data());
618 Bool_t TClassDocOutput::CreateDotClassChartInh(
const char* filename)
620 std::ofstream outdot(filename);
621 outdot <<
"strict digraph G {" << std::endl
622 <<
"rankdir=RL;" << std::endl
623 <<
"ranksep=2;" << std::endl
624 <<
"nodesep=0;" << std::endl
625 <<
"size=\"8,10\";" << std::endl
626 <<
"ratio=auto;" << std::endl
627 <<
"margin=0;" << std::endl
628 <<
"node [shape=plaintext,fontsize=40,width=4,height=0.75];" << std::endl
629 <<
"\"" << fCurrentClass->GetName() <<
"\" [shape=ellipse];" << std::endl;
631 std::stringstream ssDep;
632 std::list<TClass*> writeBasesFor;
633 writeBasesFor.push_back(fCurrentClass);
634 Bool_t haveBases = fCurrentClass->GetListOfBases() &&
635 fCurrentClass->GetListOfBases()->GetSize();
637 outdot <<
"{" << std::endl;
638 while (!writeBasesFor.empty()) {
639 TClass* cl = writeBasesFor.front();
640 writeBasesFor.pop_front();
641 if (cl != fCurrentClass) {
642 outdot <<
" \"" << cl->GetName() <<
"\"";
643 const char* htmlFileName = fHtml->GetHtmlFileName(cl->GetName());
645 outdot <<
" [URL=\"" << htmlFileName <<
"\"]";
646 outdot <<
";" << std::endl;
648 if (cl->GetListOfBases() && cl->GetListOfBases()->GetSize()) {
649 ssDep <<
" \"" << cl->GetName() <<
"\" -> {";
650 TIter iBase(cl->GetListOfBases());
651 TBaseClass* base = 0;
652 while ((base = (TBaseClass*)iBase())) {
653 ssDep <<
" \"" << base->GetName() <<
"\";";
654 writeBasesFor.push_back(base->GetClassPointer());
656 ssDep <<
"}" << std::endl;
659 outdot <<
"}" << std::endl;
662 std::map<TClass*, Int_t> derivesFromMe;
663 std::map<TClass*, unsigned int> entriesPerDerived;
664 std::set<TClass*> wroteNode;
665 wroteNode.insert(fCurrentClass);
666 static const unsigned int maxClassesPerDerived = 20;
667 fHtml->GetDerivedClasses(fCurrentClass, derivesFromMe);
668 outdot <<
"{" << std::endl;
669 for (Int_t level = 1; kTRUE; ++level) {
670 Bool_t levelExists = kFALSE;
671 for (std::map<TClass*, Int_t>::iterator iDerived = derivesFromMe.begin();
672 iDerived != derivesFromMe.end(); ++iDerived) {
673 if (iDerived->second != level)
continue;
675 TIter iBaseOfDerived(iDerived->first->GetListOfBases());
676 TBaseClass* baseDerived = 0;
677 Bool_t writeNode = kFALSE;
678 TClass* writeAndMoreFor = 0;
679 while ((baseDerived = (TBaseClass*) iBaseOfDerived())) {
680 TClass* clBaseDerived = baseDerived->GetClassPointer();
681 if (clBaseDerived->InheritsFrom(fCurrentClass)
682 && wroteNode.find(clBaseDerived) != wroteNode.end()) {
683 unsigned int& count = entriesPerDerived[clBaseDerived];
684 if (count < maxClassesPerDerived) {
686 ssDep <<
"\"" << iDerived->first->GetName() <<
"\" -> \""
687 << clBaseDerived->GetName() <<
"\";" << std::endl;
689 }
else if (count == maxClassesPerDerived) {
690 writeAndMoreFor = clBaseDerived;
691 ssDep <<
"\"...andmore" << clBaseDerived->GetName() <<
"\"-> \""
692 << clBaseDerived->GetName() <<
"\";" << std::endl;
699 wroteNode.insert(iDerived->first);
700 outdot <<
" \"" << iDerived->first->GetName() <<
"\"";
701 const char* htmlFileName = fHtml->GetHtmlFileName(iDerived->first->GetName());
703 outdot <<
" [URL=\"" << htmlFileName <<
"\"]";
704 outdot <<
";" << std::endl;
705 }
else if (writeAndMoreFor) {
706 outdot <<
" \"...andmore" << writeAndMoreFor->GetName()
707 <<
"\" [label=\"...and more\",fontname=\"Times-Italic\",fillcolor=lightgrey,style=filled];" << std::endl;
710 if (!levelExists)
break;
712 outdot <<
"}" << std::endl;
714 outdot << ssDep.str();
716 outdot <<
"}" << std::endl;
726 Bool_t TClassDocOutput::CreateDotClassChartInhMem(
const char* filename) {
727 std::ofstream outdot(filename);
728 outdot <<
"strict digraph G {" << std::endl
729 <<
"ratio=auto;" << std::endl
730 <<
"rankdir=RL;" << std::endl
731 <<
"compound=true;" << std::endl
732 <<
"constraint=false;" << std::endl
733 <<
"ranksep=0.1;" << std::endl
734 <<
"nodesep=0;" << std::endl
735 <<
"margin=0;" << std::endl;
736 outdot <<
" node [style=filled,width=0.7,height=0.15,fixedsize=true,shape=plaintext,fontsize=10];" << std::endl;
738 std::stringstream ssDep;
739 const int numColumns = 3;
741 std::list<TClass*> writeBasesFor;
742 writeBasesFor.push_back(fCurrentClass);
743 while (!writeBasesFor.empty()) {
744 TClass* cl = writeBasesFor.front();
745 writeBasesFor.pop_front();
747 const char* htmlFileName = fHtml->GetHtmlFileName(cl->GetName());
749 outdot <<
"subgraph \"cluster" << cl->GetName() <<
"\" {" << std::endl
750 <<
" color=lightgray;" << std::endl
751 <<
" label=\"" << cl->GetName() <<
"\";" << std::endl;
752 if (cl != fCurrentClass && htmlFileName)
753 outdot <<
" URL=\"" << htmlFileName <<
"\"" << std::endl;
756 Bool_t haveFuncs = cl->GetListOfMethods() && cl->GetListOfMethods()->GetSize();
762 std::map<std::string, TDataMember*> dmMap;
765 TIter iDM(cl->GetListOfDataMembers());
767 while ((dm = (TDataMember*) iDM()))
768 dmMap[dm->GetName()] = dm;
771 outdot <<
"subgraph \"clusterData0" << cl->GetName() <<
"\" {" << std::endl
772 <<
" color=white;" << std::endl
773 <<
" label=\"\";" << std::endl
774 <<
" \"clusterNode0" << cl->GetName() <<
"\" [height=0,width=0,style=invis];" << std::endl;
775 TString prevColumnNode;
776 Int_t pos = dmMap.size();
778 Int_t newColumnEvery = (pos + numColumns - 1) / numColumns;
779 for (std::map<std::string, TDataMember*>::iterator iDM = dmMap.begin();
780 iDM != dmMap.end(); ++iDM, --pos) {
781 TDataMember* dm = iDM->second;
782 TString nodeName(cl->GetName());
784 nodeName += dm->GetName();
785 if (iDM == dmMap.begin())
786 prevColumnNode = nodeName;
788 outdot <<
"\"" << nodeName <<
"\" [label=\""
789 << dm->GetName() <<
"\"";
790 if (dm->Property() & kIsPrivate)
791 outdot <<
",color=\"#FFCCCC\"";
792 else if (dm->Property() & kIsProtected)
793 outdot <<
",color=\"#FFFF77\"";
795 outdot <<
",color=\"#CCFFCC\"";
796 outdot <<
"];" << std::endl;
797 if (pos % newColumnEvery == 1) {
799 outdot <<
"};" << std::endl
800 <<
"subgraph \"clusterData" << column << cl->GetName() <<
"\" {" << std::endl
801 <<
" color=white;" << std::endl
802 <<
" label=\"\";" << std::endl
803 <<
" \"clusterNode" << column << cl->GetName() <<
"\" [height=0,width=0,style=invis];" << std::endl;
804 }
else if (iDM != dmMap.begin() && pos % newColumnEvery == 0) {
805 ssDep <<
"\"" << prevColumnNode
806 <<
"\" -> \"" << nodeName <<
"\""<<
" [style=invis,weight=100];" << std::endl;
807 prevColumnNode = nodeName;
811 while (column < numColumns - 1) {
813 outdot <<
" \"clusterNode" << column << cl->GetName() <<
"\" [height=0,width=0,style=invis];" << std::endl;
816 outdot <<
"};" << std::endl;
822 std::map<std::string, TMethod*> methMap;
825 TIter iMeth(cl->GetListOfMethods());
827 while ((meth = (TMethod*) iMeth()))
828 methMap[meth->GetName()] = meth;
831 outdot <<
"subgraph \"clusterFunc0" << cl->GetName() <<
"\" {" << std::endl
832 <<
" color=white;" << std::endl
833 <<
" label=\"\";" << std::endl
834 <<
" \"clusterNode0" << cl->GetName() <<
"\" [height=0,width=0,style=invis];" << std::endl;
836 TString prevColumnNodeFunc;
837 Int_t pos = methMap.size();
839 Int_t newColumnEvery = (pos + numColumns - 1) / numColumns;
840 for (std::map<std::string, TMethod*>::iterator iMeth = methMap.begin();
841 iMeth != methMap.end(); ++iMeth, --pos) {
842 TMethod* meth = iMeth->second;
843 TString nodeName(cl->GetName());
845 nodeName += meth->GetName();
846 if (iMeth == methMap.begin())
847 prevColumnNodeFunc = nodeName;
849 outdot <<
"\"" << nodeName <<
"\" [label=\"" << meth->GetName() <<
"\"";
850 if (cl != fCurrentClass &&
851 fCurrentClass->GetMethodAny(meth->GetName()))
852 outdot <<
",color=\"#777777\"";
853 else if (meth->Property() & kIsPrivate)
854 outdot <<
",color=\"#FFCCCC\"";
855 else if (meth->Property() & kIsProtected)
856 outdot <<
",color=\"#FFFF77\"";
858 outdot <<
",color=\"#CCFFCC\"";
859 outdot <<
"];" << std::endl;
860 if (pos % newColumnEvery == 1) {
862 outdot <<
"};" << std::endl
863 <<
"subgraph \"clusterFunc" << column << cl->GetName() <<
"\" {" << std::endl
864 <<
" color=white;" << std::endl
865 <<
" label=\"\";" << std::endl;
866 }
else if (iMeth != methMap.begin() && pos % newColumnEvery == 0) {
867 ssDep <<
"\"" << prevColumnNodeFunc
868 <<
"\" -> \"" << nodeName <<
"\""<<
" [style=invis,weight=100];" << std::endl;
869 prevColumnNodeFunc = nodeName;
872 outdot <<
"};" << std::endl;
875 outdot <<
"}" << std::endl;
877 for (Int_t pos = 0; pos < numColumns - 1; ++pos)
878 ssDep <<
"\"clusterNode" << pos << cl->GetName() <<
"\" -> \"clusterNode" << pos + 1 << cl->GetName() <<
"\" [style=invis];" << std::endl;
880 if (cl->GetListOfBases() && cl->GetListOfBases()->GetSize()) {
881 TIter iBase(cl->GetListOfBases());
882 TBaseClass* base = 0;
883 while ((base = (TBaseClass*)iBase())) {
884 ssDep <<
" \"clusterNode" << numColumns - 1 << cl->GetName() <<
"\" -> "
885 <<
" \"clusterNode0" << base->GetName() <<
"\" [ltail=\"cluster" << cl->GetName()
886 <<
"\",lhead=\"cluster" << base->GetName() <<
"\"";
887 if (base != cl->GetListOfBases()->First())
888 ssDep <<
",weight=0";
889 ssDep <<
"];" << std::endl;
890 writeBasesFor.push_back(base->GetClassPointer());
895 outdot << ssDep.str();
897 outdot <<
"}" << std::endl;
908 Bool_t TClassDocOutput::CreateDotClassChartIncl(
const char* filename) {
909 R__LOCKGUARD(GetHtml()->GetMakeClassMutex());
911 std::map<std::string, std::string> filesToParse;
912 std::list<std::string> listFilesToParse;
913 TString declFileName;
914 TString implFileName;
915 fHtml->GetImplFileName(fCurrentClass, kFALSE, implFileName);
916 if (fHtml->GetDeclFileName(fCurrentClass, kFALSE, declFileName)) {
918 if (fHtml->GetDeclFileName(fCurrentClass, kTRUE, real)) {
919 filesToParse[declFileName.Data()] = real.Data();
920 listFilesToParse.push_back(declFileName.Data());
934 std::ofstream outdot(filename);
935 outdot <<
"strict digraph G {" << std::endl
936 <<
"ratio=compress;" << std::endl
937 <<
"rankdir=TB;" << std::endl
938 <<
"concentrate=true;" << std::endl
939 <<
"ranksep=0;" << std::endl
940 <<
"nodesep=0;" << std::endl
941 <<
"size=\"8,10\";" << std::endl
942 <<
"node [fontsize=20,shape=plaintext];" << std::endl;
944 for (std::list<std::string>::iterator iFile = listFilesToParse.begin();
945 iFile != listFilesToParse.end(); ++iFile) {
946 std::ifstream in(filesToParse[*iFile].c_str());
948 while (in && !in.eof()) {
949 std::getline(in, line);
951 while (line[pos] ==
' ' || line[pos] ==
'\t') ++pos;
952 if (line[pos] !=
'#')
continue;
954 while (line[pos] ==
' ' || line[pos] ==
'\t') ++pos;
955 if (line.compare(pos, 8,
"include ") != 0)
continue;
957 while (line[pos] ==
' ' || line[pos] ==
'\t') ++pos;
958 if (line[pos] !=
'"' && line[pos] !=
'<')
960 char delim = line[pos];
961 if (delim ==
'<') delim =
'>';
965 pos = line.find(delim);
966 if (pos == std::string::npos)
continue;
968 if (filesToParse.find(line) == filesToParse.end()) {
970 if (!GetHtml()->GetPathDefinition().GetFileNameFromInclude(line.c_str(), sysfilename))
972 listFilesToParse.push_back(line);
973 filesToParse[line] = sysfilename;
974 if (*iFile == implFileName.Data() || *iFile == declFileName.Data())
975 outdot <<
"\"" << *iFile <<
"\" [style=filled,fillcolor=lightgray];" << std::endl;
977 outdot <<
"\"" << *iFile <<
"\" -> \"" << line <<
"\";" << std::endl;
981 outdot <<
"}" << std::endl;
992 Bool_t TClassDocOutput::CreateDotClassChartLib(
const char* filename) {
993 std::ofstream outdot(filename);
994 outdot <<
"strict digraph G {" << std::endl
995 <<
"ratio=auto;" << std::endl
996 <<
"rankdir=RL;" << std::endl
997 <<
"compound=true;" << std::endl
998 <<
"constraint=false;" << std::endl
999 <<
"ranksep=0.7;" << std::endl
1000 <<
"nodesep=0.3;" << std::endl
1001 <<
"size=\"8,8\";" << std::endl
1002 <<
"ratio=compress;" << std::endl;
1004 TString libs(fCurrentClass->GetSharedLibs());
1005 outdot <<
"\"All Libraries\" [URL=\"LibraryDependencies.html\",shape=box,rank=max,fillcolor=lightgray,style=filled];" << std::endl;
1007 if (libs.Length()) {
1008 TString firstLib(libs);
1009 Ssiz_t end = firstLib.Index(
' ');
1011 firstLib.Remove(end, firstLib.Length());
1012 libs.Remove(0, end + 1);
1016 Ssiz_t posExt = firstLib.First(
".");
1017 if (posExt != kNPOS)
1018 firstLib.Remove(posExt, firstLib.Length());
1021 outdot <<
"\"All Libraries\" -> \"" << firstLib <<
"\" [style=invis];" << std::endl;
1022 outdot <<
"\"" << firstLib <<
"\" -> {" << std::endl;
1024 if (firstLib !=
"libCore")
1026 if (firstLib !=
"libCint")
1029 for (Ssiz_t pos = 0; pos < libs.Length(); ++pos)
1030 if (libs[pos] !=
' ')
1031 thisLib += libs[pos];
1032 else if (thisLib.Length()) {
1033 Ssiz_t posExt = thisLib.First(
".");
1034 if (posExt != kNPOS)
1035 thisLib.Remove(posExt, thisLib.Length());
1036 outdot <<
" \"" << thisLib <<
"\";";
1040 if (thisLib.Length()) {
1041 Ssiz_t posExt = thisLib.First(
".");
1042 if (posExt != kNPOS)
1043 thisLib.Remove(posExt, thisLib.Length());
1044 outdot <<
" \"" << thisLib <<
"\";";
1047 outdot <<
"}" << std::endl;
1049 outdot <<
"\"No rlibmap information available.\"" << std::endl;
1051 outdot <<
"}" << std::endl;
1061 void TClassDocOutput::CreateClassHierarchy(std::ostream& out,
const char* docFileName)
1064 TList *bases = fCurrentClass->GetListOfBases();
1065 if (!bases || bases->IsEmpty())
1068 out <<
"<hr />" << std::endl;
1070 out <<
"<table><tr><td><ul><li><tt>";
1072 out <<
"<a name=\"" << fCurrentClass->GetName() <<
"\" href=\""
1073 << docFileName <<
"\">";
1074 ReplaceSpecialChars(out, fCurrentClass->GetName());
1077 ReplaceSpecialChars(out, fCurrentClass->GetName());
1081 out <<
"</tt></li></ul></td>";
1082 fHierarchyLines = 0;
1083 DescendHierarchy(out, fCurrentClass);
1085 out <<
"</tr></table>" << std::endl;
1095 Bool_t TClassDocOutput::CreateHierarchyDot()
1097 const char* title =
"ClassHierarchy";
1098 TString filename(title);
1099 gSystem->PrependPathName(fHtml->GetOutputDir(), filename);
1102 std::ofstream dotout(filename +
".dot");
1104 if (!dotout.good()) {
1105 Error(
"CreateHierarchy",
"Can't open file '%s.dot' !",
1110 dotout <<
"digraph G {" << std::endl
1111 <<
"ratio=auto;" << std::endl
1112 <<
"rankdir=RL;" << std::endl;
1115 TClassDocInfo* cdi = 0;
1116 TIter iClass(fHtml->GetListOfClasses());
1117 while ((cdi = (TClassDocInfo*)iClass())) {
1119 TDictionary *dict = cdi->GetClass();
1120 TClass *cl =
dynamic_cast<TClass*
>(dict);
1123 Warning(
"THtml::CreateHierarchy",
"skipping class %s\n", cdi->GetName());
1128 TList *bases = cl->GetListOfBases();
1129 if (bases && !bases->IsEmpty()) {
1130 dotout <<
"\"" << cdi->GetName() <<
"\" -> { ";
1132 TBaseClass* base = 0;
1133 while ((base = (TBaseClass*) iBase())) {
1135 if (base != bases->First())
1137 dotout <<
"\"" << base->GetName() <<
"\"";
1139 dotout <<
"};" << std::endl;
1142 dotout <<
"\"" << cdi->GetName() <<
"\";" << std::endl;
1149 std::ofstream out(filename +
".html");
1151 Error(
"CreateHierarchy",
"Can't open file '%s.html' !",
1156 Printf(fHtml->GetCounterFormat(),
"", fHtml->GetCounter(), (filename +
".html").Data());
1158 WriteHtmlHeader(out,
"Class Hierarchy");
1159 out <<
"<h1>Class Hierarchy</h1>" << std::endl;
1163 RunDot(filename, &out);
1165 out <<
"<img usemap=\"#Map" << title <<
"\" src=\"" << title <<
".png\"/>" << std::endl;
1167 WriteHtmlFooter(out);
1175 void TClassDocOutput::CreateSourceOutputStream(std::ostream& out,
const char* extension,
1176 TString& sourceHtmlFileName)
1178 TString sourceHtmlDir(
"src");
1179 gSystem->PrependPathName(fHtml->GetOutputDir(), sourceHtmlDir);
1182 R__LOCKGUARD(GetHtml()->GetMakeClassMutex());
1184 if (gSystem->AccessPathName(sourceHtmlDir))
1185 gSystem->MakeDirectory(sourceHtmlDir);
1187 sourceHtmlFileName = fCurrentClass->GetName();
1188 NameSpace2FileName(sourceHtmlFileName);
1189 gSystem->PrependPathName(sourceHtmlDir, sourceHtmlFileName);
1190 sourceHtmlFileName += extension;
1191 dynamic_cast<std::ofstream&
>(out).open(sourceHtmlFileName);
1193 Warning(
"LocateMethodsInSource",
"Can't open beautified source file '%s' for writing!",
1194 sourceHtmlFileName.Data());
1195 sourceHtmlFileName.Remove(0);
1200 TString title(fCurrentClass->GetName());
1201 title +=
" - source file";
1202 WriteHtmlHeader(out, title,
"../", fCurrentClass);
1203 out <<
"<div id=\"codeAndLineNumbers\"><pre class=\"listing\">" << std::endl;
1210 void TClassDocOutput::DescendHierarchy(std::ostream& out, TClass* basePtr, Int_t maxLines, Int_t depth)
1213 if (fHierarchyLines >= maxLines) {
1214 out <<
"<td></td>" << std::endl;
1218 UInt_t numClasses = 0;
1220 TClassDocInfo* cdi = 0;
1221 TIter iClass(fHtml->GetListOfClasses());
1222 while ((cdi = (TClassDocInfo*)iClass()) && (!maxLines || fHierarchyLines<maxLines)) {
1224 TClass *classPtr =
dynamic_cast<TClass*
>(cdi->GetClass());
1225 if (!classPtr)
continue;
1228 TList* bases=classPtr->GetListOfBases();
1229 if (!bases)
continue;
1231 TBaseClass *inheritFrom=(TBaseClass*)bases->FindObject(basePtr->GetName());
1232 if (!inheritFrom)
continue;
1235 out <<
"<td>←</td><td><table><tr>" << std::endl;
1237 out <<
"</tr><tr>"<<std::endl;
1240 UInt_t bgcolor=255-depth*8;
1241 out <<
"<td bgcolor=\""
1242 << Form(
"#%02x%02x%02x", bgcolor, bgcolor, bgcolor)
1244 out <<
"<table><tr><td>" << std::endl;
1246 TString htmlFile(cdi->GetHtmlFileName());
1247 if (htmlFile.Length()) {
1248 out <<
"<center><tt><a name=\"" << cdi->GetName() <<
"\" href=\""
1249 << htmlFile <<
"\">";
1250 ReplaceSpecialChars(out, cdi->GetName());
1251 out <<
"</a></tt></center>";
1253 ReplaceSpecialChars(out, cdi->GetName());
1270 out <<
"</td>" << std::endl;
1271 DescendHierarchy(out,classPtr,maxLines, depth+1);
1272 out <<
"</tr></table></td>" << std::endl;
1276 out <<
"</tr></table></td>" << std::endl;
1278 out <<
"<td></td>" << std::endl;
1287 void TClassDocOutput::MakeTree(Bool_t force )
1290 if (!fCurrentClass || fHtml->HaveDot())
1294 fHtml->GetHtmlFileName(fCurrentClass, htmlFile);
1295 if (htmlFile.Length()
1296 && (htmlFile.BeginsWith(
"http://")
1297 || htmlFile.BeginsWith(
"https://")
1298 || gSystem->IsAbsoluteFileName(htmlFile))
1303 if (!htmlFile.Length()) {
1304 TString what(fCurrentClass->GetName());
1305 what +=
" (source not found)";
1306 Printf(fHtml->GetCounterFormat(),
"-skipped-",
"", what.Data());
1310 R__LOCKGUARD(GetHtml()->GetMakeClassMutex());
1313 Bool_t wasBatch = gROOT->IsBatch();
1316 TVirtualPad *psCanvas = (TVirtualPad*)gROOT->ProcessLineFast(
"new TCanvas(\"R__THtml\",\"psCanvas\",0,0,1000,1200);");
1318 gROOT->SetBatch(kFALSE);
1321 Error(
"MakeTree",
"Cannot create a TCanvas!");
1326 ClassTree(psCanvas, force);
1340 void TClassDocOutput::WriteClassDescription(std::ostream& out,
const TString& description)
1343 out <<
"<div class=\"dropshadow\"><div class=\"withshadow\">";
1344 TString anchor(fCurrentClass->GetName());
1345 NameSpace2FileName(anchor);
1346 out <<
"<h1><a name=\"" << anchor;
1347 out <<
":description\"></a>";
1349 if (fHtml->IsNamespace(fCurrentClass))
1350 out <<
"namespace ";
1353 ReplaceSpecialChars(out, fCurrentClass->GetName());
1357 Bool_t first = kTRUE;
1358 TBaseClass *inheritFrom;
1359 TIter nextBase(fCurrentClass->GetListOfBases());
1361 while ((inheritFrom = (TBaseClass *) nextBase())) {
1367 Long_t
property = inheritFrom->Property();
1368 if (property & kIsPrivate)
1370 else if (property & kIsProtected)
1371 out <<
"protected ";
1376 TClass *classInh = fHtml->GetClass(inheritFrom->GetName());
1379 fHtml->GetHtmlFileName(classInh, htmlFile);
1381 if (htmlFile.Length()) {
1383 out <<
"<a href=\"" << htmlFile <<
"\">";
1384 ReplaceSpecialChars(out, inheritFrom->GetName());
1387 ReplaceSpecialChars(out, inheritFrom->GetName());
1389 out <<
"</h1>" << std::endl;
1391 out <<
"<div class=\"classdescr\">" << std::endl;
1393 if (description.Length())
1394 out <<
"<pre>" << description <<
"</pre>";
1397 if (fCurrentClassesTypedefs && !fCurrentClassesTypedefs->IsEmpty()) {
1398 out <<
"<h4>This class is also known as (typedefs to this class)</h4>";
1399 TIter iTD(fCurrentClassesTypedefs);
1400 bool firsttd =
true;
1402 while ((dt = (TDataType*) iTD())) {
1405 else firsttd =
false;
1406 fParser->DecorateKeywords(out, dt->GetName());
1410 out <<
"</div>" << std::endl
1411 <<
"</div></div>" << std::endl;
1414 ListDataMembers(out);
1417 out <<
"<h2><a id=\"" << anchor
1418 <<
":Class_Charts\"></a>Class Charts</h2>" << std::endl;
1419 if (!fHtml->IsNamespace(fCurrentClass))
1420 if (!ClassDotCharts(out))
1421 ClassHtmlTree(out, fCurrentClass);
1424 out <<
"<h2>Function documentation</h2>" << std::endl;
1431 void TClassDocOutput::WriteClassDocHeader(std::ostream& classFile)
1433 classFile <<
"<a name=\"TopOfPage\"></a>" << std::endl;
1438 TString sTitle(fCurrentClass->GetName());
1439 ReplaceSpecialChars(sTitle);
1440 if (fHtml->IsNamespace(fCurrentClass))
1441 sTitle.Prepend(
"namespace ");
1443 sTitle.Prepend(
"class ");
1447 const char* lib=fCurrentClass->GetSharedLibs();
1448 GetHtml()->GetPathDefinition().GetIncludeAs(fCurrentClass, sInclude);
1450 char* libDup=StrDup(lib);
1451 char* libDupSpace=strchr(libDup,
' ');
1452 if (libDupSpace) *libDupSpace=0;
1453 char* libDupEnd=libDup+strlen(libDup);
1454 while (libDupEnd!=libDup)
1455 if (*(--libDupEnd)==
'.') {
1462 classFile <<
"<script type=\"text/javascript\">WriteFollowPageBox('"
1463 << sTitle <<
"','" << sLib <<
"','" << sInclude <<
"');</script>" << std::endl;
1466 fHtml->GetModuleNameForClass(modulename, fCurrentClass);
1467 TModuleDocInfo* module = (TModuleDocInfo*) fHtml->GetListOfModules()->FindObject(modulename);
1468 WriteTopLinks(classFile, module, fCurrentClass->GetName(), kFALSE);
1470 classFile <<
"<div class=\"descrhead\"><div class=\"descrheadcontent\">" << std::endl
1471 <<
"<span class=\"descrtitle\">Source:</span>" << std::endl;
1474 TString classFileName(fCurrentClass->GetName());
1475 NameSpace2FileName(classFileName);
1477 TString headerFileName;
1478 fHtml->GetDeclFileName(fCurrentClass, kFALSE, headerFileName);
1479 TString sourceFileName;
1480 fHtml->GetImplFileName(fCurrentClass, kFALSE, sourceFileName);
1481 if (headerFileName.Length())
1482 classFile <<
"<a class=\"descrheadentry\" href=\"src/" << classFileName
1483 <<
".h.html\">header file</a>" << std::endl;
1485 classFile <<
"<a class=\"descrheadentry\"> </a>" << std::endl;
1487 if (sourceFileName.Length())
1488 classFile <<
"<a class=\"descrheadentry\" href=\"src/" << classFileName
1489 <<
".cxx.html\">source file</a>" << std::endl;
1491 classFile <<
"<a class=\"descrheadentry\"> </a>" << std::endl;
1493 if (!fHtml->IsNamespace(fCurrentClass) && !fHtml->HaveDot()) {
1495 classFile <<
"<a class=\"descrheadentry\" href=\"" << classFileName <<
"_Tree.pdf\"";
1496 classFile <<
">inheritance tree (.pdf)</a> ";
1499 const TString& viewCVSLink = GetHtml()->GetViewCVS();
1500 Bool_t mustReplace = viewCVSLink.Contains(
"%f");
1501 if (viewCVSLink.Length()) {
1502 if (headerFileName.Length()) {
1503 TString link(viewCVSLink);
1504 TString sHeader(headerFileName);
1505 if (GetHtml()->GetProductName() && !strcmp(GetHtml()->GetProductName(),
"ROOT")) {
1506 Ssiz_t posInclude = sHeader.Index(
"/include/");
1507 if (posInclude != kNPOS) {
1509 sHeader.Remove(0, posInclude + 8);
1512 posInclude = sHeader.Index(
"/inc/");
1513 if (posInclude != kNPOS) {
1515 sHeader += sInclude;
1518 if (sourceFileName && strstr(sourceFileName,
"src")) {
1519 TString src(sourceFileName);
1520 src.Remove(src.Index(
"src"), src.Length());
1522 sHeader.Prepend(src);
1524 TString src(fCurrentClass->GetSharedLibs());
1525 Ssiz_t posEndLib = src.Index(
' ');
1526 if (posEndLib != kNPOS)
1527 src.Remove(posEndLib, src.Length());
1528 if (src.BeginsWith(
"lib"))
1530 posEndLib = src.Index(
'.');
1531 if (posEndLib != kNPOS)
1532 src.Remove(posEndLib, src.Length());
1535 sHeader.Prepend(src);
1537 if (sHeader.BeginsWith(
"tmva/inc/TMVA"))
1538 sHeader.Remove(8, 5);
1540 if (mustReplace) link.ReplaceAll(
"%f", sHeader);
1541 else link += sHeader;
1542 classFile <<
"<a class=\"descrheadentry\" href=\"" << link <<
"\">viewVC header</a> ";
1544 classFile <<
"<a class=\"descrheadentry\"> </a> ";
1545 if (sourceFileName.Length()) {
1546 TString link(viewCVSLink);
1547 if (mustReplace) link.ReplaceAll(
"%f", sourceFileName);
1548 else link += sourceFileName;
1549 classFile <<
"<a class=\"descrheadentry\" href=\"" << link <<
"\">viewVC source</a> ";
1551 classFile <<
"<a class=\"descrheadentry\"> </a> ";
1554 TString currClassNameMangled(fCurrentClass->GetName());
1555 NameSpace2FileName(currClassNameMangled);
1557 TString wikiLink = GetHtml()->GetWikiURL();
1558 if (wikiLink.Length()) {
1559 if (wikiLink.Contains(
"%c")) wikiLink.ReplaceAll(
"%c", currClassNameMangled);
1560 else wikiLink += currClassNameMangled;
1561 classFile <<
"<a class=\"descrheadentry\" href=\"" << wikiLink <<
"\">wiki</a> ";
1564 classFile << std::endl <<
"</div></div>" << std::endl;
1566 classFile <<
"<div class=\"descrhead\"><div class=\"descrheadcontent\">" << std::endl
1567 <<
"<span class=\"descrtitle\">Sections:</span>" << std::endl
1568 <<
"<a class=\"descrheadentry\" href=\"#" << currClassNameMangled;
1569 if (fHtml->IsNamespace(fCurrentClass))
1570 classFile <<
":description\">namespace description</a> ";
1572 classFile <<
":description\">class description</a> ";
1573 classFile << std::endl
1574 <<
"<a class=\"descrheadentry\" href=\"#" << currClassNameMangled <<
":Function_Members\">function members</a>" << std::endl
1575 <<
"<a class=\"descrheadentry\" href=\"#" << currClassNameMangled <<
":Data_Members\">data members</a>" << std::endl
1576 <<
"<a class=\"descrheadentry\" href=\"#" << currClassNameMangled <<
":Class_Charts\">class charts</a>" << std::endl
1577 <<
"</div></div>" << std::endl
1578 <<
"</div>" << std::endl;
1580 WriteLocation(classFile, module, fCurrentClass->GetName());
1591 void TClassDocOutput::WriteMethod(std::ostream& out, TString& ret,
1592 TString& name, TString& params,
1593 const char* filename, TString& anchor,
1594 TString& comment, TString& codeOneLiner,
1595 TDocMethodWrapper* guessedMethod)
1597 fParser->DecorateKeywords(ret);
1598 out <<
"<div class=\"funcdoc\"><span class=\"funcname\">"
1599 << ret <<
" <a class=\"funcname\" name=\"";
1600 TString mangled(fCurrentClass->GetName());
1601 NameSpace2FileName(mangled);
1602 out << mangled <<
":";
1604 NameSpace2FileName(mangled);
1605 if (guessedMethod && guessedMethod->GetOverloadIdx()) {
1607 mangled += guessedMethod->GetOverloadIdx();
1609 out << mangled <<
"\" href=\"src/" << filename;
1610 if (anchor.Length())
1611 out <<
"#" << anchor;
1613 ReplaceSpecialChars(out, name);
1615 if (guessedMethod) {
1618 TIter iParam(guessedMethod->GetMethod()->GetListOfMethodArgs());
1619 Bool_t first = kTRUE;
1620 while ((arg = (TMethodArg*) iParam())) {
1621 if (!first) out <<
", ";
1622 else first = kFALSE;
1623 TString paramGuessed(arg->GetFullTypeName());
1624 paramGuessed +=
" ";
1625 paramGuessed += arg->GetName();
1626 if (arg->GetDefault() && strlen(arg->GetDefault())) {
1627 paramGuessed +=
" = ";
1628 paramGuessed += arg->GetDefault();
1630 fParser->DecorateKeywords(paramGuessed);
1631 out << paramGuessed;
1634 if (guessedMethod->GetMethod()->Property() & kIsConstMethod)
1637 fParser->DecorateKeywords(params);
1640 out <<
"</span><br />" << std::endl;
1642 if (comment.Length())
1643 out <<
"<div class=\"funccomm\"><pre>" << comment <<
"</pre></div>" << std::endl;
1645 if (codeOneLiner.Length()) {
1646 out << std::endl <<
"<div class=\"code\"><code class=\"inlinecode\">"
1647 << codeOneLiner <<
"</code></div>" << std::endl
1648 <<
"<div style=\"clear:both;\"></div>" << std::endl;
1649 codeOneLiner.Remove(0);
1651 out <<
"</div>" << std::endl;