1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: adc_cmd_parse.hxx,v $
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
38 #include "adc_cmd.hxx"
40 #include <cosv/ploc.hxx>
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
71 StringVector aExtensions
; // An empty string is possible and means exactly that: files without extension.
84 /** A command that parses source code into the Autodoc Repository.
86 class Parse
: public Command
89 typedef std::vector
< DYN S_ProjectData
* > ProjectList
;
90 typedef ProjectList::const_iterator ProjectIterator
;
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
; }
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;
123 void do_clDefaultProject(
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
159 StringVector aDirectories
;
163 // Interface Context:
164 virtual void do_Init(
169 class S_ProjectData
: public Context
172 enum E_Default
{ default_prj
};
175 const S_LanguageInfo
&
178 const S_LanguageInfo
&
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
; }
192 // Interface Context:
193 virtual void do_Init(
200 csv::ploc::Path aRootDirectory
;
201 S_LanguageInfo aLanguage
;
207 } // namespace command
208 } // namespace autodoc