ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
Gluco2::BoolOption Class Reference

#include <Options.h>

Inheritance diagram for Gluco2::BoolOption:
Collaboration diagram for Gluco2::BoolOption:

Public Member Functions

 BoolOption (const char *c, const char *n, const char *d, bool v)
 
 operator bool (void) const
 
 operator bool & (void)
 
BoolOptionoperator= (bool b)
 
virtual bool parse (const char *str)
 
virtual void help (bool verbose=false)
 
- Public Member Functions inherited from Gluco2::Option
 Option (const char *name_, const char *desc_, const char *cate_, const char *type_)
 
virtual ~Option ()
 

Additional Inherited Members

- Static Public Member Functions inherited from Gluco2::Option
static vec< Option * > & getOptionList ()
 
static const char *& getUsageString ()
 
static const char *& getHelpPrefixString ()
 
- Public Attributes inherited from Gluco2::Option
const char * name
 
const char * description
 
const char * category
 
const char * type_name
 

Detailed Description

Definition at line 345 of file Options.h.

Constructor & Destructor Documentation

◆ BoolOption()

Gluco2::BoolOption::BoolOption ( const char * c,
const char * n,
const char * d,
bool v )
inline

Definition at line 350 of file Options.h.

351 : Option(n, d, c, "<bool>"), value(v) {}
Option(const char *name_, const char *desc_, const char *cate_, const char *type_)
Definition Options.h:71
Here is the call graph for this function:
Here is the caller graph for this function:

Member Function Documentation

◆ help()

virtual void Gluco2::BoolOption::help ( bool verbose = false)
inlinevirtual

Implements Gluco2::Option.

Definition at line 371 of file Options.h.

371 {
372
373 fprintf(stderr, " -%s, -no-%s", name, name);
374
375 for (uint32_t i = 0; i < 32 - strlen(name)*2; i++)
376 fprintf(stderr, " ");
377
378 fprintf(stderr, " ");
379 fprintf(stderr, "(default: %s)\n", value ? "on" : "off");
380 if (verbose){
381 fprintf(stderr, "\n %s\n", description);
382 fprintf(stderr, "\n");
383 }
384 }
unsigned int uint32_t
Definition Fxch.h:32
const char * name
Definition Options.h:55
const char * description
Definition Options.h:56
int strlen()
Here is the call graph for this function:

◆ operator bool()

Gluco2::BoolOption::operator bool ( void ) const
inline

Definition at line 353 of file Options.h.

353{ return value; }

◆ operator bool &()

Gluco2::BoolOption::operator bool & ( void )
inline

Definition at line 354 of file Options.h.

354{ return value; }

◆ operator=()

BoolOption & Gluco2::BoolOption::operator= ( bool b)
inline

Definition at line 355 of file Options.h.

355{ value = b; return *this; }
Here is the call graph for this function:

◆ parse()

virtual bool Gluco2::BoolOption::parse ( const char * str)
inlinevirtual

Implements Gluco2::Option.

Definition at line 357 of file Options.h.

357 {
358 const char* span = str;
359
360 if (match(span, "-")){
361 bool b = !match(span, "no-");
362
363 if (strcmp(span, name) == 0){
364 value = b;
365 return true; }
366 }
367
368 return false;
369 }
int strcmp()
Here is the call graph for this function:

The documentation for this class was generated from the following file: