ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitAna/Utils/interface/TDocInfo.h
Revision: 1.1
Committed: Tue Aug 11 23:09:27 2009 UTC (15 years, 8 months ago) by loizides
Content type: text/plain
Branch: MAIN
CVS Tags: Mit_032, Mit_031, Mit_025c_branch2, Mit_025c_branch1, Mit_030, Mit_029c, Mit_029b, Mit_030_pre1, Mit_029a, Mit_029, Mit_029_pre1, Mit_028a, Mit_025c_branch0, Mit_028, Mit_027a, Mit_027, Mit_026, Mit_025e, Mit_025d, Mit_025c, Mit_025b, Mit_025a, Mit_025, Mit_025pre2, Mit_024b, Mit_025pre1, Mit_024a, Mit_024, Mit_023, Mit_022a, Mit_022, Mit_020d, TMit_020d, Mit_020c, Mit_021, Mit_021pre2, Mit_021pre1, Mit_020b, Mit_020a, Mit_020, Mit_020pre1, Mit_018, Mit_017, Mit_017pre3, Mit_017pre2, Mit_017pre1, Mit_016, Mit_015b, Mit_015a, Mit_015, Mit_014e, Mit_014d, Mit_014c, Mit_014b, Mit_014a, Mit_014, Mit_014pre3, Mit_014pre2, Mit_014pre1, Mit_013d, Mit_013c, Mit_013b, Mit_013a, Mit_013, Mit_013pre1, Mit_012i, Mit_012h, Mit_012g, Mit_012f, Mit_012e, Mit_012d, Mit_012c, Mit_012b, Mit_012a, Mit_012, Mit_011a, Mit_011, Mit_010a, HEAD
Branch point for: Mit_025c_branch
Log Message:
Added THtml from ROOT

File Contents

