API used by sample programs (and internally) to track arbitrary properties.
More...
API used by sample programs (and internally) to track arbitrary properties.
◆ ato_arg_add()
ATO_EXPORT void ato_arg_add |
( |
const char * |
name, |
|
|
bool |
required, |
|
|
const char * |
defvalue, |
|
|
const char * |
allowedvalues, |
|
|
const char * |
help |
|
) |
| |
Add a new argument/property.
- Parameters
-
name | the name of the property |
required | when checking indicate if this property must have a value supplied. |
defvalue | value to use if not set. |
allowedvalues | comma delimited list of predefined values |
help | help string to display if asked |
◆ ato_arg_process()
ATO_EXPORT bool ato_arg_process |
( |
int |
argc, |
|
|
const char * |
argv[] |
|
) |
| |
Add the standard C args as properties.
- Parameters
-
argc | the number of args |
argv | array of args prefixed with - or @ (@ starts reading from argfile e.g. @argfile). |
- Returns
- TRUE if no errors in loading args
◆ ato_arg_usage()
ATO_EXPORT void ato_arg_usage |
( |
const char * |
appname | ) |
|
Print usage/help for known properties to the Console.
- Parameters
-
appname | the name of the calling program |
◆ ato_arg_check()
ATO_EXPORT bool ato_arg_check |
( |
void |
| ) |
|
Check that all args/properties are valid.
- Returns
- TRUE if all args have valid values
◆ ato_arg_value_set()
ATO_EXPORT const char* ato_arg_value_set |
( |
const char * |
name, |
|
|
const char * |
value |
|
) |
| |
Reset the value of the property.
- Parameters
-
name | the name of property |
value | the va;ue of property |
- Returns
- property value or NULL if not found
◆ ato_arg_value()
ATO_EXPORT const char* ato_arg_value |
( |
const char * |
name | ) |
|
Get the property value.
- Parameters
-
- Returns
- The property value or NULL if not found
◆ ato_arg_value_bool()
ATO_EXPORT bool ato_arg_value_bool |
( |
const char * |
name | ) |
|
Get the property value.
- Parameters
-
- Returns
- The property value as a bool or FALSE
◆ ato_arg_value_int()
ATO_EXPORT int ato_arg_value_int |
( |
const char * |
name | ) |
|
Get the property value as an in.
- Parameters
-
- Returns
- The property value as an int or 0