24 #ifndef TCLAP_SWITCH_ARG_H
25 #define TCLAP_SWITCH_ARG_H
69 const std::string& name,
70 const std::string& desc,
89 const std::string& name,
90 const std::string& desc,
104 virtual bool processArg(
int* i, std::vector<std::string>& args);
117 virtual void reset();
124 bool lastCombined(std::string& combined);
129 void commonProcessing();
136 const std::string& name,
137 const std::string& desc,
140 :
Arg(flag, name, desc, false, false, v),
141 _value( default_val ),
142 _default( default_val )
146 const std::string& name,
147 const std::string& desc,
151 :
Arg(flag, name, desc, false, false, v),
152 _value( default_val ),
153 _default(default_val)
160 inline bool SwitchArg::lastCombined(std::string& combinedSwitches )
162 for (
unsigned int i = 1; i < combinedSwitches.length(); i++ )
172 if ( combinedSwitches.length() > 0 &&
182 if ( combinedSwitches.find_first_of(
Arg::delimiter() ) != std::string::npos )
187 for (
unsigned int i = 1; i < combinedSwitches.length(); i++ )
188 if (
_flag.length() > 0 &&
189 combinedSwitches[i] ==
_flag[0] &&
204 inline void SwitchArg::commonProcessing()
208 "Mutually exclusive argument already set!",
toString()));
249 return lastCombined( args[*i] );