THtml


class description - source file - inheritance tree

class THtml : public TObject

    private:
void Class2Html(TClass* classPtr, Bool_t force = kFALSE) void ClassDescription(ofstream& out, TClass* classPtr, Bool_t& flag) void ClassTree(TVirtualPad* canvas, TClass* classPtr, Bool_t force = kFALSE) Bool_t CopyHtmlFile(const Char_t* sourceName, const Char_t* destName) void CreateIndex(const Char_t** classNames, Int_t numberOfClasses) void CreateIndexByTopic(Char_t** filenames, Int_t numberOfNames, Int_t maxLen) void CreateListOfTypes() void DerivedClasses(ofstream& out, TClass* classPtr) void ExpandKeywords(ofstream& out, Char_t* text, TClass* ptr2class, Bool_t& flag, const Char_t* dir) void ExpandPpLine(ofstream& out, Char_t* line) TClass* GetClass(const char* name, Bool_t load = kTRUE) const Char_t* GetFileName(const Char_t* filename) const Char_t* GetHtmlFileName(TClass* classPtr) Bool_t IsModified(TClass* classPtr, const Int_t type) Bool_t IsName(Int_t c) Bool_t IsWord(Int_t c) void ReplaceSpecialChars(ofstream& out, const Char_t c) void ReplaceSpecialChars(ofstream& out, const Char_t* string) void SortNames(const Char_t** strings, Int_t num, Bool_t type = 0) Char_t* StrDup(const Char_t* s1, Int_t n = 1) public:
THtml THtml() THtml THtml(THtml&) virtual void ~THtml() TClass* Class() void Convert(const char* filename, const char* title, const char* dirname) const Char_t* GetOutputDir() const const Char_t* GetSourceDir() const const Char_t* GetXwho() const virtual TClass* IsA() const virtual Bool_t IsModified() void MakeAll(Bool_t force = kFALSE) void MakeClass(const char* className, Bool_t force = kFALSE) void MakeIndex() void MakeTree(const char* className, Bool_t force = kFALSE) void SetEscape(Char_t esc = \) void SetOutputDir(const Char_t* dir) void SetSourceDir(const Char_t* dir) void SetXwho(const char* xwho) virtual void ShowMembers(TMemberInspector& insp, char* parent) virtual void Streamer(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_t* title)

Data Members

private:
TString fXwho by default http://xwho.cern.ch/WHO/people? const Char_t* fSourceDir source path const Char_t* fOutputDir output directory Char_t* fLine current line Int_t fLen maximum line length Char_t* fCounter counter string Bool_t fEscFlag Flag to mark the symbol must be written "as is" Char_t fEsc The special symbol ("backslash" by default) to mark "the next symbol should not be converted

