GetoptParameter.cpp
Go to the documentation of this file.
1 // this is for emacs file handling -*- mode: c++; indent-tabs-mode: nil -*-
2 
3 // -- BEGIN LICENSE BLOCK ----------------------------------------------
4 // This file is part of FZIs ic_workspace.
5 //
6 // This program is free software licensed under the LGPL
7 // (GNU LESSER GENERAL PUBLIC LICENSE Version 3).
8 // You can find a copy of this license in LICENSE folder in the top
9 // directory of the source code.
10 //
11 // © Copyright 2016 FZI Forschungszentrum Informatik, Karlsruhe, Germany
12 //
13 // -- END LICENSE BLOCK ------------------------------------------------
14 
15 //----------------------------------------------------------------------
21 //----------------------------------------------------------------------
23 
24 namespace icl_core {
25 namespace config {
26 
28  const icl_core::String& help, bool is_prefix)
29  : m_short_option(short_option),
30  m_help(help),
31  m_is_prefix(is_prefix)
32 {
33  if (!option.empty() && *option.rbegin() == ':')
34  {
35  m_option = option.substr(0, option.length() - 1);
36  m_has_value = true;
37  }
38  else
39  {
40  m_option = option;
41  m_has_value = false;
42  }
43 }
44 
46 #ifdef _IC_BUILDER_DEPRECATED_STYLE_
47 
51 icl_core::String GetoptParameter::Option() const
52 {
53  return option();
54 }
58 icl_core::String GetoptParameter::ShortOption() const
59 {
60  return shortOption();
61 }
65 bool GetoptParameter::HasValue() const
66 {
67  return hasValue();
68 }
72 icl_core::String GetoptParameter::Help() const
73 {
74  return help();
75 }
76 
80 bool GetoptParameter::IsPrefixOption() const
81 {
82  return isPrefixOption();
83 }
84 
85 #endif
86 
88 }
89 }
bool hasValue() const
Check if the option also expects a value.
Contains GetoptParameter.
bool isPrefixOption() const
Check if this is a prefix option.
GetoptParameter(const icl_core::String &option, const icl_core::String &short_option, const icl_core::String &help, bool is_prefix=false)
icl_core::String option() const
Get the long option name.
std::string String
Definition: BaseTypes.h:43
icl_core::String shortOption() const
Get the short option name.
icl_core::String help() const
Get the help text.


fzi_icl_core
Author(s):
autogenerated on Mon Jun 10 2019 13:17:58