update credits
[LibreOffice.git] / autodoc / source / exes / adc_uni / adc_cmd_parse.hxx
blobab7853494005ad1af6ce9ace377178d5ffbdeaa8
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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
25 // USED SERVICES
26 // BASE CLASSES
27 #include "adc_cmd.hxx"
28 // COMPONENTS
29 #include <cosv/ploc.hxx>
30 // PARAMETERS
32 namespace autodoc
34 namespace command
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
44 none,
45 idl
47 S_LanguageInfo()
48 : eLanguage(none),
49 aExtensions() {}
50 ~S_LanguageInfo();
52 void InitExtensions(
53 opt_iter & it,
54 opt_iter itEnd );
55 // DATA
56 E_ProgrammingLanguage
57 eLanguage;
58 StringVector aExtensions; // An empty string is possible and means exactly that: files without extension.
60 private:
61 // Interface Context:
62 virtual void do_Init(
63 opt_iter & it,
64 opt_iter itEnd );
68 class S_ProjectData;
71 /** A command that parses source code into the Autodoc Repository.
73 class Parse : public Command
75 public:
76 typedef std::vector< DYN S_ProjectData * > ProjectList;
77 typedef ProjectList::const_iterator ProjectIterator;
79 Parse();
80 ~Parse();
82 // INQUIRY
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; }
91 private:
92 // Interface Context:
93 virtual void do_Init(
94 opt_iter & i_nCurArgsBegin,
95 opt_iter i_nEndOfAllArgs );
96 // Interface Command:
97 virtual bool do_Run() const;
98 virtual int inq_RunningRank() const;
100 // Locals
101 void do_clName(
102 opt_iter & it,
103 opt_iter itEnd );
104 void do_clDevManual(
105 opt_iter & it,
106 opt_iter itEnd );
107 void do_clProject(
108 opt_iter & it,
109 opt_iter itEnd );
110 void do_clDefaultProject(
111 opt_iter & it,
112 opt_iter itEnd );
114 // DATA
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
145 StringVector aTrees;
146 StringVector aDirectories;
147 StringVector aFiles;
149 private:
150 // Interface Context:
151 virtual void do_Init(
152 opt_iter & it,
153 opt_iter itEnd );
156 class S_ProjectData : public Context
158 public:
159 enum E_Default { default_prj };
161 S_ProjectData(
162 const S_LanguageInfo &
163 i_globalLanguage );
164 S_ProjectData(
165 const S_LanguageInfo &
166 i_globalLanguage,
167 E_Default unused );
168 ~S_ProjectData();
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; }
178 private:
179 // Interface Context:
180 virtual void do_Init(
181 opt_iter & it,
182 opt_iter itEnd );
183 // Locals
185 // DATA
186 String sName;
187 csv::ploc::Path aRootDirectory;
188 S_LanguageInfo aLanguage;
189 S_Sources aFiles;
190 bool bIsDefault;
194 } // namespace command
195 } // namespace autodoc
198 #endif
200 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */