Bump for 3.6-28
[LibreOffice.git] / autodoc / source / exes / adc_uni / adc_cmd_parse.hxx
blob761ae9c12c2a7933c592c78c4a19e632b9e1047b
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
34 // USED SERVICES
35 // BASE CLASSES
36 #include "adc_cmd.hxx"
37 // COMPONENTS
38 #include <cosv/ploc.hxx>
39 // PARAMETERS
41 namespace autodoc
43 namespace command
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
53 none,
54 idl
56 S_LanguageInfo()
57 : eLanguage(none),
58 aExtensions() {}
59 ~S_LanguageInfo();
61 void InitExtensions(
62 opt_iter & it,
63 opt_iter itEnd );
64 // DATA
65 E_ProgrammingLanguage
66 eLanguage;
67 StringVector aExtensions; // An empty string is possible and means exactly that: files without extension.
69 private:
70 // Interface Context:
71 virtual void do_Init(
72 opt_iter & it,
73 opt_iter itEnd );
77 class S_ProjectData;
80 /** A command that parses source code into the Autodoc Repository.
82 class Parse : public Command
84 public:
85 typedef std::vector< DYN S_ProjectData * > ProjectList;
86 typedef ProjectList::const_iterator ProjectIterator;
88 Parse();
89 ~Parse();
91 // INQUIRY
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; }
100 private:
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;
109 // Locals
110 void do_clName(
111 opt_iter & it,
112 opt_iter itEnd );
113 void do_clDevManual(
114 opt_iter & it,
115 opt_iter itEnd );
116 void do_clProject(
117 opt_iter & it,
118 opt_iter itEnd );
119 void do_clDefaultProject(
120 opt_iter & it,
121 opt_iter itEnd );
123 // DATA
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
154 StringVector aTrees;
155 StringVector aDirectories;
156 StringVector aFiles;
158 private:
159 // Interface Context:
160 virtual void do_Init(
161 opt_iter & it,
162 opt_iter itEnd );
165 class S_ProjectData : public Context
167 public:
168 enum E_Default { default_prj };
170 S_ProjectData(
171 const S_LanguageInfo &
172 i_globalLanguage );
173 S_ProjectData(
174 const S_LanguageInfo &
175 i_globalLanguage,
176 E_Default unused );
177 ~S_ProjectData();
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; }
187 private:
188 // Interface Context:
189 virtual void do_Init(
190 opt_iter & it,
191 opt_iter itEnd );
192 // Locals
194 // DATA
195 String sName;
196 csv::ploc::Path aRootDirectory;
197 S_LanguageInfo aLanguage;
198 S_Sources aFiles;
199 bool bIsDefault;
203 } // namespace command
204 } // namespace autodoc
207 #endif
209 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */