20 #ifndef Minisat_Options_h
21 #define Minisat_Options_h
59 static const char* usage_str;
65 static const char* help_prefix_str =
"";
66 return help_prefix_str;
78 Option(
const char* name_,
const char* desc_,
const char* cate_,
const char* type_ ):
90 virtual void help(
bool verbose =
false ) = 0;
151 double def =
double(),
163 operator double(
void )
const
174 virtual void help(
bool verbose =
false )
177 " -%-12s = %-8s %c%4.2g .. %4.2g%c (default: %g)\n",
188 fprintf( stderr,
"\n" );
205 Option( n, d, c,
"<int32>" ),
210 operator int32_t(
void )
const
221 virtual void help(
bool verbose =
false )
225 fprintf( stderr,
"imin" );
229 fprintf( stderr,
" .. " );
231 fprintf( stderr,
"imax" );
233 fprintf( stderr,
"%4d",
range.
end );
235 fprintf( stderr,
"] (default: %d)\n",
value );
239 fprintf( stderr,
"\n" );
253 StringOption(
const char* c,
const char* n,
const char* d,
const char* def = NULL ):
254 Option( n, d, c,
"<string>" ),
258 operator const char*( void )
const
269 virtual void help(
bool verbose =
false )
275 fprintf( stderr,
"\n" );
289 BoolOption(
const char* c,
const char* n,
const char* d,
bool v ):
290 Option( n, d, c,
"<bool>" ),
294 operator bool(
void )
const
305 virtual void help(
bool verbose =
false )
307 fprintf( stderr,
" -%s, -no-%s",
name,
name );
309 for( uint32_t i = 0; i < 32 - strlen(
name ) * 2; i++ )
310 fprintf( stderr,
" " );
312 fprintf( stderr,
" " );
313 fprintf( stderr,
"(default: %s)\n",
value ?
"on" :
"off" );
317 fprintf( stderr,
"\n" );
BoolOption(const char *c, const char *n, const char *d, bool v)
virtual void help(bool verbose=false)
BoolOption & operator=(bool b)
virtual void help(bool verbose=false)
DoubleOption & operator=(double x)
DoubleOption(const char *c, const char *n, const char *d, double def=double(), DoubleRange r=DoubleRange(-HUGE_VAL, false, HUGE_VAL, false))
IntOption(const char *c, const char *n, const char *d, int32_t def=int32_t(), IntRange r=IntRange(INT_MIN, INT_MAX))
IntOption & operator=(int32_t x)
virtual void help(bool verbose=false)
static const char *& getHelpPrefixString()
static vec< Option * > & getOptionList()
virtual void help(bool verbose=false)=0
Option(const char *name_, const char *desc_, const char *cate_, const char *type_)
friend void printUsageAndExit(int argc, char **argv, bool verbose)
static const char *& getUsageString()
friend void setHelpPrefixStr(const char *str)
friend void setUsageHelp(const char *str)
StringOption & operator=(const char *x)
virtual void help(bool verbose=false)
StringOption(const char *c, const char *n, const char *d, const char *def=NULL)
void setUsageHelp(const char *str)
void printUsageAndExit(int argc, char **argv, bool verbose=false)
void setHelpPrefixStr(const char *str)
DoubleRange(double b, bool binc, double e, bool einc)
Int64Range(int64_t b, int64_t e)
bool operator()(const Option *x, const Option *y)