BDE 4.39.x Production Release
Loading...
Searching...
No Matches
balcl.h
Go to the documentation of this file.
1/// @file balcl.h
2///
3///
4/// @defgroup balcl Package balcl
5/// @brief Basic Application Library Command Line (balcl)
6/// @addtogroup bal
7/// @{
8/// @addtogroup balcl
9/// @{
10/// * <a href="#balcl-purpose"> Purpose</a>
11/// * <a href="#balcl-mnemonic"> Mnemonic </a>
12/// * <a href="#balcl-description"> Description </a>
13/// * <a href="#balcl-overview"> Overview </a>
14/// * <a href="#balcl-option-attributes"> Option Attributes </a>
15/// * <a href="#balcl-hierarchical-synopsis"> Hierarchical Synopsis </a>
16/// * <a href="#balcl-component-synopsis"> Component Synopsis </a>
17///
18/// # Purpose {#balcl-purpose}
19/// Provide facility to parse process command-line arguments.
20///
21/// # Mnemonic {#balcl-mnemonic}
22/// Basic Application Library Command Line (balcl)
23///
24/// # Description {#balcl-description}
25/// The `balcl` package provides a set of components that enable
26/// users to access information from the process's command line via a
27/// value-semantic class, `balcl::CommandLine`.
28/// Full details can be found in the documentation of @ref balcl_commandline and
29/// the other components of this package.
30///
31/// ## Overview {#balcl-overview}
32///
33/// There are several steps to using `balcl::CommandLine`:
34///
35/// 1. Specify the set of command-line options (and their attributes) that are
36/// allowed on the command line by creation of a table of `balcl::OptionInfo`
37/// or `balcl::Option` objects. See {Option Attributes} below.
38///
39/// 2. Create a `balcl::CommandLine` object from the command-line-option
40/// specification table.
41///
42/// 3. Pass command-line information (i.e., `argv`) to the `parse` method of the
43/// `balcl::CommandLine` object.
44///
45/// 4. If the `parse` method is successful, use `balcl::CommandLine` accessors or
46/// the accessors of a returned `balcl::CommandLineOptionsHandle` object. Note
47/// that options that were defined by the user but did not appear in the
48/// command line (i.e., the input to `parse`) are left in a "null" state unless
49/// the user also defined a default value for the option (see
50/// @ref balcl-option-attributes ).
51///
52/// ## Option Attributes {#balcl-option-attributes}
53///
54/// This package provides a rich set of features for users to define their
55/// allowed options. These include:
56///
57/// * The names by which the option can be specified on the command line (a long
58/// tag name and, optionally, a short tag name) as well as a separate name by
59/// which, after a successful parse, the value of the option can be
60/// programmatically accessed.
61///
62/// * A description that is later used by the `printUsage` method.
63///
64/// * Whether or not the option must appear on the command line for a successful
65/// parse.
66///
67/// * Whether or not the option description will be included in the output
68/// of the `printUsage` method.
69///
70/// * Is the option a simple "flag" (a boolean option, either present on the
71/// command line or not) or does the option have a value?
72///
73/// * If the option has a value, the user can specify:
74/// - The type of the option value.
75/// - Whether the option value is scalar or an array.
76/// - Optionally: A default value for the option.
77/// - Optionally: A user-supplied functor (a "constraint") to validate the
78/// value.
79///
80/// * Optionally, the user can supply the address of a variable that is "linked"
81/// to the option. If so, after a successful parse, the option value can be
82/// obtained from the variable (an alternative to using the
83/// `balcl::CommandLine` accessors).
84///
85/// ## Hierarchical Synopsis {#balcl-hierarchical-synopsis}
86///
87/// The 'balcl' package currently has 8 components having 6 levels of physical
88/// dependency. The list below shows the hierarchical ordering of the components.
89/// The order of components within each level is not architecturally significant,
90/// just alphabetical.
91/// @code
92/// 6. balcl_commandline
93///
94/// 5. balcl_option
95///
96/// 4. balcl_optioninfo
97///
98/// 3. balcl_occurrenceinfo
99/// balcl_typeinfo
100///
101/// 2. balcl_optionvalue
102///
103/// 1. balcl_constraint
104/// balcl_optiontype
105/// @endcode
106///
107/// ## Component Synopsis {#balcl-component-synopsis}
108///
109/// @ref balcl_commandline :
110/// Provide command line parsing, validation, and access.
111///
112/// @ref balcl_constraint :
113/// Define constraint function signatures for supported value types.
114///
115/// @ref balcl_occurrenceinfo :
116/// Provide a type describing requirement and default value of option.
117///
118/// @ref balcl_option :
119/// Provide an allocator-aware command-line-option descriptor class.
120///
121/// @ref balcl_optioninfo :
122/// Provide a POD command-line-option descriptor `struct`.
123///
124/// @ref balcl_optiontype :
125/// Enumerate the types supported for command-line-option values.
126///
127/// @ref balcl_optionvalue :
128/// Provide a variant type for command-line-option values.
129///
130/// @ref balcl_typeinfo :
131/// Provide a class describing an option's type and other attributes.
132///
133/// @}
134/** @} */