00001 // this is for emacs file handling -*- mode: c++; indent-tabs-mode: nil -*- 00002 00003 // -- BEGIN LICENSE BLOCK ---------------------------------------------- 00004 // This file is part of FZIs ic_workspace. 00005 // 00006 // This program is free software licensed under the LGPL 00007 // (GNU LESSER GENERAL PUBLIC LICENSE Version 3). 00008 // You can find a copy of this license in LICENSE folder in the top 00009 // directory of the source code. 00010 // 00011 // © Copyright 2014 FZI Forschungszentrum Informatik, Karlsruhe, Germany 00012 // 00013 // -- END LICENSE BLOCK ------------------------------------------------ 00014 00015 //---------------------------------------------------------------------- 00021 //---------------------------------------------------------------------- 00022 #include "icl_core_config/GetoptParameter.h" 00023 00024 namespace icl_core { 00025 namespace config { 00026 00027 GetoptParameter::GetoptParameter(const icl_core::String& option, const icl_core::String& short_option, 00028 const icl_core::String& help, bool is_prefix) 00029 : m_short_option(short_option), 00030 m_help(help), 00031 m_is_prefix(is_prefix) 00032 { 00033 if (!option.empty() && *option.rbegin() == ':') 00034 { 00035 m_option = option.substr(0, option.length() - 1); 00036 m_has_value = true; 00037 } 00038 else 00039 { 00040 m_option = option; 00041 m_has_value = false; 00042 } 00043 } 00044 00046 #ifdef _IC_BUILDER_DEPRECATED_STYLE_ 00047 00051 icl_core::String GetoptParameter::Option() const 00052 { 00053 return option(); 00054 } 00058 icl_core::String GetoptParameter::ShortOption() const 00059 { 00060 return shortOption(); 00061 } 00065 bool GetoptParameter::HasValue() const 00066 { 00067 return hasValue(); 00068 } 00072 icl_core::String GetoptParameter::Help() const 00073 { 00074 return help(); 00075 } 00076 00080 bool GetoptParameter::IsPrefixOption() const 00081 { 00082 return isPrefixOption(); 00083 } 00084 00085 #endif 00086 00087 00088 } 00089 }