#include <Options.h>
Definition at line 247 of file Options.h.
◆ Int64Option()
Definition at line 254 of file Options.h.
Option(const char *name_, const char *desc_, const char *cate_, const char *type_)
◆ help()
| virtual void Gluco::Int64Option::help |
( |
bool | verbose = false | ) |
|
|
inlinevirtual |
Implements Gluco::Option.
Definition at line 284 of file Options.h.
284 {
286 if (
range.begin == INT64_MIN)
287 fprintf(stderr, "imin");
288 else
289 fprintf(stderr,
"%4d", (
int)
range.begin);
290
291 fprintf(stderr, " .. ");
292 if (
range.end == INT64_MAX)
293 fprintf(stderr, "imax");
294 else
295 fprintf(stderr,
"%4d", (
int)
range.end);
296
297 fprintf(stderr,
"] (default: %d)\n", (
int)
value);
298 if (verbose){
300 fprintf(stderr, "\n");
301 }
302 }
◆ operator int64_t()
| Gluco::Int64Option::operator int64_t |
( |
void | | ) |
const |
|
inline |
◆ operator int64_t &()
| Gluco::Int64Option::operator int64_t & |
( |
void | | ) |
|
|
inline |
◆ operator=()
| Int64Option & Gluco::Int64Option::operator= |
( |
int64_t | x | ) |
|
|
inline |
◆ parse()
| virtual bool Gluco::Int64Option::parse |
( |
const char * | str | ) |
|
|
inlinevirtual |
Implements Gluco::Option.
Definition at line 261 of file Options.h.
261 {
262 const char* span = str;
263
264 if (!match(span,
"-") || !match(span,
name) || !match(span,
"="))
265 return false;
266
267 char* end;
268 int64_t tmp = strtoll(span, &end, 10);
269
270 if (end == NULL)
271 return false;
272 else if (tmp >
range.end){
273 fprintf(stderr,
"ERROR! value <%s> is too large for option \"%s\".\n", span,
name);
275 }
else if (tmp <
range.begin){
276 fprintf(stderr,
"ERROR! value <%s> is too small for option \"%s\".\n", span,
name);
278
280
281 return true;
282 }
◆ range
◆ value
| int64_t Gluco::Int64Option::value |
|
protected |
The documentation for this class was generated from the following file: