1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef X2C_CMDLINE_HXX
25 #define X2C_CMDLINE_HXX
26 
27 #include "sistr.hxx"
28 #include "list.hxx"
29 
30 
31 class CommandLine
32 {
33   public:
34 						CommandLine(
35 							int				 	i_argc,
36 							char *				i_argv[] );
37 						~CommandLine();
38 
IsOk() const39 	bool				IsOk() const			{ return bIsOk; }
40 	const char *		ErrorText() const;
41 
XmlSrcFile() const42 	const char *		XmlSrcFile() const 		{ return sXmlSourceFile.str(); }
FuncFile() const43 	const char *		FuncFile() const        { return sFuncFile.str(); }
HtmlFile() const44 	const char *		HtmlFile() const        { return sHtmlFile.str(); }
TypeInfoFile() const45 	const char *		TypeInfoFile() const    { return sTypeInfoFile.str(); }
46 
IsIndexCommand() const47 	bool				IsIndexCommand() const	{ return sIndexFile.l() > 0; }
XmlSrcDirectory() const48 	const char *		XmlSrcDirectory() const { return sXmlSourceDirectory.str(); }
IndexOutputFile() const49 	const char *		IndexOutputFile() const { return sIndexFile.str(); }
OutputDirectory() const50 	const char *		OutputDirectory() const { return sOutputDirectory.str(); }
51 	const List<Simstr> &
IndexedTags() const52 						IndexedTags() const	 	{ return aTagsInIndex; }
53 
IdlRootPath() const54 	const char *		IdlRootPath() const 	{ return sIdlRootPath.str(); }
55 
56   private:
57 	void				ParseIndexCommand(
58 							int					argc,
59 							char *				argv[] );
60 	void				ParseSingleFileCommand(
61 							int					argc,
62 							char *				argv[] );
63 	Simstr 				sXmlSourceFile;
64 	Simstr 				sFuncFile;
65 	Simstr 				sHtmlFile;
66 	Simstr 				sTypeInfoFile;
67 
68 	Simstr 				sXmlSourceDirectory;
69 	Simstr 				sIndexFile;
70 	Simstr 				sOutputDirectory;
71 	List<Simstr>		aTagsInIndex;
72 
73 	Simstr 				sIdlRootPath;
74 
75 	bool				bIsOk;
76 };
77 
78 
79 
80 
81 #endif
82 
83