abc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Minisat::BoolOption Class Reference

#include <Options.h>

Inherits Minisat::Option.

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)
 

Static Public Member Functions

static vec< Option * > & getOptionList ()
 
static const char *& getUsageString ()
 
static const char *& getHelpPrefixString ()
 

Data Fields

const char * name
 
const char * description
 
const char * category
 
const char * type_name
 

Private Attributes

bool value
 

Detailed Description

Definition at line 342 of file Options.h.

Constructor & Destructor Documentation

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

Definition at line 347 of file Options.h.

348  : Option(n, d, c, "<bool>"), value(v) {}
Option(const char *name_, const char *desc_, const char *cate_, const char *type_)
Definition: Options.h:67

Member Function Documentation

static const char*& Minisat::Option::getHelpPrefixString ( )
inlinestaticinherited

Definition at line 58 of file Options.h.

58 { static const char* help_prefix_str = ""; return help_prefix_str; }
static vec<Option*>& Minisat::Option::getOptionList ( )
inlinestaticinherited

Definition at line 56 of file Options.h.

56 { static vec<Option*> options; return options; }
static const char*& Minisat::Option::getUsageString ( )
inlinestaticinherited

Definition at line 57 of file Options.h.

57 { static const char* usage_str; return usage_str; }
virtual void Minisat::BoolOption::help ( bool  verbose = false)
inlinevirtual

Implements Minisat::Option.

Definition at line 368 of file Options.h.

368  {
369 
370  fprintf(stderr, " -%s, -no-%s", name, name);
371 
372  for (uint32_t i = 0; i < 32 - strlen(name)*2; i++)
373  fprintf(stderr, " ");
374 
375  fprintf(stderr, " ");
376  fprintf(stderr, "(default: %s)\n", value ? "on" : "off");
377  if (verbose){
378  fprintf(stderr, "\n %s\n", description);
379  fprintf(stderr, "\n");
380  }
381  }
const char * name
Definition: Options.h:51
int strlen()
const char * description
Definition: Options.h:52
Minisat::BoolOption::operator bool ( void  ) const
inline

Definition at line 350 of file Options.h.

350 { return value; }
Minisat::BoolOption::operator bool & ( void  )
inline

Definition at line 351 of file Options.h.

351 { return value; }
BoolOption& Minisat::BoolOption::operator= ( bool  b)
inline

Definition at line 352 of file Options.h.

352 { value = b; return *this; }
virtual bool Minisat::BoolOption::parse ( const char *  str)
inlinevirtual

Implements Minisat::Option.

Definition at line 354 of file Options.h.

354  {
355  const char* span = str;
356 
357  if (match(span, "-")){
358  bool b = !match(span, "no-");
359 
360  if (strcmp(span, name) == 0){
361  value = b;
362  return true; }
363  }
364 
365  return false;
366  }
const char * name
Definition: Options.h:51
int strcmp()
static bool match(B &in, const char *str)
Definition: ParseUtils.h:99

Field Documentation

const char* Minisat::Option::category
inherited

Definition at line 53 of file Options.h.

const char* Minisat::Option::description
inherited

Definition at line 52 of file Options.h.

const char* Minisat::Option::name
inherited

Definition at line 51 of file Options.h.

const char* Minisat::Option::type_name
inherited

Definition at line 54 of file Options.h.

bool Minisat::BoolOption::value
private

Definition at line 344 of file Options.h.


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