StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
MakeHtmlTables.cxx
1 // $Id: MakeHtmlTables.cxx,v 1.12 2006/08/15 21:43:16 jeromel Exp $
2 // $Log: MakeHtmlTables.cxx,v $
3 // Revision 1.12 2006/08/15 21:43:16 jeromel
4 // Fix rhic -> rhic.bnl.gov
5 //
6 // Revision 1.11 2001/09/02 00:03:22 fine
7 // type fixed
8 //
9 // Revision 1.10 1999/11/19 21:20:23 fine
10 // Extra path to /afs/rhic.bnl.gov/star/packages/SL99i include dirictory was added
11 //
12 // Revision 1.9 1999/09/14 15:30:39 fine
13 // makedocs adjusted to the new source tree
14 //
15 // Revision 1.8 1999/09/12 01:09:57 fine
16 // Adjusted to the new source tree
17 //
18 // Revision 1.7 1999/05/21 15:33:51 kathy
19 // made sure Log & Id are in each file and also put in standard comment line with name of owner
20 //
21 //=======================================================================
22 // owner: Valery Fine
23 // what it does: Create the HTML page for STAF tables
24 //=======================================================================
25 {
26  // Create the HTML page for STAF tables
27 
28 // Load the share libraries
29 
30  Char_t *libs[] = {"St_base","St_Tables"};
31  Char_t *suffix=0;
32  Int_t nlist = 2;
33  Bool_t NT=kFALSE;
34 
35  if (strcmp(gSystem->GetName(),"WinNT") == 0 ) {
36  NT = kTRUE;
37  gSystem.Load("Root_html.dll");
38  }
39 
40  gSystem->Load("St_base");
41  gSystem->Load("St_Tables");
42 
43  cout << "Dynamic libraries have been loaded" << endl;
44 
45  void *dirhandle = 0;
46  const Char_t *affix="_st";
47  TString sourcedir;
48  if (NT)
49  sourcedir = "//sol/afs_rhic/star/packages/dev/.share/tables";
50  else
51  sourcedir = "$STAR/include/tables";
52 
53  gSystem->ExpandPathName(sourcedir);
54  if (!(dirhandle = gSystem->OpenDirectory(sourcedir.Data()))) return;
55 
56  // Create THtml object
57  THtml *html = new THtml;
58 
59  TString lookup = 0;
60  if (NT)
61  lookup = "//sol/afs_rhic/star/packages/dev/.share/tables;../base;//sol/afs_rhic/star/packages/dev/.share/base";
62  else {
63  lookup = "$STAF/inc:";
64  lookup += "$STAR:";
65  lookup += sourcedir;
66  lookup += ":";
67  lookup += "$STAR/include:";
68  lookup += "$STAR/include/tables:";
69  lookup += "$STAR/StRoot/St_base";
70  lookup += "$STAR/.share/tables:";
71  }
72 
73  html->SetSourceDir(lookup.Data());
74  if (NT)
75  html->SetOutputDir("J:/Public/STAF/draft/base/html");
76  else
77  html->SetOutputDir("$STAR/StRoot/html");
78 
79  html.MakeClass("St_Table",kTRUE);
80 
81  char *n = 0;
82 
83  while (n = gSystem->GetDirEntry(dirhandle)) {
84  Char_t *name = StrDup(n);
85  // test the prefix
86  if (strstr(name,"St_") == name) {
87  // test the tail
88  Char_t *tail = 0;
89  if (tail = strstr(name,"_Table.h")) {
90  *tail = '\0';
91 
92  // Make class description
93  html.MakeClass(name,kTRUE);
94 
95  // Make C structure name
96  Int_t i;
97  for (i=0; i < strlen(name)-3; i++) name[i] = name[i+3];
98  name[i] = '\0';
99  strcat(name,affix);
100  html.MakeClass(name,kTRUE);
101  }
102  }
103  delete [] name ;
104  }
105  gSystem->FreeDirectory(dirhandle);
106  // Make html for itself
107  html->Convert("$STAR/StRoot/html/MakeHtmlTables.cxx","How to create the HTML doc for the STAF table wrappers");
108 }