PCL
|
Classes | |
class | pcl::Argument |
A command-line argument. More... | |
class | argument_item_mode |
Represents an ArgumentItemMode enumerated value. More... | |
class | ArgumentList |
A dynamic array of command-line arguments. More... | |
class | ArgumentOptions |
A combination of ArgumentOption flags. More... | |
Functions | |
ArgumentList PCL_FUNC | pcl::ExtractArguments (const StringList &argv, argument_item_mode mode=ArgumentItemMode::Ignore, ArgumentOptions options=ArgumentOptions()) |
String PCL_FUNC | pcl::RecursiveDirSearchArgument () |
String PCL_FUNC | pcl::ReplaceEnvironmentVariables (const String &s) |
StringList PCL_FUNC | pcl::SearchDirectory (const String &filePath, bool recursive=false) |
void PCL_FUNC | pcl::SetRecursiveDirSearchArgument (const String &id) |
ArgumentList PCL_FUNC pcl::ExtractArguments | ( | const StringList & | argv, |
argument_item_mode | mode = ArgumentItemMode::Ignore , |
||
ArgumentOptions | options = ArgumentOptions() |
||
) |
Extracts a sequence of command-line arguments of the form:
[<arg_list>] [<item_list>]
where:
<item_list>
Is a sequence <item> [<item_list>]
<item>
Is a non-parametric (or "item") argument. If file parsing is active (see the mode parameter below), each item will be parsed as a file path specification. If view parsing is active, items will be considered as view identifiers. In both cases, each item may include wildcards to define a search pattern, which will be automatically expanded into a sequence of actual file paths or view identifiers.
<arg_list>
Is a sequence <arg> [<arg_list>]
<arg>
Is a parametric argument (see the documentation for the Argument class for a complete description).
argv | The list of input argument tokens that will be parsed. | ||||
mode | Indicates how non-parametric items will be handled by this function. mode must have one of the following values:
| ||||
options | This is an OR'ed combination of flags from the ArgumentOption enumeration:
|
This function generates a ParseError exception when it encounters an error while parsing the sequence of input arguments.
Returns a list with all the arguments extracted from the input argv sequence as instances of the Argument class. If non-parametric arguments are being interpreted as file paths, each non-parametric item is expanded to its corresponding full file path. If non-parametric arguments are being parsed as view identifiers, each non-parametric item is replaced (if appropriate) by its full view identifier. Otherwise, non-parametric items are returned unchanged.
String PCL_FUNC pcl::RecursiveDirSearchArgument | ( | ) |
Returns the identifier of the argument used by ExtractArguments() for automatic toggle of recursive directory searches. By default, this is the –r[+|-]
argument.
Returns a copy of a source string s where all references to environment variables have been replaced with their corresponding values.
This function finds all occurrences of environment variables of the form:
$<env_name>
where <env_name> is any sequence of alphabetic, decimal, or underscore characters. If <env_name> corresponds to an existing environment variable of the calling process, the entire $<env_name> sequence is replaced with the variable's value. References to nonexistent environment variables, as well as empty references (isolated $ characters), are replaced with an empty string (removed).
This function works recursively: it can replace environment variables inside the values of environment variables. The routine performs replacements recursively until no $ character is found in the string.
StringList PCL_FUNC pcl::SearchDirectory | ( | const String & | filePath, |
bool | recursive = false |
||
) |
Auxiliary directory search routine used by ExtractArguments().
Returns a list of full file paths corresponding to a template wild file specification (filePath), optionally recursing the directory tree, starting from the directory specified in filePath.
void PCL_FUNC pcl::SetRecursiveDirSearchArgument | ( | const String & | id | ) |
Sets the identifier of the argument used by ExtractArguments() for automatic toggle of recursive directory searches.
id | New identifier for the automatic recursive search argument. N.B.: When specifying this argument, don't include the '-' standard parameter prefix. |