[#BloombergLP-balcl]
= xref:BloombergLP.adoc[BloombergLP]::balcl
:relfileprefix: ../
:mrdocs:

Namespace for command&hyphen;line parsing components&period;

== Types

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/balcl/CommandLine.adoc[`CommandLine`] 
| This value&hyphen;semantic `class` parses, validates, and provides access to command&hyphen;line arguments&period; The constructor takes the specification describing the command&hyphen;line arguments&period; Once created, `printUsage` can be invoked to print the usage syntax&period; The `parse` method takes command&hyphen;line arguments and validates them against the specification provided at creation, writing a suitable message to an optionally&hyphen;specified stream in case of a parsing error&period; Once parsed, options and values can be accessed using various accessors&period; The class has a set of `theType` methods (e&period;g&period;, `theString`, `theInt`) that provide access, by name, to the value of the indicated option&period; It is also possible to link a variable with an option in the specification&semi; doing so will cause the variable to be loaded with the option value once `parse` has been invoked&period; The `options` method returns a `balcl&colon;&colon;CommandLineOptionsHandle` object referring to the option names and their values&period; A similar but different method, `specifiedOptions`, is suitable for overwriting other configuration parameters (possibly obtained from a configuration file)&period;
| xref:BloombergLP/balcl/CommandLineOptionsHandle.adoc[`CommandLineOptionsHandle`] 
| This class provides access to the parsed options (if any) of its creating `CommandLine` object&period; 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&period;
| xref:BloombergLP/balcl/CommandLine_SchemaData.adoc[`CommandLine&lowbar;SchemaData`] 
| This `struct`, a pure value&hyphen;semantic type, is used to manage option value type and name information in support of public interfaces to parsed options&period; See `CommandLineOptionsHandle`&period;
| xref:BloombergLP/balcl/Constraint.adoc[`Constraint`] 
| This `struct` provides a namespace that defines the types used to impose user&hyphen;defined constraints on values associated with command&hyphen;line options&period; One type is defined for each scalar type defined in `balcl&colon;&colon;OptionType` except for `bool`&period;
| xref:BloombergLP/balcl/OccurrenceInfo.adoc[`OccurrenceInfo`] 
| This `class` is a simple attribute class that describes a command&hyphen;line option occurrence requirement (i&period;e&period;, required, optional, or optional but hidden) and default value, if any&period;
| xref:BloombergLP/balcl/Option.adoc[`Option`] 
| This `class`, constructible from and implicitly convertible to `OptionInfo`, provides the same attributes, but also uses a `bslma&colon;&colon;Allocator` and thus can be stored in a container&period; A minor subtlety arises in the `name` attribute, whereby any suffix starting with an `&equals;` sign in the `name` attribute of a `OptionInfo` is removed in order to derive the `name` of the `Option`&period;
| 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&period;
| xref:BloombergLP/balcl/OptionType.adoc[`OptionType`] 
| This `struct` provides a namespace for enumerating types used for command&hyphen;line option values&period; See &lcub;Enumerators&rcub; for details&period;
| xref:BloombergLP/balcl/OptionValue.adoc[`OptionValue`] 
| This class implements a special&hyphen;use value&hyphen;semantic variant type used to represent values parsed from process command lines&period; Accordingly, this class can represent values of any of the types defined in `balcl&lowbar;optiontype`&period; 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&hyphen;line arguments (and for which no default value has been configured)&period;
| xref:BloombergLP/balcl/OptionValue_NullOf.adoc[`OptionValue&lowbar;NullOf`] 
| This single&hyphen;attribute class represents a null value of a given nullable `balcl&colon;&colon;OptionType`&period; `OptionValue` uses this type to represent its state where there is a known type, but no value for it&period; Note that `OptionType&colon;&colon;e&lowbar;VOID` is _not_ nullable, therefore not supported here&period; Note that&colon; There is no `swap` member or namespace&hyphen;level function declared (and defined) for this class on purpose, the general swap works fast for such a simple type&period;
| 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&period; 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`)&period;
| xref:BloombergLP/balcl/TypeInfoConstraint.adoc[`TypeInfoConstraint`] 
| Component&hyphen;private protocol class for opaque option value constraints&period;
| xref:BloombergLP/balcl/TypeInfoUtil.adoc[`TypeInfoUtil`] 
| This utility `struct` provides a namespace for functions that perform non&hyphen;primitive operations using `TypeInfo` objects&period;
|===


== 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&period; This method provides the no&hyphen;throw exception&hyphen;safety guarantee if either `a&period;type()` is the same as `b&period;type()` and `a` and `b` were created with the same allocator, or neither `a&period;type()` nor `b&period;type()` is a type that requires allocation&semi; otherwise, it provides the basic guarantee&period;
| xref:BloombergLP/balcl/operator_lshift-07c.adoc[`operator&lt;&lt;`] 
| Stream insertion operators
| xref:BloombergLP/balcl/operator_eq-08.adoc[`operator&equals;&equals;`] 
| Equality operators
| xref:BloombergLP/balcl/operator_not_eq-06957.adoc[`operator!&equals;`] 
| Inequality operators
|===



[.small]#Created with https://www.mrdocs.com[MrDocs]#
