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