merge the formfield patch from ooo-build
[ooovba.git] / autodoc / source / exes / adc_uni / adc_cmd_parse.hxx
blob907aaf1ba2dc292111428a808447a09ad4828ef4
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: adc_cmd_parse.hxx,v $
10 * $Revision: 1.4 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef ADC_ADC_CMD_PARSE_HXX
32 #define ADC_ADC_CMD_PARSE_HXX
36 // USED SERVICES
37 // BASE CLASSES
38 #include "adc_cmd.hxx"
39 // COMPONENTS
40 #include <cosv/ploc.hxx>
41 // PARAMETERS
43 namespace autodoc
45 namespace command
48 /** A command context which holds the currently parsed programing language
49 and its valid file extensions.
51 struct S_LanguageInfo : public Context
53 enum E_ProgrammingLanguage
55 none,
56 cpp,
57 idl,
58 java
60 S_LanguageInfo()
61 : eLanguage(none),
62 aExtensions() {}
63 ~S_LanguageInfo();
65 void InitExtensions(
66 opt_iter & it,
67 opt_iter itEnd );
68 // DATA
69 E_ProgrammingLanguage
70 eLanguage;
71 StringVector aExtensions; // An empty string is possible and means exactly that: files without extension.
73 private:
74 // Interface Context:
75 virtual void do_Init(
76 opt_iter & it,
77 opt_iter itEnd );
81 class S_ProjectData;
84 /** A command that parses source code into the Autodoc Repository.
86 class Parse : public Command
88 public:
89 typedef std::vector< DYN S_ProjectData * > ProjectList;
90 typedef ProjectList::const_iterator ProjectIterator;
92 Parse();
93 ~Parse();
95 // INQUIRY
96 const String & ReposyName() const;
97 const S_LanguageInfo &
98 GlobalLanguage() const;
99 ProjectIterator ProjectsBegin() const;
100 ProjectIterator ProjectsEnd() const;
101 const String & DevelopersManual_RefFilePath() const
102 { return sDevelopersManual_RefFilePath; }
104 private:
105 // Interface Context:
106 virtual void do_Init(
107 opt_iter & i_nCurArgsBegin,
108 opt_iter i_nEndOfAllArgs );
109 // Interface Command:
110 virtual bool do_Run() const;
111 virtual int inq_RunningRank() const;
113 // Locals
114 void do_clName(
115 opt_iter & it,
116 opt_iter itEnd );
117 void do_clDevManual(
118 opt_iter & it,
119 opt_iter itEnd );
120 void do_clProject(
121 opt_iter & it,
122 opt_iter itEnd );
123 void do_clDefaultProject(
124 opt_iter & it,
125 opt_iter itEnd );
127 // DATA
128 String sRepositoryName;
129 S_LanguageInfo aGlobalLanguage;
131 ProjectList aProjects;
133 String sDevelopersManual_RefFilePath;
136 inline const String &
137 Parse::ReposyName() const
138 { return sRepositoryName; }
139 inline const S_LanguageInfo &
140 Parse::GlobalLanguage() const
141 { return aGlobalLanguage; }
142 inline Parse::ProjectIterator
143 Parse::ProjectsBegin() const
144 { return aProjects.begin(); }
145 inline Parse::ProjectIterator
146 Parse::ProjectsEnd() const
147 { return aProjects.end(); }
148 //inline const String &
149 //Parse::DevelopersManual_RefFilePath() const
150 // { return sDevelopersManual_RefFilePath; }
151 //inline const String &
152 //Parse::DevelopersManual_HtmlRoot() const
153 // { return sDevelopersManual_HtmlRoot; }
156 struct S_Sources : public Context
158 StringVector aTrees;
159 StringVector aDirectories;
160 StringVector aFiles;
162 private:
163 // Interface Context:
164 virtual void do_Init(
165 opt_iter & it,
166 opt_iter itEnd );
169 class S_ProjectData : public Context
171 public:
172 enum E_Default { default_prj };
174 S_ProjectData(
175 const S_LanguageInfo &
176 i_globalLanguage );
177 S_ProjectData(
178 const S_LanguageInfo &
179 i_globalLanguage,
180 E_Default unused );
181 ~S_ProjectData();
183 bool IsDefault() const { return bIsDefault; }
184 const String & Name() const { return sName; }
185 const csv::ploc::Path &
186 RootDirectory() const { return aRootDirectory; }
187 const S_LanguageInfo &
188 Language() const { return aLanguage; }
189 const S_Sources Sources() const { return aFiles; }
191 private:
192 // Interface Context:
193 virtual void do_Init(
194 opt_iter & it,
195 opt_iter itEnd );
196 // Locals
198 // DATA
199 String sName;
200 csv::ploc::Path aRootDirectory;
201 S_LanguageInfo aLanguage;
202 S_Sources aFiles;
203 bool bIsDefault;
207 } // namespace command
208 } // namespace autodoc
211 #endif