#include "THtml.h"

THtml


class description - source file - inheritance tree (.pdf)

class THtml : public TObject

Inheritance Chart:
TObject
<-
THtml

    protected:
THtml::TDocElement* AddDocElement(TDictionary* dict, TString& strDoc, const char* filename) void Class2Html(TClass* classPtr, Bool_t force = kFALSE) void ClassDescription(ofstream& out, TClass* classPtr, Bool_t& flag) void ClassHtmlTree(ofstream& out, TClass* classPtr, THtml::ETraverse dir = kBoth, int depth = 1) void ClassTree(TVirtualPad* canvas, TClass* classPtr, Bool_t force = kFALSE) Bool_t CopyHtmlFile(const char* sourceName, const char* destName) void CreateHierarchy(const char** classNames, Int_t numberOfClasses) void CreateIndex(const char** classNames, Int_t numberOfClasses) void CreateIndexByTopic(char** filenames, Int_t numberOfNames, Int_t maxLen) void CreateListOfTypes() void DescendHierarchy(ofstream& out, TClass* basePtr, const char** classNames, Int_t numberOfClasses, Int_t maxLines = 0, Int_t depth = 1) void ExpandKeywords(ofstream& out, char* text, TClass* ptr2class, Bool_t& flag, const char* dir) void ExpandPpLine(ofstream& out, char* line) Bool_t FindMethodImpl(TString strMethFullName, TList& listMethodSameName, TList& listArgs, THtml::TParseStack& parseStack, Bool_t done = kFALSE) const TClass* GetClass(const char* name, Bool_t load = kTRUE) THtml::TDocElement* GetDocElement(TDictionary* dict) const const char* GetFileName(const char* filename) const char* GetHtmlFileName(TClass* classPtr) char* GetSourceFileName(const char* filename) Bool_t IsModified(TClass* classPtr, const Int_t type) static Bool_t IsName(Int_t c) static Bool_t IsWord(Int_t c) void NameSpace2FileName(char* name) TClass* ParseClassDecl(char*& cfirstLinePos, const THtml::TParseStack& parseStack, TString& strClassName) void ReplaceSpecialChars(ofstream& out, const char c) void ReplaceSpecialChars(ofstream& out, const char* string) void SortNames(const char** strings, Int_t num, Bool_t type = 0) char* StrDup(const char* s1, Int_t n = 1) public:
THtml() virtual ~THtml() static TClass* Class() void Convert(const char* filename, const char* title, const char* dirname) void ExtractClassDocumentation(const TClass* classPtr) void ExtractDocumentation(const char* cFileName, TList* listClassesFound) const char* GetDoc(TDictionary* dict) const TPaveText* GetDocPave(TDictionary* dict) const char* GetOutputDir() const const char* GetSourceDir() const static TDictionary* GetType(const char* type) const char* GetXwho() const virtual TClass* IsA() const void MakeAll(Bool_t force = kFALSE, const char* filter = "*") void MakeClass(const char* className, Bool_t force = kFALSE) TMap* MakeHelp(TClass* cl) void MakeIndex(const char* filter = "*") void MakeTree(const char* className, Bool_t force = kFALSE) static Bool_t ParseWord(const char* begin, Int_t& step, const char* allowedChars = "0") static Bool_t ParseWord(const char* begin, Int_t& step, TString& strWord, const char* allowedChars = "0") void SetEscape(char esc = \\) void SetOutputDir(const char* dir) void SetSourceDir(const char* dir) void SetSourcePrefix(const char* prefix) void SetXwho(const char* xwho) virtual void ShowMembers(TMemberInspector& insp, char* parent) virtual void Streamer(TBuffer& b) void StreamerNVirtual(TBuffer& b) virtual void WriteHtmlFooter(ofstream& out, const char* dir, const char* lastUpdate, const char* author, const char* copyright) virtual void WriteHtmlHeader(ofstream& out, const char* title, TClass* cls = 0)

Data Members


    protected:
TString fXwho by default http://xwho.cern.ch/WHO/people? const char* fSourcePrefix prefix to relative source path const char* fSourceDir source path const char* fOutputDir output directory char* fLine current line Int_t fLen maximum line length char* fCounter counter string Bool_t fEscFlag Flag to mark the symbol must be written "as is" char fEsc The special symbol ("backslash" by default) to mark "the next symbol should not be converted TMap* fMapDocElements map of <TDictionary*, TDocElement*> for all objects for which doc was parsed static THashList fgLocalTypes list of types that are not in TROOT::GetClass TList fFilesParsed list of files on which ExtractDocumentatoin was run Int_t fHierarchyLines counter for no. lines in hierarchy public:
static const THtml::ETraverse kUp static const THtml::ETraverse kDown static const THtml::ETraverse kBoth

Class Description


THtml(): fMapDocElements(0)
 Create a THtml object.
 In case output directory does not exist an error
 will be printed and gHtml stays 0 also zombie bit will be set.

~THtml()
 Default destructor

void Class2Html(TClass * classPtr, Bool_t force)
 It creates HTML file for a single class


 Input: classPtr - pointer to the class

void ClassDescription(ofstream & out, TClass * classPtr, Bool_t & flag)
 This function builds the description of the class


 Input: out      - output file stream
        classPtr - pointer to the class
        flag     - this is a 'begin _html/end _html' flag


void ClassHtmlTree(ofstream & out, TClass * classPtr, ETraverse dir, int depth)
 This function builds the class tree for one class in HTML
 (inherited and succeeding classes, called recursively)


 Input: out      - output file stream
        classPtr - pointer to the class
        dir      - direction to traverse tree: up, down or both


void ClassTree(TVirtualPad * psCanvas, TClass * classPtr, Bool_t force)
 It makes a graphical class tree


 Input: psCanvas - pointer to the current canvas
        classPtr - pointer to the class


void Convert(const char *filename, const char *title, const char *dirname)
 It converts a single text file to HTML


 Input: filename - name of the file to convert
        title    - title which will be placed at the top of the HTML file
        dirname  - optional parameter, if it's not specified, output will
                   be placed in html/examples directory.

  NOTE: Output file name is the same as filename, but with extension .html


Bool_t CopyHtmlFile(const char *sourceName, const char *destName)
 Copy file to HTML directory


  Input: sourceName - source file name
         destName   - optional destination name, if not
                      specified it would be the same
                      as the source file name

 Output: TRUE if file is successfully copied, or
         FALSE if it's not


   NOTE: The destination directory is always fOutputDir


void CreateIndex(const char **classNames, Int_t numberOfClasses)
 Create an index


 Input: classNames      - pointer to an array of class names
        numberOfClasses - number of elements


void CreateIndexByTopic(char **fileNames, Int_t numberOfNames, Int_t maxLen)
 It creates several index files


 Input: fileNames     - pointer to an array of file names
        numberOfNames - number of elements in the fileNames array
        maxLen        - maximum length of a single name


void CreateHierarchy(const char **classNames, Int_t numberOfClasses)
 Create a hierarchical class list
 The algorithm descends from the base classes and branches into
 all derived classes. Mixing classes are displayed several times.

 Input: classNames      - pointer to an array of class names
        numberOfClasses - number of elements


void DescendHierarchy(ofstream & out, TClass* basePtr, const char **classNames, Int_t numberOfClasses, Int_t maxLines, Int_t depth)
 Descend hierarchy recursively
 loop over all classes and look for classes with base class basePtr

void CreateListOfTypes()
 Create list of all data types

void ExpandKeywords(ofstream & out, char *text, TClass * ptr2class, Bool_t & flag, const char *dir)
 Find keywords in text & create URLs


 Input: out       - output file stream
        text      - pointer to the array of the characters to process
        ptr2class - pointer to the class
        flag      - this is a 'begin _html/end _html' flag
        dir       - usually "" or "../", depends of current file
                    directory position


void ExpandPpLine(ofstream & out, char *line)
 Expand preprocessor statements


 Input: out  - output file stream
        line - pointer to the array of characters,
               usually one line from the source file

  NOTE: Looks for the #include statements and
        creates link to the corresponding file
        if such file exists


const char* GetFileName(const char *filename)
 It discards any directory information inside filename


  Input: filename - pointer to the file name

 Output: pointer to the string containing just a file name
         without any other directory information, i.e.
         '/usr/root/test.dat' will return 'test.dat'


char* GetSourceFileName(const char *filename)
 Find the source file. If filename contains a path it will be used
 together with the possible source prefix. If not found we try
 old algorithm, by stripping off the path and trying to find it in the
 specified source search path. Returned string must be deleted by the
 user. In case filename is not found 0 is returned.

char* GetHtmlFileName(TClass * classPtr)
 Return real HTML filename


  Input: classPtr - pointer to a class

 Output: pointer to the string containing a full name
         of the corresponding HTML file. The string must be deleted by the user.


TClass* GetClass(const char *name1, Bool_t load)
*-*-*-*-*Return pointer to class with name*-*-*-*-*-*-*-*-*-*-*-*-*
*-*      =================================

Bool_t IsModified(TClass * classPtr, const Int_t type)
 Check if file is modified


  Input: classPtr - pointer to the class
         type     - file type to compare with
                    values: kSource, kInclude, kTree

 Output: TRUE     - if file is modified since last time
         FALSE    - if file is up to date


Bool_t IsName(Int_t c)
 Check if c is a valid C++ name character


  Input: c - a single character

 Output: TRUE if c is a valid C++ name character
         and FALSE if it's not.

   NOTE: Valid name characters are [a..zA..Z0..9_],


Bool_t IsWord(Int_t c)
 Check if c is a valid first character for C++ name


  Input: c - a single character

 Output: TRUE if c is a valid first character for C++ name,
         and FALSE if it's not.

   NOTE: Valid first characters are [a..zA..Z_]


void MakeAll(Bool_t force, const char *filter)
 It makes all the classes specified in the filter (by default "*")
 To process all classes having a name starting with XX, do:
        html.MakeAll(kFALSE,"XX*");
 if force=kFALSE (default), only the classes that have been modified since
 the previous call to this function will be generated.
 if force=kTRUE, all classes passing the filter will be processed.


