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 ADC_DISPLAY_OUT_TREE_HXX
25 #define ADC_DISPLAY_OUT_TREE_HXX
26 
27 
28 // USED SERVICES
29     // BASE CLASSES
30     // COMPONENTS
31 #include "out_position.hxx"
32     // PARAMETERS
33 
34 
35 namespace output
36 {
37 
38 inline const char *
ModuleFileName()39 ModuleFileName()
40 { return "module-ix.html"; }
41 inline const char *
IndexFilesDirName()42 IndexFilesDirName()
43 { return "index-files"; }
44 inline const char *
IndexFile_A()45 IndexFile_A()
46 { return "index-1.html"; }
47 
48 
49 class Tree
50 {
51   public:
52     // LIFECYCLE
53                         Tree();
54                         ~Tree();
55 
56     // OPERATIONS
57     void                Set_Overview(
58                             const StringVector &
59                                                 i_path,
60                             const String &      i_sFileName );
61     Node &              Set_NamesRoot(
62                             const StringVector &
63                                                 i_path );
64     Node &              Set_IndexRoot(
65                             const StringVector &
66                                                 i_path );
67     Node &              Set_ProjectsRoot(
68                             const StringVector &
69                                                 i_path );
70     Node &              Provide_Node(
71                             const StringVector &
72                                                 i_path );
73 
74     // ACCESS
RootNode()75     Node &              RootNode()              { return *pRoot; }
NamesRootNode()76     Node &              NamesRootNode()	    	{ return *pNamesRoot; }
IndexRootNode()77     Node &              IndexRootNode()			{ return *pIndexRoot; }
ProjectsRootNode()78     Node &              ProjectsRootNode()		{ return *pProjectsRoot; }
79 
Root()80     Position            Root()                  { return Position(*pRoot); }
Overview()81     Position            Overview()				{ return aOverview; }
NamesRoot()82     Position            NamesRoot()				{ return Position(*pNamesRoot); }
IndexRoot()83     Position            IndexRoot()				{ return Position(*pIndexRoot); }
ProjectsRoot()84     Position            ProjectsRoot()			{ return Position(*pProjectsRoot); }
85 
86   private:
87     // forbidden:
88                         Tree(const Tree&);
89     Tree &              operator=(const Tree&);
90 
91     // DATA
92     Dyn<Node>           pRoot;
93     Node *              pNamesRoot;
94     Node *              pIndexRoot;
95     Node *              pProjectsRoot;
96     Position            aOverview;
97 };
98 
99 
100 // IMPLEMENTATION
101 
102 inline Node &
Provide_Node(const StringVector & i_path)103 Tree::Provide_Node( const StringVector & i_path )
104     { return pRoot->Provide_Child(i_path); }
105 
106 
107 inline void
Set_Overview(const StringVector & i_path,const String & i_sFileName)108 Tree::Set_Overview( const StringVector & i_path,
109                     const String &		 i_sFileName )
110     { aOverview.Set(Provide_Node(i_path), i_sFileName); }
111 
112 inline Node &
Set_NamesRoot(const StringVector & i_path)113 Tree::Set_NamesRoot( const StringVector & i_path )
114     { pNamesRoot = &Provide_Node(i_path);
115 	  return *pNamesRoot; }
116 
117 inline Node &
Set_IndexRoot(const StringVector & i_path)118 Tree::Set_IndexRoot( const StringVector & i_path )
119     { pIndexRoot = &Provide_Node(i_path);
120 	  return *pIndexRoot; }
121 
122 inline Node &
Set_ProjectsRoot(const StringVector & i_path)123 Tree::Set_ProjectsRoot( const StringVector & i_path )
124     { pProjectsRoot = &Provide_Node(i_path);
125 	  return *pProjectsRoot; }
126 
127 
128 
129 }   // namespace output
130 
131 
132 #endif
133