# Content
1 // @(#)root/html:$Id: TDocInfo.h 23937 2008-05-20 16:44:59Z axel $
2 // Author: Nenad Buncic 18/10/95
3
4 /*************************************************************************
5 * Copyright (C) 1995-2000, 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_TDocInfo
13 #define ROOT_TDocInfo
14
15 #ifndef ROOT_TClass
16 #include "TClass.h"
17 #endif
18 #ifndef ROOT_THashList
19 #include "THashList.h"
20 #endif
21 #ifndef ROOT_TNamed
22 #include "TNamed.h"
23 #endif
24 #include <string>
25 #include <set>
26
27 class TDictionary;
28
29 class TModuleDocInfo;
30 //____________________________________________________________________
31 //
32 // Cache doc info for all known classes
33 //
34 class TClassDocInfo: public TObject {
35 public:
36 // initialize the object
37 TClassDocInfo(TClass* cl,
38 const char* htmlfilename = "",
39 const char* fsdecl = "", const char* fsimpl = "",
40 const char* decl = 0, const char* impl = 0):
41 fClass(cl), fModule(0), fHtmlFileName(htmlfilename),
42 fDeclFileName(decl ? decl : cl->GetDeclFileName()),
43 fImplFileName(impl ? impl : cl->GetImplFileName()),
44 fDeclFileSysName(fsdecl), fImplFileSysName(fsimpl),
45 fSelected(kTRUE) { }
46
47 TClassDocInfo(TDictionary* cl,
48 const char* htmlfilename = "",
49 const char* fsdecl = "", const char* fsimpl = "",
50 const char* decl = 0, const char* impl = 0):
51 fClass(cl), fModule(0), fHtmlFileName(htmlfilename),
52 fDeclFileName(decl),
53 fImplFileName(impl),
54 fDeclFileSysName(fsdecl), fImplFileSysName(fsimpl),
55 fSelected(kTRUE) { }
56
57 virtual ~TClassDocInfo() {}
58
59 TDictionary* GetClass() const { return fClass; }
60 virtual const char* GetName() const;
61 const char* GetHtmlFileName() const { return fHtmlFileName; }
62 const char* GetDeclFileName() const { return fDeclFileName; }
63 const char* GetImplFileName() const { return fImplFileName; }
64 const char* GetDeclFileSysName() const { return fDeclFileSysName; }
65 const char* GetImplFileSysName() const { return fImplFileSysName; }
66
67 void SetModule(TModuleDocInfo* module) { fModule = module; }
68 TModuleDocInfo* GetModule() const { return fModule; }
69
70 void SetSelected(Bool_t sel = kTRUE) { fSelected = sel; }
71 Bool_t IsSelected() const { return fSelected; }
72 Bool_t HaveSource() const { return fDeclFileSysName.Length()
73 || (fClass && !dynamic_cast<TClass*>(fClass)); }
74
75 void SetHtmlFileName(const char* name) { fHtmlFileName = name; }
76 void SetDeclFileName(const char* name) { fDeclFileName = name; }
77 void SetImplFileName(const char* name) { fImplFileName = name; }
78 void SetDeclFileSysName(const char* fsname) { fDeclFileSysName = fsname; }
79 void SetImplFileSysName(const char* fsname) { fImplFileSysName = fsname; }
80
81 ULong_t Hash() const;
82
83 TList& GetListOfTypedefs() { return fTypedefs; }
84
85 virtual Bool_t IsSortable() const { return kTRUE; }
86 virtual Int_t Compare(const TObject* obj) const;
87
88 private:
89 TClassDocInfo();
90
91 TDictionary* fClass; // class (or typedef) represented by this info object
92 TModuleDocInfo* fModule; // module this class is in
93 TString fHtmlFileName; // name of the HTML doc file
94 TString fDeclFileName; // header
95 TString fImplFileName; // source
96 TString fDeclFileSysName; // file system's location of the header
97 TString fImplFileSysName; // file system's location of the source
98 TList fTypedefs; // typedefs to this class
99 Bool_t fSelected; // selected for doc output
100
101 ClassDef(TClassDocInfo,0); // info cache for class documentation
102 };
103
104 //____________________________________________________________________
105 //
106 // Cache doc info for all known modules
107 //
108 class TModuleDocInfo: public TNamed {
109 public:
110 TModuleDocInfo(const char* name, TModuleDocInfo* super, const char* doc = ""):
111 TNamed(name, doc), fSuper(super), fSub(0), fSelected(kTRUE) {
112 if (super) super->GetSub().Add(this);
113 }
114 virtual ~TModuleDocInfo() {}
115
116 void SetDoc(const char* doc) { SetTitle(doc); }
117 const char* GetDoc() const { return GetTitle(); }
118
119 void SetSelected(Bool_t sel = kTRUE) { fSelected = sel; }
120 Bool_t IsSelected() const { return fSelected; }
121
122 void AddClass(TClassDocInfo* cl) { fClasses.Add(cl); }
123 TList* GetClasses() { return &fClasses; }
124
125 TModuleDocInfo* GetSuper() const { return fSuper; }
126 THashList& GetSub() { return fSub; }
127
128 private:
129 TModuleDocInfo* fSuper; // module containing this module
130 THashList fSub; // modules contained in this module
131 TList fClasses;
132 Bool_t fSelected; // selected for doc output
133
134 ClassDef(TModuleDocInfo,0); // documentation for a group of classes
135 };
136
137 //__________________________________________________________________________
138 //
139 // A library's documentation database:
140 // dependencies and sub-modules
141 //
142 class TLibraryDocInfo: public TNamed {
143 public:
144 TLibraryDocInfo() {}
145 TLibraryDocInfo(const char* lib): TNamed(lib, "") {}
146
147 std::set<std::string>& GetDependencies() {return fDependencies;}
148 std::set<std::string>& GetModules() {return fModules;}
149 void AddDependency(const std::string& lib) {fDependencies.insert(lib);}
150 void AddModule(const std::string& module) {fModules.insert(module);}
151
152 private:
153 std::set<std::string> fDependencies; // dependencies on other libraries
154 std::set<std::string> fModules; // modules in the library
155
156 ClassDef(TLibraryDocInfo,0); // documentation for a library
157 };
158
159
160 #endif // ROOT_TDocInfo