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