#include <Options.h>
Definition at line 185 of file Options.h.
◆ IntOption()
Definition at line 192 of file Options.h.
Option(const char *name_, const char *desc_, const char *cate_, const char *type_)
◆ help()
| virtual void Gluco2::IntOption::help |
( |
bool | verbose = false | ) |
|
|
inlinevirtual |
Implements Gluco2::Option.
Definition at line 222 of file Options.h.
222 {
225 fprintf(stderr, "imin");
226 else
227 fprintf(stderr,
"%4d",
range.begin);
228
229 fprintf(stderr, " .. ");
231 fprintf(stderr, "imax");
232 else
233 fprintf(stderr,
"%4d",
range.end);
234
235 fprintf(stderr,
"] (default: %d)\n",
value);
236 if (verbose){
238 fprintf(stderr, "\n");
239 }
240 }
◆ operator int32_t()
| Gluco2::IntOption::operator int32_t |
( |
void | | ) |
const |
|
inline |
◆ operator int32_t &()
| Gluco2::IntOption::operator int32_t & |
( |
void | | ) |
|
|
inline |
◆ operator=()
| IntOption & Gluco2::IntOption::operator= |
( |
int32_t | x | ) |
|
|
inline |
◆ parse()
| virtual bool Gluco2::IntOption::parse |
( |
const char * | str | ) |
|
|
inlinevirtual |
Implements Gluco2::Option.
Definition at line 199 of file Options.h.
199 {
200 const char* span = str;
201
202 if (!match(span,
"-") || !match(span,
name) || !match(span,
"="))
203 return false;
204
205 char* end;
206 int32_t tmp = strtol(span, &end, 10);
207
208 if (end == NULL)
209 return false;
210 else if (tmp >
range.end){
211 fprintf(stderr,
"ERROR! value <%s> is too large for option \"%s\".\n", span,
name);
213 }
else if (tmp <
range.begin){
214 fprintf(stderr,
"ERROR! value <%s> is too small for option \"%s\".\n", span,
name);
216
218
219 return true;
220 }
◆ range
◆ value
| int32_t Gluco2::IntOption::value |
|
protected |
The documentation for this class was generated from the following file: