ROOT  6.06/09
Reference Guide
TDocOutput.h
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 #ifndef ROOT_TDocOutput
13 #define ROOT_TDocOutput
14 
15 
16 ////////////////////////////////////////////////////////////////////////////
17 // //
18 // ROOT_TDocOutput //
19 // //
20 // Generates documentation output using XHTML 1.0 transitional //
21 // //
22 ////////////////////////////////////////////////////////////////////////////
23 
24 #ifndef ROOT_TObject
25 #include "TObject.h"
26 #endif
27 #ifndef ROOT_Riosfwd
28 #include "Riosfwd.h"
29 #endif
30 #ifndef ROOT_TDocParser
31 #include "TDocParser.h"
32 #endif
33 
34 class TClass;
35 class TDataMember;
36 class TDataType;
37 class TGClient;
38 class THtml;
39 class TModuleDocInfo;
40 class TString;
41 class TSubString;
42 class TVirtualPad;
43 
44 class TDocOutput: public TObject {
45 protected:
51  };
52 
53  THtml* fHtml; // THtml object we belong to
54 
55  int CaseInsensitiveSort(const void *name1, const void *name2);
56  void AddLink(TSubString& str, TString& link, const char* comment);
57  void ProcessDocInDir(std::ostream& out, const char* indir, const char* outdir, const char* linkdir);
58  Bool_t RunDot(const char* filename, std::ostream* outMap = 0, EGraphvizTool gvwhat = kDot);
59  void WriteHtmlHeader(std::ostream& out, const char *titleNoSpecial,
60  const char* dir /*=""*/, TClass *cls /*=0*/,
61  const char* header);
62  void WriteHtmlFooter(std::ostream& out, const char *dir,
63  const char *lastUpdate, const char *author,
64  const char *copyright, const char* footer);
65  virtual void WriteSearch(std::ostream& out);
66  void WriteLocation(std::ostream& out, TModuleDocInfo* module, const char* classname = 0);
67  void WriteModuleLinks(std::ostream& out);
68  void WriteModuleLinks(std::ostream& out, TModuleDocInfo* super);
69  void WriteTopLinks(std::ostream& out, TModuleDocInfo* module, const char* classname = 0, Bool_t withLocation = kTRUE);
70 
71 public:
73 
74  TDocOutput(THtml& html);
75  virtual ~TDocOutput();
76 
77  virtual void AdjustSourcePath(TString& line, const char* relpath = "../");
78  void Convert(std::istream& in, const char* infilename,
79  const char* outfilename, const char *title,
80  const char *relpath = "../",
81  Int_t includeOutput = 0,
82  const char* context = "",
83  TGClient* gclient = 0);
84  Bool_t CopyHtmlFile(const char *sourceName, const char *destName="");
85 
86  virtual void CreateClassIndex();
87  virtual void CreateModuleIndex();
88  virtual void CreateProductIndex();
89  virtual void CreateTypeIndex();
90  virtual void CreateClassTypeDefs();
91  virtual void CreateHierarchy();
92 
95  virtual void FixupAuthorSourceInfo(TString& authors);
96  const char* GetExtension() const { return ".html"; }
97  THtml* GetHtml() { return fHtml; }
98  virtual Bool_t IsModified(TClass *classPtr, EFileType type);
99  virtual void NameSpace2FileName(TString &name);
100 
101  virtual void ReferenceEntity(TSubString& str, TClass* entity, const char* comment = 0);
102  virtual void ReferenceEntity(TSubString& str, TDataMember* entity, const char* comment = 0);
103  virtual void ReferenceEntity(TSubString& str, TDataType* entity, const char* comment = 0);
104  virtual void ReferenceEntity(TSubString& str, TMethod* entity, const char* comment = 0);
105  virtual Bool_t ReferenceIsRelative(const char* reference) const;
106 
107  virtual const char* ReplaceSpecialChars(char c);
108  void ReplaceSpecialChars(std::ostream &out, const char *string);
110  void ReplaceSpecialChars(TString& text, Ssiz_t &pos);
111 
112  virtual void WriteHtmlHeader(std::ostream &out, const char *title, const char* dir="", TClass *cls=0);
113  virtual void WriteHtmlFooter(std::ostream &out, const char *dir="", const char *lastUpdate="",
114  const char *author="", const char *copyright="");
115  void WriteLineNumbers(std::ostream& out, Long_t nLines, const TString& infileBase) const;
116 
117  ClassDef(TDocOutput, 0); // generates documentation web pages
118 };
119 
120 #endif // ROOT_TDocOutput
A zero length substring is legal.
Definition: TString.h:83
TDocOutput(THtml &html)
Definition: TDocOutput.cxx:256
virtual void CreateProductIndex()
Fetch documentation from THtml::GetProductDocDir() and put it into the product index page...
virtual void CreateTypeIndex()
Create index of all data types.
TLine * line
static const std::string comment("comment")
All ROOT classes may have RTTI (run time type identification) support added.
Definition: TDataMember.h:33
static const char * filename()
Basic string class.
Definition: TString.h:137
virtual void CreateModuleIndex()
Create the class index for each module, picking up documentation from the module's TModuleDocInfo::Ge...
Definition: TDocOutput.cxx:801
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
void ProcessDocInDir(std::ostream &out, const char *indir, const char *outdir, const char *linkdir)
Write links to files indir/*.txt, indir/*.html (non-recursive) to out.
Bool_t CopyHtmlFile(const char *sourceName, const char *destName="")
Copy file to HTML directory.
Definition: TDocOutput.cxx:593
void WriteModuleLinks(std::ostream &out)
Create a div containing links to all topmost modules.
virtual void DecorateEntityBegin(TString &str, Ssiz_t &pos, TDocParser::EParseContext type)
Add some colors etc to a source entity, contained in str.
virtual void DecorateEntityEnd(TString &str, Ssiz_t &pos, TDocParser::EParseContext type)
Add some colors etc to a source entity, contained in str.
const char * GetExtension() const
Definition: TDocOutput.h:96
ClassImp(RooList) TObjOptLink *RooList TObjLink * link
Find the link corresponding to the named object in this list.
Definition: RooList.cxx:48
virtual void CreateHierarchy()
Create a hierarchical class list The algorithm descends from the base classes and branches into all d...
Definition: TDocOutput.cxx:640
void WriteHtmlFooter(std::ostream &out, const char *dir, const char *lastUpdate, const char *author, const char *copyright, const char *footer)
Write HTML footer.
void WriteLocation(std::ostream &out, TModuleDocInfo *module, const char *classname=0)
make a link to the description
TVirtualPad is an abstract base class for the Pad and Canvas classes.
Definition: TVirtualPad.h:59
char * out
Definition: TBase64.cxx:29
virtual void AdjustSourcePath(TString &line, const char *relpath="../")
adjust the path of links for source files, which are in src/, but need to point to relpath (usually "...
Definition: TDocOutput.cxx:297
ClassDef(TDocOutput, 0)
virtual void ReferenceEntity(TSubString &str, TClass *entity, const char *comment=0)
Create a reference to a class documentation page.
Basic data type descriptor (datatype information is obtained from CINT).
Definition: TDataType.h:46
virtual const char * ReplaceSpecialChars(char c)
Replace ampersand, less-than and greater-than character, writing to out.
virtual void NameSpace2FileName(TString &name)
Replace "::" in name by "__" Replace "<", ">", " ", ",", "~", "=" in name by "_" Replace "A::X"...
virtual Bool_t ReferenceIsRelative(const char *reference) const
Check whether reference is a relative reference, and can (or should) be prependen by relative paths...
virtual void CreateClassTypeDefs()
Create a forwarding page for each typedef pointing to a class.
The ROOT global object gROOT contains a list of all defined classes.
Definition: TClass.h:81
THtml * fHtml
Definition: TDocOutput.h:53
virtual void WriteSearch(std::ostream &out)
Write a search link or a search box, based on THtml::GetSearchStemURL() and THtml::GetSearchEngine()...
virtual ~TDocOutput()
Definition: TDocOutput.cxx:261
void WriteHtmlHeader(std::ostream &out, const char *titleNoSpecial, const char *dir, TClass *cls, const char *header)
Write HTML header.
virtual Bool_t IsModified(TClass *classPtr, EFileType type)
Check if file is modified.
virtual void FixupAuthorSourceInfo(TString &authors)
Special author treatment; called when TDocParser::fSourceInfo[kInfoAuthor] is set.
long Long_t
Definition: RtypesCore.h:50
int Ssiz_t
Definition: RtypesCore.h:63
void Convert(std::istream &in, const char *infilename, const char *outfilename, const char *title, const char *relpath="../", Int_t includeOutput=0, const char *context="", TGClient *gclient=0)
Convert a text file into a html file.
Definition: TDocOutput.cxx:311
void AddLink(TSubString &str, TString &link, const char *comment)
Add a link around str, with title comment.
Definition: TDocOutput.cxx:268
int CaseInsensitiveSort(const void *name1, const void *name2)
TText * text
int type
Definition: TGX11.cxx:120
virtual void CreateClassIndex()
Create index of all classes.
Definition: TDocOutput.cxx:693
void WriteLineNumbers(std::ostream &out, Long_t nLines, const TString &infileBase) const
Create a div containing the line numbers (for a source listing) 1 to nLines.
#define name(a, b)
Definition: linkTestLib0.cpp:5
Mother of all ROOT objects.
Definition: TObject.h:58
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 has to be closed by caller so ad...
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", which gets then included literally into outMap.
Each ROOT class (see TClass) has a linked list of methods.
Definition: TMethod.h:40
THtml * GetHtml()
Definition: TDocOutput.h:97
const Bool_t kTRUE
Definition: Rtypes.h:91
Definition: THtml.h:44