Package org.robwork.sdurw_common
Class ProgramOptions
- java.lang.Object
-
- org.robwork.sdurw_common.ProgramOptions
-
public class ProgramOptions extends java.lang.Object
a class for parsing program command line into a PropertyMap
-
-
Constructor Summary
Constructors Constructor Description ProgramOptions(long cPtr, boolean cMemoryOwn)
ProgramOptions(java.lang.String applicationName, java.lang.String version)
Construct new set of program options.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addBoolOption(java.lang.String name, boolean defval, java.lang.String desc)
add a bool option that is only allowed to occur once on the command linevoid
addStringOption(java.lang.String name, java.lang.String defval, java.lang.String desc)
add a string option that is only allowed to occur once on the command linevoid
delete()
static long
getCPtr(ProgramOptions obj)
SWIGTYPE_p_boost__program_options__options_description
getOptionDescription()
Get the underlying program options description from boost.SWIGTYPE_p_boost__program_options__positional_options_description
getPosOptionDescription()
Get the underlying positional program options description from boost.PropertyMap
getPropertyMap()
Get parsed properties in RobWork format in the form of a PropertyMap.void
initOptions()
this initialize default options that can add simple properties to the propertymap.int
parse(int argc, SWIGTYPE_p_p_char argv)
parses input, ifint
parse(java.lang.String string)
Parses input from a string.void
setPositionalOption(java.lang.String name, int i)
Set name of option number i.
-
-
-
Constructor Detail
-
ProgramOptions
public ProgramOptions(long cPtr, boolean cMemoryOwn)
-
ProgramOptions
public ProgramOptions(java.lang.String applicationName, java.lang.String version)
Construct new set of program options.- Parameters:
applicationName
- [in] the name of the application.version
- [in] the version of the application.
-
-
Method Detail
-
getCPtr
public static long getCPtr(ProgramOptions obj)
-
delete
public void delete()
-
initOptions
public void initOptions()
this initialize default options that can add simple properties to the propertymap.
-
addStringOption
public void addStringOption(java.lang.String name, java.lang.String defval, java.lang.String desc)
add a string option that is only allowed to occur once on the command line- Parameters:
name
- [in] name of optiondefval
- [in] the default string value if anydesc
- [in] description of commandline option
-
addBoolOption
public void addBoolOption(java.lang.String name, boolean defval, java.lang.String desc)
add a bool option that is only allowed to occur once on the command line- Parameters:
name
- [in] name of optiondefval
- [in] the default value when arg not presentdesc
- [in] description of commandline option
-
setPositionalOption
public void setPositionalOption(java.lang.String name, int i)
Set name of option number i.- Parameters:
name
- [in] the name.i
- [in] index of the option.
-
parse
public int parse(int argc, SWIGTYPE_p_p_char argv)
parses input, if- Parameters:
argc
-argv
-- Returns:
- if 0 is returned then help or an error
-
parse
public int parse(java.lang.String string)
Parses input from a string.- Parameters:
string
- [in] input line.- Returns:
- 0 if success.
-
getOptionDescription
public SWIGTYPE_p_boost__program_options__options_description getOptionDescription()
Get the underlying program options description from boost.- Returns:
- reference to options_description.
-
getPosOptionDescription
public SWIGTYPE_p_boost__program_options__positional_options_description getPosOptionDescription()
Get the underlying positional program options description from boost.- Returns:
- reference to positional_options_description.
-
getPropertyMap
public PropertyMap getPropertyMap()
Get parsed properties in RobWork format in the form of a PropertyMap.- Returns:
- the property map with parsed options.
-
-