xref: /trunk/main/codemaker/source/codemaker/options.cxx (revision 91144cd0085a7583d2099b982122deb2184ab956)
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 // MARKER(update_precomp.py): autogen include statement, do not remove
23 #include "precompiled_codemaker.hxx"
24 
25 #include "codemaker/options.hxx"
26 
27 using namespace rtl;
28 
Options()29 Options::Options()
30 {
31 }
32 
~Options()33 Options::~Options()
34 {
35 
36 }
37 
getProgramName() const38 const OString& Options::getProgramName() const
39 {
40     return m_program;
41 }
42 
isValid(const OString & option)43 sal_Bool Options::isValid(const OString& option)
44 {
45     return (m_options.count(option) > 0);
46 }
47 
getOption(const OString & option)48 const OString Options::getOption(const OString& option)
49 {
50     if (m_options.count(option) > 0)
51     {
52         return m_options[option];
53     } else
54     {
55         throw IllegalArgument("Option is not valid or currently not set.");
56     }
57 }
58 
getOptions()59 const OptionMap& Options::getOptions()
60 {
61     return m_options;
62 }
63 
getInputFile(sal_uInt16 index)64 const OString Options::getInputFile(sal_uInt16 index)
65 {
66     if (index < m_inputFiles.size())
67     {
68         return m_inputFiles[index];
69     } else
70     {
71         throw IllegalArgument("index is out of bound.");
72     }
73 }
74 
getInputFiles()75 const StringVector& Options::getInputFiles()
76 {
77     return m_inputFiles;
78 }
79 
getExtraInputFile(sal_uInt16 index) const80 OString Options::getExtraInputFile(sal_uInt16 index) const
81 {
82     if (index < m_extra_input_files.size())
83     {
84         return m_extra_input_files[index];
85     } else
86     {
87         throw IllegalArgument("index is out of bound.");
88     }
89 }
90 
91 /* vim: set noet sw=4 ts=4: */
92