void MakeClass(const char *className, Bool_t force)
 Make HTML files for a single class


 Input: className - name of the class to process


void MakeIndex(const char *filter)
 It makes an index files
 by default makes an index of all classes (if filter="*")
 To generate an index for all classes starting with "XX", do
    html.MakeIndex("XX*");

void MakeTree(const char *className, Bool_t force)
 Make an inheritance tree


 Input: className - name of the class to process


void ReplaceSpecialChars(ofstream & out, const char c)
 Replace ampersand, less-than and greater-than character


 Input: out - output file stream
        c   - single character


void ReplaceSpecialChars(ofstream & out, const char *string)
 Replace ampersand, less-than and greater-than characters


 Input: out    - output file stream
        string - pointer to an array of characters


void SortNames(const char **strings, Int_t num, Bool_t type)
 Sort strings


 Input: strings - pointer to an array of strings
        type    - sort type
                  values : kCaseInsensitive, kCaseSensitive
                  default: kCaseInsensitive


char* StrDup(const char *s1, Int_t n)
 Returns a pointer to a new string which is a duplicate
 of the string to which 's1' points.  The space for the
 new string is obtained using the 'new' operator. The new
 string has the length of 'strlen(s1) + n'.

void WriteHtmlHeader(ofstream & out, const char *title, TClass *cls/*=0*/)
 Write HTML header


 Input: out   - output file stream
        title - title for the HTML page

 evaluates the Root.Html.Header setting:
 * if not set, the standard header is written. (ROOT)
 * if set, and ends with a "+", the standard header is written and this file included afterwards. (ROOT, USER)
 * if set but doesn't end on "+" the file specified will be written instead of the standard header (USER)

 Any occurrence of "%TITLE%" (without the quotation marks) in the user provided header file
 will be replaced by the value of this method's parameter "title" before written to the output file.
 %CLASS% is replaced by the class name ("" if not a class), %INCFILE% by the header file name as
 given by TClass::GetDeclFileName() and %SRCFILE% by the source file name as given by
 TClass::GetImplFileName() (both "" if not a class).

void WriteHtmlFooter(ofstream & out, const char *dir, const char *lastUpdate, const char *author, const char *copyright)
 Write HTML footer


 Input: out        - output file stream
        dir        - usually equal to "" or "../", depends of
                     current file directory position, i.e. if
                     file is in the fOutputDir, then dir will be ""
        lastUpdate - last update string
        author     - author's name
        copyright  - copyright note

 Allows optional user provided footer to be written. Root.Html.Footer holds the file name for this footer.
 For details see THtml::WriteHtmlHeader (here, the "+" means the user's footer is written in front of Root's!)
 Occurences of %AUTHOR%, %UPDATE% and %COPYRIGHT% in the user's file are replaced by their corresponding
 values (author, lastUpdate and copyright) before written to out.

void NameSpace2FileName(char *name)
 Replace "::" in name by "__"
 Replace "<", ">", " ","," in name by "_"

void ExtractClassDocumentation(const TClass* classPtr)

void ExtractDocumentation(const char* cFileName, TList* listClassesFound)
 parse this source or header, collect classes and methods, and add their doc to
 fMapDocElemets
 return the list of class definitions found in listClassesFound
 search only for methods of classes that are in listClassesFound

TClass* ParseClassDecl(char* &cfirstLinePos, const TParseStack& parseStack, TString& strClassName)

Bool_t ParseWord(const char* begin, Int_t &step, TString& strWord, const char* allowedChars /*=0*/)

Bool_t ParseWord(const char* begin, Int_t &step, const char* allowedChars /*=0*/)

Bool_t FindMethodImpl(TString strMethFullName, TList& listMethSameName, TList& listArgs, TParseStack& parseStack, Bool_t done) const
 find strArgs in all methods in listMethSameName
 remove those from the list that don't fit
 Return kFALSE if error

TPaveText* GetDocPave(TDictionary* dict)

TMap* MakeHelp(TClass* cl)



Inline Functions


        THtml::TDocElement* AddDocElement(TDictionary* dict, TString& strDoc, const char* filename)
        THtml::TDocElement* GetDocElement(TDictionary* dict) const
                const char* GetSourceDir() const
                const char* GetOutputDir() const
                const char* GetXwho() const
                       void SetEscape(char esc = \\)
                       void SetSourcePrefix(const char* prefix)
                       void SetSourceDir(const char* dir)
                       void SetOutputDir(const char* dir)
                       void SetXwho(const char* xwho)
               TDictionary* GetType(const char* type)
                const char* GetDoc(TDictionary* dict) const
                    TClass* Class()
                    TClass* IsA() const
                       void ShowMembers(TMemberInspector& insp, char* parent)
                       void Streamer(TBuffer& b)
                       void StreamerNVirtual(TBuffer& b)


Author: Nenad Buncic (18/10/95), Axel Naumann (09/28/01)
Last update: root/html:$Name: $:$Id: THtml.cxx,v 1.75 2005/05/02 21:46:19 brun Exp $
Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *


ROOT page - Class index - Class Hierarchy - Top of the page

This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.