xref: /AOO42X/main/codemaker/source/codemaker/options.cxx (revision a52465541c45a73de2757b73c6e502ca312fea0b)
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     throw( IllegalArgument )
50 {
51     if (m_options.count(option) > 0)
52     {
53         return m_options[option];
54     } else
55     {
56         throw IllegalArgument("Option is not valid or currently not set.");
57     }
58 }
59 
getOptions()60 const OptionMap& Options::getOptions()
61 {
62     return m_options;
63 }
64 
getInputFile(sal_uInt16 index)65 const OString Options::getInputFile(sal_uInt16 index)
66     throw( IllegalArgument )
67 {
68     if (index < m_inputFiles.size())
69     {
70         return m_inputFiles[index];
71     } else
72     {
73         throw IllegalArgument("index is out of bound.");
74     }
75 }
76 
getInputFiles()77 const StringVector& Options::getInputFiles()
78 {
79     return m_inputFiles;
80 }
81 
getExtraInputFile(sal_uInt16 index) const82 OString Options::getExtraInputFile(sal_uInt16 index) const
83     throw( IllegalArgument )
84 {
85     if (index < m_extra_input_files.size())
86     {
87         return m_extra_input_files[index];
88     } else
89     {
90         throw IllegalArgument("index is out of bound.");
91     }
92 }
93 
94 /* vim: set noet sw=4 ts=4: */
95