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