Logo ROOT  
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 #include "TObject.h"
25 #include "TDocParser.h"
26 
27 class TClass;
28 class TDataMember;
29 class TDataType;
30 class TGClient;
31 class THtml;
32 class TModuleDocInfo;
33 class TString;
34 class TSubString;
35 class TVirtualPad;
36 
37 class TDocOutput: public TObject {
38 protected:
44  };
45 
46  THtml* fHtml; // THtml object we belong to
47 
48  int CaseInsensitiveSort(const void *name1, const void *name2);
49  void AddLink(TSubString& str, TString& link, const char* comment);
50  void ProcessDocInDir(std::ostream& out, const char* indir, const char* outdir, const char* linkdir);
51  Bool_t RunDot(const char* filename, std::ostream* outMap = 0, EGraphvizTool gvwhat = kDot);
52  void WriteHtmlHeader(std::ostream& out, const char *titleNoSpecial,
53  const char* dir /*=""*/, TClass *cls /*=0*/,
54  const char* header);
55  void WriteHtmlFooter(std::ostream& out, const char *dir,
56  const char *lastUpdate, const char *author,
57  const char *copyright, const char* footer);
58  virtual void WriteSearch(std::ostream& out);
59  void WriteLocation(std::ostream& out, TModuleDocInfo* module, const char* classname = 0);
60  void WriteModuleLinks(std::ostream& out);
61  void WriteModuleLinks(std::ostream& out, TModuleDocInfo* super);
62  void WriteTopLinks(std::ostream& out, TModuleDocInfo* module, const char* classname = 0, Bool_t withLocation = kTRUE);
63 
64 public:
66 
67  TDocOutput(THtml& html);
68  virtual ~TDocOutput();
69 
70  virtual void AdjustSourcePath(TString& line, const char* relpath = "../");
71  void Convert(std::istream& in, const char* infilename,
72  const char* outfilename, const char *title,
73  const char *relpath = "../",
74  Int_t includeOutput = 0,
75  const char* context = "",
76  TGClient* gclient = 0);
77  Bool_t CopyHtmlFile(const char *sourceName, const char *destName="");
78 
79  virtual void CreateClassIndex();
80  virtual void CreateModuleIndex();
81  virtual void CreateProductIndex();
82  virtual void CreateTypeIndex();
83  virtual void CreateClassTypeDefs();
84  virtual void CreateHierarchy();
85 
88  virtual void FixupAuthorSourceInfo(TString& authors);
89  const char* GetExtension() const { return ".html"; }
90  THtml* GetHtml() { return fHtml; }
91  virtual Bool_t IsModified(TClass *classPtr, EFileType type);
92  virtual void NameSpace2FileName(TString &name);
93 
94  virtual void ReferenceEntity(TSubString& str, TClass* entity, const char* comment = 0);
95  virtual void ReferenceEntity(TSubString& str, TDataMember* entity, const char* comment = 0);
96  virtual void ReferenceEntity(TSubString& str, TDataType* entity, const char* comment = 0);
97  virtual void ReferenceEntity(TSubString& str, TMethod* entity, const char* comment = 0);
98  virtual Bool_t ReferenceIsRelative(const char* reference) const;
99 
100  virtual const char* ReplaceSpecialChars(char c);
101  void ReplaceSpecialChars(std::ostream &out, const char *string);
103  void ReplaceSpecialChars(TString& text, Ssiz_t &pos);
104 
105  virtual void WriteHtmlHeader(std::ostream &out, const char *title, const char* dir="", TClass *cls=0);
106  virtual void WriteHtmlFooter(std::ostream &out, const char *dir="", const char *lastUpdate="",
107  const char *author="", const char *copyright="");
108  void WriteLineNumbers(std::ostream& out, Long_t nLines, const TString& infileBase) const;
109 
110  ClassDef(TDocOutput, 0); // generates documentation web pages
111 };
112 
113 #endif // ROOT_TDocOutput
c
#define c(i)
Definition: RSha256.hxx:119
kTRUE
const Bool_t kTRUE
Definition: RtypesCore.h:91
TDocOutput::kSource
@ kSource
Definition: TDocOutput.h:65
TDocOutput::CreateHierarchy
virtual void CreateHierarchy()
Create a hierarchical class list The algorithm descends from the base classes and branches into all d...
Definition: TDocOutput.cxx:639
TDocOutput::kNeato
@ kNeato
Definition: TDocOutput.h:41
TDocOutput::kDot
@ kDot
Definition: TDocOutput.h:40
TDocOutput::CreateClassTypeDefs
virtual void CreateClassTypeDefs()
Create a forwarding page for each typedef pointing to a class.
Definition: TDocOutput.cxx:1169
TDocOutput::kDoc
@ kDoc
Definition: TDocOutput.h:65
Int_t
int Int_t
Definition: RtypesCore.h:45
TDataMember
Definition: TDataMember.h:31
TDocOutput::TDocOutput
TDocOutput(THtml &html)
Definition: TDocOutput.cxx:255
TDocOutput::WriteLineNumbers
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.
Definition: TDocOutput.cxx:2340
TDocOutput::CreateTypeIndex
virtual void CreateTypeIndex()
Create index of all data types.
Definition: TDocOutput.cxx:1275
TDocOutput::kTree
@ kTree
Definition: TDocOutput.h:65
TDocOutput::DecorateEntityBegin
virtual void DecorateEntityBegin(TString &str, Ssiz_t &pos, TDocParser::EParseContext type)
Add some colors etc to a source entity, contained in str.
Definition: TDocOutput.cxx:1367
TDocOutput::CreateClassIndex
virtual void CreateClassIndex()
Create index of all classes.
Definition: TDocOutput.cxx:692
TDocOutput::kInclude
@ kInclude
Definition: TDocOutput.h:65
TString
Definition: TString.h:136
Bool_t
bool Bool_t
Definition: RtypesCore.h:63
TDocOutput::EGraphvizTool
EGraphvizTool
Definition: TDocOutput.h:39
text
TText * text
Definition: entrylist_figure1.C:10
TDocOutput::EFileType
EFileType
Definition: TDocOutput.h:65
TDocOutput::AdjustSourcePath
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:296
bool
TDocParser.h
TDocOutput::DecorateEntityEnd
virtual void DecorateEntityEnd(TString &str, Ssiz_t &pos, TDocParser::EParseContext type)
Add some colors etc to a source entity, contained in str.
Definition: TDocOutput.cxx:1407
TDocOutput::IsModified
virtual Bool_t IsModified(TClass *classPtr, EFileType type)
Check if file is modified.
Definition: TDocOutput.cxx:1515
TDocOutput::ReferenceEntity
virtual void ReferenceEntity(TSubString &str, TClass *entity, const char *comment=0)
Create a reference to a class documentation page.
Definition: TDocOutput.cxx:1788
THtml
Definition: THtml.h:40
TSubString
Definition: TString.h:82
TDocOutput::CreateModuleIndex
virtual void CreateModuleIndex()
Create the class index for each module, picking up documentation from the module's TModuleDocInfo::Ge...
Definition: TDocOutput.cxx:800
TDocOutput::ReferenceIsRelative
virtual Bool_t ReferenceIsRelative(const char *reference) const
Check whether reference is a relative reference, and can (or should) be prependen by relative paths.
Definition: TDocOutput.cxx:1951
TDocOutput::AddLink
void AddLink(TSubString &str, TString &link, const char *comment)
Add a link around str, with title comment.
Definition: TDocOutput.cxx:267
TDocOutput::ReplaceSpecialChars
virtual const char * ReplaceSpecialChars(char c)
Replace ampersand, less-than and greater-than character, writing to out.
Definition: TDocOutput.cxx:1962
TModuleDocInfo
Definition: TDocInfo.h:107
TDataType
Definition: TDataType.h:44
TDocOutput::WriteModuleLinks
void WriteModuleLinks(std::ostream &out)
Create a div containing links to all topmost modules.
Definition: TDocOutput.cxx:2312
TDocOutput::NameSpace2FileName
virtual void NameSpace2FileName(TString &name)
Replace "::" in name by "__" Replace "<", ">", " ", ",", "~", "=" in name by "_" Replace "A::X<A::Y>"...
Definition: TDocOutput.cxx:1617
TMethod
Definition: TMethod.h:38
Long_t
long Long_t
Definition: RtypesCore.h:54
TDocOutput::CopyHtmlFile
Bool_t CopyHtmlFile(const char *sourceName, const char *destName="")
Copy file to HTML directory.
Definition: TDocOutput.cxx:592
TDocOutput::fHtml
THtml * fHtml
Definition: TDocOutput.h:46
TDocOutput::WriteTopLinks
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 ...
Definition: TDocOutput.cxx:2468
TDocParser::EParseContext
EParseContext
Definition: TDocParser.h:67
TDocOutput::WriteLocation
void WriteLocation(std::ostream &out, TModuleDocInfo *module, const char *classname=0)
make a link to the description
Definition: TDocOutput.cxx:2423
TDocOutput::CreateProductIndex
virtual void CreateProductIndex()
Fetch documentation from THtml::GetProductDocDir() and put it into the product index page.
Definition: TDocOutput.cxx:1126
TDocOutput::GetHtml
THtml * GetHtml()
Definition: TDocOutput.h:90
TDocOutput::WriteHtmlHeader
void WriteHtmlHeader(std::ostream &out, const char *titleNoSpecial, const char *dir, TClass *cls, const char *header)
Write HTML header.
Definition: TDocOutput.cxx:2109
line
TLine * line
Definition: entrylistblock_figure1.C:235
TDocOutput::~TDocOutput
virtual ~TDocOutput()
Definition: TDocOutput.cxx:260
TDocOutput::ProcessDocInDir
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.
Definition: TDocOutput.cxx:1676
TDocOutput
Definition: TDocOutput.h:37
Ssiz_t
int Ssiz_t
Definition: RtypesCore.h:67
TDocOutput::WriteSearch
virtual void WriteSearch(std::ostream &out)
Write a search link or a search box, based on THtml::GetSearchStemURL() and THtml::GetSearchEngine().
Definition: TDocOutput.cxx:2386
TDocOutput::FixupAuthorSourceInfo
virtual void FixupAuthorSourceInfo(TString &authors)
Special author treatment; called when TDocParser::fSourceInfo[kInfoAuthor] is set.
Definition: TDocOutput.cxx:1448
TVirtualPad
Definition: TVirtualPad.h:50
TDocOutput::kFdp
@ kFdp
Definition: TDocOutput.h:42
TDocOutput::GetExtension
const char * GetExtension() const
Definition: TDocOutput.h:89
TObject.h
TClass
Definition: TClass.h:80
TObject
Definition: TObject.h:37
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
name
char name[80]
Definition: TGX11.cxx:110
TDocOutput::CaseInsensitiveSort
int CaseInsensitiveSort(const void *name1, const void *name2)
ROOT::TMetaUtils::propNames::comment
static const std::string comment("comment")
launcher.module
module
Definition: launcher.py:31
type
int type
Definition: TGX11.cxx:121
TDocOutput::kCirco
@ kCirco
Definition: TDocOutput.h:43
TGClient
Definition: TGClient.h:46
TDocOutput::Convert
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:310
TDocOutput::WriteHtmlFooter
void WriteHtmlFooter(std::ostream &out, const char *dir, const char *lastUpdate, const char *author, const char *copyright, const char *footer)
Write HTML footer.
Definition: TDocOutput.cxx:2217
TDocOutput::RunDot
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",...
Definition: TDocOutput.cxx:2040