Class Description

   The HyperText Markup Language (HTML) is a simple data format used to
 create hypertext documents that are portable from one platform to another.
 HTML documents are SGML documents with generic semantics that are
 appropriate for representing information from a wide range of domains.

   The THtml class is designed to provide an easy way for converting ROOT
 classes, and files as well, into HTML documents. Here is the few rules
 and suggestions for a configuration, coding and usage.


 Configuration:
 -------------

   The output directory could be specified using the Root.Html.OutputDir
 environment variable ( default value: "html/" ). Also it is necessary to
 define Root.Html.SourceDir to point to directories containing .cxx and .h
 files ( see: TEnv ).

       Examples:
                Root.Html.OutputDir: html
                Root.Html.SourceDir: src:include:.:/usr/user/source
                Root.Html.Root:      http://root.cern.ch/root/html


   During the conversion, THtml will look for the certain number of
 user defined strings, i.e. author's name, copyright note, etc.
 This could be defined with following environment variables:

       Root.Html.Author     ( default: //*-- Author : )
       Root.Html.LastUpdate ( default: //*CMZ : )
       Root.Html.Copyright  ( default: // Copyright )



 Coding rules:
 ------------

   A class description block, which must be placed before the first
 member function, has a following form:

       
       //                                                            
       // TMyClass                                                   
       //                                                            
       // This is the description block.                             
       //                                                            
       

   The environment variable Root.Html.Description ( see: TEnv ) contents
 the delimiter string ( default value: //_________________ ). It means
 that you can also write your class description block like this:

       //_____________________________________________________________
       // A description of the class starts with the line above, and
       // will take place here !
       

   Note that EVERYTHING until the first non-commented line is considered
 as a valid class description block.

   A member function description block starts immediately after '{'
 and looks like this:

       void TWorld::HelloWorldFunc( string *text )
       {
       // This is an example of description for the
       // TWorld member function

          helloWorld.Print( text );
       }

   Like in a class description block, EVERYTHING until the first
 non-commented line is considered as a valid member function
 description block.

   ==> The "Begin_Html" and "End_Html" special keywords <=========
       --------------------------------------------
 You can insert pure html code in your comment lines. During the
 generation of the documentation, this code will be inserted as is
 in the html file.
 Pure html code must be inserted between the keywords "Begin_Html"
 and "End_Html" starting/finishing anywhere in the comment lines.
 Examples of pure html code are given in many Root classes.
 See for example the classes TDataMember and TMinuit.

   ==> The escape character
       --------------------
 Outside blocks starting with "Begin_Html" and finishing with "End_Html"
 one can prevent the automatic translation of symbols like "<" and ">"
 to "&lt;" and "&gt;" by using the escape character in front.
 The default escape character is backslash and can be changed
 via the member function SetEscape.

 Usage:
 -----

     Root> gHtml.MakeAll               // invoke a make for all classes
     Root> gHtml.MakeClass( TMyClass ) // create a HTML files for that class only
     Root> gHtml.MakeIndex()           // creates an index files only
     Root> gHtml.MakeTree( TMyClass )  // creates an inheritance tree for a class

     Root> gHtml.Convert( hist1.mac, "Histogram example" )


 Environment variables:
 ---------------------

   Root.Html.OutputDir    ( default: html/ )
   Root.Html.SourceDir    ( default: src/ )
   Root.Html.Author       ( default: //*-- Author : )
   Root.Html.LastUpdate   ( default: //*CMZ : )
   Root.Html.Copyright    ( default: // Copyright )
   Root.Html.Description  ( default: //____________________ )
   Root.Html.HomePage     ( URL to the user defined home page )
   Root.Html.SearchEngine ( link to the search engine )



THtml()
 Create a THtml object. Use object directly or via the global
 pointer gHtml. 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 '/' flag


void ClassTree( TVirtualPad *psCanvas, TClass *classPtr, Bool_t force )
 It makes a 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_t *sourceName, const Char_t *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_t **classNames, Int_t numberOfClasses )
 Create an index


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


void CreateIndexByTopic( Char_t **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 CreateListOfTypes()
 Create list of all data types

void DerivedClasses( ofstream &out, TClass *classPtr )
 It creates a list of derived classes


 Input: out      - output file stream
        classPtr - pointer to the class


void ExpandKeywords( ofstream &out, Char_t *text, TClass *ptr2class, Bool_t &flag, const Char_t *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 'html_begin/html_end' flag
        dir       - usually "" or "../", depends of current file
                    directory position


void ExpandPpLine( ofstream &out, Char_t *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_t* GetFileName( const Char_t *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_t* 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


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 )
 It makes everything


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()
 It makes an index files

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_t c )
 Replace ampersand, less-than and greater-than character


 Input: out - output file stream
        c   - single character


void ReplaceSpecialChars( ofstream &out, const Char_t *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_t **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_t* StrDup( const Char_t *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_t *title )
 Write HTML header


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


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




Inline Functions


        const Char_t* GetSourceDir() const
        const Char_t* GetOutputDir() const
        const Char_t* GetXwho() const
                 void SetEscape(Char_t esc = \)
                 void SetSourceDir(const Char_t* dir)
                 void SetOutputDir(const Char_t* dir)
                 void SetXwho(const char* xwho)
               Bool_t IsModified()
              TClass* Class()
              TClass* IsA() const
                 void ShowMembers(TMemberInspector& insp, char* parent)
                 void Streamer(TBuffer& b)
                THtml THtml(THtml&)


Author: Nenad Buncic 18/10/95
Last update: 2.23/12 26/01/2000 10.04.52 by Rene Brun
Copyright (c) 1995-1999, The ROOT System, All rights reserved. *


ROOT page - Class index - 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.