xref: /aoo4110/main/xml2cmp/source/xcd/cr_index.hxx (revision b1cdbd2c)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef X2C_CR_INDEX_HXX
25 #define X2C_CR_INDEX_HXX
26 
27 #include "../support/sistr.hxx"
28 #include "../support/heap.hxx"
29 #include "../support/list.hxx"
30 #include "../support/syshelp.hxx"
31 
32 
33 class ModuleDescription;
34 
35 
36 class Index
37 {
38   public:
39 						Index(
40 							const char	*		i_sOutputDirectory,
41 							const char *		i_sIdlRootPath,
42 							const List<Simstr> &
43 												i_rTagList );
44 						~Index();
45 
46 	void				GatherData(
47 							const List<Simstr> &
48 												i_rInputFileList );
49 	void				WriteOutput(
50 							const char *      	i_sOuputFile );
51 
52 	void				InsertSupportedService(
53 							const Simstr &		i_sService );
54   private:
55 	void				ReadFile(
56 							const char *      	i_sFilename );
57 	void                CreateHtmlFileName(
58 							char *				o_sOutputHtml,
59 							const ModuleDescription	&
60 												i_rModule );
61 	void				WriteTableFromHeap(
62 							std::ostream &		o_rOut,
63 							Heap &		        i_rHeap,
64 							const char *        i_sIndexKey,
65 							const char *        i_sIndexReference,
66 							E_LinkType			i_eLinkType );
67 	void				WriteHeap(
68 							std::ostream &  	o_rOut,
69 							Heap &		        i_rHeap,
70 							E_LinkType			i_eLinkType );
71 
72 	// DATA
73 	Heap				aService2Module;
74 	Heap				aModule2Service;
75 
76 	Simstr				sOutputDirectory;
77 	Simstr			    sIdlRootPath;
78 
79 	// Temporary Data
80 	Simstr				sCurModule;
81 };
82 
83 
84 
85 
86 #endif
87 
88 
89