KJB
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Static Public Member Functions | List of all members
spear::Parameters Class Reference

#include <Parameters.h>

Static Public Member Functions

static void read (const std::string &file, bool overwrite=false)
 
static int read (int argc, char **argv)
 
static void display (OStream &os)
 
static void set (const String &name, const String &value)
 
static bool get (const String &name, String &value, bool useEnvironment=true)
 
static bool get (const String &name, double &value, bool useEnvironment=true)
 
static bool get (const String &name, int &value, bool useEnvironment=true)
 
static bool contains (const String &name)
 

Member Function Documentation

static bool spear::Parameters::contains ( const String name)
inlinestatic
void Parameters::display ( OStream os)
static
bool Parameters::get ( const String name,
String value,
bool  useEnvironment = true 
)
static

Fetches the value of a parameter If the parameter is not found in the hash, the environment is inspected

bool Parameters::get ( const String name,
double &  value,
bool  useEnvironment = true 
)
static

Fetches a double parameter

bool Parameters::get ( const String name,
int &  value,
bool  useEnvironment = true 
)
static

Fetches a int parameter

void Parameters::read ( const std::string &  file,
bool  overwrite = false 
)
static

Reads parameters from a file

int Parameters::read ( int  argc,
char **  argv 
)
static

Reads parameters from the command line, in the form "--name=value", or in the form "--name", which assumes a default value of 1 The "config" parameter has a special meaning: if set it points to a configuration file containing other settings that are automatically read using the above read method with overwrite set to false

Returns
A positive integer representing the first free position in the argument array. If some error occured, a Boolean exception is thrown out of this method
static void spear::Parameters::set ( const String name,
const String value 
)
inlinestatic

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