1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * Copyright 2000, 2010 Oracle and/or its affiliates.
8 * OpenOffice.org - a multi-platform office productivity suite
10 * This file is part of OpenOffice.org.
12 * OpenOffice.org is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU Lesser General Public License version 3
14 * only, as published by the Free Software Foundation.
16 * OpenOffice.org is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License version 3 for more details
20 * (a copy is included in the LICENSE file that accompanied this code).
22 * You should have received a copy of the GNU Lesser General Public License
23 * version 3 along with OpenOffice.org. If not, see
24 * <http://www.openoffice.org/license.html>
25 * for a copy of the LGPLv3 License.
27 ************************************************************************/
29 #ifndef ADC_ADC_CMD_PARSE_HXX
30 #define ADC_ADC_CMD_PARSE_HXX
36 #include "adc_cmd.hxx"
38 #include <cosv/ploc.hxx>
46 /** A command context which holds the currently parsed programing language
47 and its valid file extensions.
49 struct S_LanguageInfo
: public Context
51 enum E_ProgrammingLanguage
67 StringVector aExtensions
; // An empty string is possible and means exactly that: files without extension.
80 /** A command that parses source code into the Autodoc Repository.
82 class Parse
: public Command
85 typedef std::vector
< DYN S_ProjectData
* > ProjectList
;
86 typedef ProjectList::const_iterator ProjectIterator
;
92 const String
& ReposyName() const;
93 const S_LanguageInfo
&
94 GlobalLanguage() const;
95 ProjectIterator
ProjectsBegin() const;
96 ProjectIterator
ProjectsEnd() const;
97 const String
& DevelopersManual_RefFilePath() const
98 { return sDevelopersManual_RefFilePath
; }
101 // Interface Context:
102 virtual void do_Init(
103 opt_iter
& i_nCurArgsBegin
,
104 opt_iter i_nEndOfAllArgs
);
105 // Interface Command:
106 virtual bool do_Run() const;
107 virtual int inq_RunningRank() const;
119 void do_clDefaultProject(
124 String sRepositoryName
;
125 S_LanguageInfo aGlobalLanguage
;
127 ProjectList aProjects
;
129 String sDevelopersManual_RefFilePath
;
132 inline const String
&
133 Parse::ReposyName() const
134 { return sRepositoryName
; }
135 inline const S_LanguageInfo
&
136 Parse::GlobalLanguage() const
137 { return aGlobalLanguage
; }
138 inline Parse::ProjectIterator
139 Parse::ProjectsBegin() const
140 { return aProjects
.begin(); }
141 inline Parse::ProjectIterator
142 Parse::ProjectsEnd() const
143 { return aProjects
.end(); }
144 //inline const String &
145 //Parse::DevelopersManual_RefFilePath() const
146 // { return sDevelopersManual_RefFilePath; }
147 //inline const String &
148 //Parse::DevelopersManual_HtmlRoot() const
149 // { return sDevelopersManual_HtmlRoot; }
152 struct S_Sources
: public Context
155 StringVector aDirectories
;
159 // Interface Context:
160 virtual void do_Init(
165 class S_ProjectData
: public Context
168 enum E_Default
{ default_prj
};
171 const S_LanguageInfo
&
174 const S_LanguageInfo
&
179 bool IsDefault() const { return bIsDefault
; }
180 const String
& Name() const { return sName
; }
181 const csv::ploc::Path
&
182 RootDirectory() const { return aRootDirectory
; }
183 const S_LanguageInfo
&
184 Language() const { return aLanguage
; }
185 const S_Sources
Sources() const { return aFiles
; }
188 // Interface Context:
189 virtual void do_Init(
196 csv::ploc::Path aRootDirectory
;
197 S_LanguageInfo aLanguage
;
203 } // namespace command
204 } // namespace autodoc
209 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */