1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef ADC_ADC_CMD_PARSE_HXX
21 #define ADC_ADC_CMD_PARSE_HXX
27 #include "adc_cmd.hxx"
29 #include <cosv/ploc.hxx>
37 /** A command context which holds the currently parsed programing language
38 and its valid file extensions.
40 struct S_LanguageInfo
: public Context
42 enum E_ProgrammingLanguage
58 StringVector aExtensions
; // An empty string is possible and means exactly that: files without extension.
71 /** A command that parses source code into the Autodoc Repository.
73 class Parse
: public Command
76 typedef std::vector
< DYN S_ProjectData
* > ProjectList
;
77 typedef ProjectList::const_iterator ProjectIterator
;
83 const String
& ReposyName() const;
84 const S_LanguageInfo
&
85 GlobalLanguage() const;
86 ProjectIterator
ProjectsBegin() const;
87 ProjectIterator
ProjectsEnd() const;
88 const String
& DevelopersManual_RefFilePath() const
89 { return sDevelopersManual_RefFilePath
; }
94 opt_iter
& i_nCurArgsBegin
,
95 opt_iter i_nEndOfAllArgs
);
97 virtual bool do_Run() const;
98 virtual int inq_RunningRank() const;
110 void do_clDefaultProject(
115 String sRepositoryName
;
116 S_LanguageInfo aGlobalLanguage
;
118 ProjectList aProjects
;
120 String sDevelopersManual_RefFilePath
;
123 inline const String
&
124 Parse::ReposyName() const
125 { return sRepositoryName
; }
126 inline const S_LanguageInfo
&
127 Parse::GlobalLanguage() const
128 { return aGlobalLanguage
; }
129 inline Parse::ProjectIterator
130 Parse::ProjectsBegin() const
131 { return aProjects
.begin(); }
132 inline Parse::ProjectIterator
133 Parse::ProjectsEnd() const
134 { return aProjects
.end(); }
135 //inline const String &
136 //Parse::DevelopersManual_RefFilePath() const
137 // { return sDevelopersManual_RefFilePath; }
138 //inline const String &
139 //Parse::DevelopersManual_HtmlRoot() const
140 // { return sDevelopersManual_HtmlRoot; }
143 struct S_Sources
: public Context
146 StringVector aDirectories
;
150 // Interface Context:
151 virtual void do_Init(
156 class S_ProjectData
: public Context
159 enum E_Default
{ default_prj
};
162 const S_LanguageInfo
&
165 const S_LanguageInfo
&
170 bool IsDefault() const { return bIsDefault
; }
171 const String
& Name() const { return sName
; }
172 const csv::ploc::Path
&
173 RootDirectory() const { return aRootDirectory
; }
174 const S_LanguageInfo
&
175 Language() const { return aLanguage
; }
176 const S_Sources
Sources() const { return aFiles
; }
179 // Interface Context:
180 virtual void do_Init(
187 csv::ploc::Path aRootDirectory
;
188 S_LanguageInfo aLanguage
;
194 } // namespace command
195 } // namespace autodoc
200 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */