[#BloombergLP-balcl] = xref:BloombergLP.adoc[BloombergLP]::balcl :relfileprefix: ../ :mrdocs: Namespace for command‐line parsing components. == Types [cols="1,4"] |=== | Name| Description | xref:BloombergLP/balcl/CommandLine.adoc[`CommandLine`] | This value‐semantic `class` parses, validates, and provides access to command‐line arguments. The constructor takes the specification describing the command‐line arguments. Once created, `printUsage` can be invoked to print the usage syntax. The `parse` method takes command‐line arguments and validates them against the specification provided at creation, writing a suitable message to an optionally‐specified stream in case of a parsing error. Once parsed, options and values can be accessed using various accessors. The class has a set of `theType` methods (e.g., `theString`, `theInt`) that provide access, by name, to the value of the indicated option. It is also possible to link a variable with an option in the specification; doing so will cause the variable to be loaded with the option value once `parse` has been invoked. The `options` method returns a `balcl::CommandLineOptionsHandle` object referring to the option names and their values. A similar but different method, `specifiedOptions`, is suitable for overwriting other configuration parameters (possibly obtained from a configuration file). | xref:BloombergLP/balcl/CommandLineOptionsHandle.adoc[`CommandLineOptionsHandle`] | This class provides access to the parsed options (if any) of its creating `CommandLine` object. The behavior is undefined if any of the methods of this class (accessors all) are invoked after a subsequent invocation of the `parse` method of the creating object or after the destruction of the creating object. | xref:BloombergLP/balcl/CommandLine_SchemaData.adoc[`CommandLine_SchemaData`] | This `struct`, a pure value‐semantic type, is used to manage option value type and name information in support of public interfaces to parsed options. See `CommandLineOptionsHandle`. | xref:BloombergLP/balcl/Constraint.adoc[`Constraint`] | This `struct` provides a namespace that defines the types used to impose user‐defined constraints on values associated with command‐line options. One type is defined for each scalar type defined in `balcl::OptionType` except for `bool`. | xref:BloombergLP/balcl/OccurrenceInfo.adoc[`OccurrenceInfo`] | This `class` is a simple attribute class that describes a command‐line option occurrence requirement (i.e., required, optional, or optional but hidden) and default value, if any. | xref:BloombergLP/balcl/Option.adoc[`Option`] | This `class`, constructible from and implicitly convertible to `OptionInfo`, provides the same attributes, but also uses a `bslma::Allocator` and thus can be stored in a container. A minor subtlety arises in the `name` attribute, whereby any suffix starting with an `=` sign in the `name` attribute of a `OptionInfo` is removed in order to derive the `name` of the `Option`. | xref:BloombergLP/balcl/OptionInfo.adoc[`OptionInfo`] | This `struct` is a simple attribute class that describes the information associated with an option, namely the associated tag (as a string, from which the short and long tags are extracted), the option name, the description used in printing usage, and optional associated `TypeInfo` and `OccurrenceInfo` objects. | xref:BloombergLP/balcl/OptionType.adoc[`OptionType`] | This `struct` provides a namespace for enumerating types used for command‐line option values. See {Enumerators} for details. | xref:BloombergLP/balcl/OptionValue.adoc[`OptionValue`] | This class implements a special‐use value‐semantic variant type used to represent values parsed from process command lines. Accordingly, this class can represent values of any of the types defined in `balcl_optiontype`. Furthermore, that value can also be in a null state (defined type but no defined value) to represent allowed options that do not appear among the command‐line arguments (and for which no default value has been configured). | xref:BloombergLP/balcl/OptionValue_NullOf.adoc[`OptionValue_NullOf`] | This single‐attribute class represents a null value of a given nullable `balcl::OptionType`. `OptionValue` uses this type to represent its state where there is a known type, but no value for it. Note that `OptionType::e_VOID` is _not_ nullable, therefore not supported here. Note that: There is no `swap` member or namespace‐level function declared (and defined) for this class on purpose, the general swap works fast for such a simple type. | xref:BloombergLP/balcl/TypeInfo.adoc[`TypeInfo`] | This `class` is a attribute class that describes the type, the variable to be linked, and the constraint on an option. Note that the constraint type is opaque, but it is possible to apply the constraint to an element of the same type as the option and see whether it is valid (using the `satisfiesConstraint` methods of `TypeInfoUtil`). | xref:BloombergLP/balcl/TypeInfoConstraint.adoc[`TypeInfoConstraint`] | Component‐private protocol class for opaque option value constraints. | xref:BloombergLP/balcl/TypeInfoUtil.adoc[`TypeInfoUtil`] | This utility `struct` provides a namespace for functions that perform non‐primitive operations using `TypeInfo` objects. |=== == Functions [cols="1,4"] |=== | Name| Description | xref:BloombergLP/balcl/swap.adoc[`swap`] | Swap the value of the specified `a` object with the value of the specified `b` object. This method provides the no‐throw exception‐safety guarantee if either `a.type()` is the same as `b.type()` and `a` and `b` were created with the same allocator, or neither `a.type()` nor `b.type()` is a type that requires allocation; otherwise, it provides the basic guarantee. | xref:BloombergLP/balcl/operator_lshift-07c.adoc[`operator<<`] | Stream insertion operators | xref:BloombergLP/balcl/operator_eq-08.adoc[`operator==`] | Equality operators | xref:BloombergLP/balcl/operator_not_eq-06957.adoc[`operator!=`] | Inequality operators |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#