TECA
The Toolkit for Extreme Climate Analysis
teca_system_util Namespace Reference

Codes for dealing with low level system API's. More...

Functions

template<typename T >
TECA_EXPORT int get_environment_variable (const char *var, T &val)
 
TECA_EXPORT int get_command_line_option (int argc, char **argv, const char *arg_name, int require, std::string &arg_val)
 
TECA_EXPORT int command_line_option_check (int argc, char **argv, const char *arg_name)
 

Detailed Description

Codes for dealing with low level system API's.

Function Documentation

◆ command_line_option_check()

TECA_EXPORT int teca_system_util::command_line_option_check ( int  argc,
char **  argv,
const char *  arg_name 
)

check for the presence of the name command line option. return non-zero if it is found.

◆ get_command_line_option()

TECA_EXPORT int teca_system_util::get_command_line_option ( int  argc,
char **  argv,
const char *  arg_name,
int  require,
std::string &  arg_val 
)

extract the value of the named command line argument. return 0 if successful. If require is not zero then an error will be reported if the argument is not present.

◆ get_environment_variable()

template<typename T >
TECA_EXPORT int teca_system_util::get_environment_variable ( const char *  var,
T &  val 
)

initialize val with the environment variable named by var converted to a numeric type. Only floating point and signed integers are implemented. For unsigned types, check that the return is greater or equal to zero.

returns: 0 if the variable was found and val was initialized from it 1 if the varibale was not found -1 if the variable was found but conversion from string failed