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

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;

== Synopsis

Declared in `&lt;balcl&lowbar;option&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
class Option;
----

== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/balcl/Option/2constructor-09.adoc[`Option`]         [.small]#[constructor]#
| Constructors
| xref:BloombergLP/balcl/Option/2destructor.adoc[`&#126;Option`] [.small]#[destructor]#
| Destroy this command&hyphen;line option object&period;
| xref:BloombergLP/balcl/Option/operator_assign-0f.adoc[`operator&equals;`] 
| Assignment operators
| xref:BloombergLP/balcl/Option/allocator.adoc[`allocator`] 
| Return the allocator used by this object to supply memory&period; Note that if no allocator was supplied at construction the currently installed default allocator at construction is used&period;
| xref:BloombergLP/balcl/Option/argType.adoc[`argType`] 
| Return the `ArgType` enumerator identifying whether this option is a flag (i&period;e&period;, a tag not followed by a value), or whether it is an option (i&period;e&period;, a tag followed by a value), or a non&hyphen;option argument (i&period;e&period;, a value not preceded by a short or long tag)&period;
| xref:BloombergLP/balcl/Option/description.adoc[`description`] 
| Return the description of this option&period;
| xref:BloombergLP/balcl/Option/environmentVariableName.adoc[`environmentVariableName`] 
| Return the environment variable name of this option&period;
| xref:BloombergLP/balcl/Option/isArray.adoc[`isArray`] 
| Return `true` if the value of this option is of array type, and `false` otherwise&period;
| xref:BloombergLP/balcl/Option/isDescriptionValid.adoc[`isDescriptionValid`] 
| Return `true` if the description is valid for this option, leaving the specified `stream` unaffected&semi; otherwise, write a diagnostic message to `stream` and return `false`&period;
| xref:BloombergLP/balcl/Option/isLongTagValid.adoc[`isLongTagValid`] 
| Return `true` if the specified `longTag` is valid for this option, leaving the specified `stream` unaffected&semi; otherwise, write a diagnostic message to `stream` and return `false`&period;
| xref:BloombergLP/balcl/Option/isNameValid.adoc[`isNameValid`] 
| Return `true` if the name is valid for this option, leaving the specified `stream` unaffected&semi; otherwise, write a diagnostic message to `stream` and return `false`&period;
| xref:BloombergLP/balcl/Option/isTagValid.adoc[`isTagValid`] 
| Return `true` if the tag is valid for this option, leaving the specified `stream` unaffected&semi; otherwise, write a diagnostic message to `stream` and return `false`&period;
| xref:BloombergLP/balcl/Option/longTag.adoc[`longTag`] 
| Return the string used to identify this option on a command line preceded with `&hyphen;&hyphen;`, or 0 if there is no long tag associated with this option&period; The behavior is undefined if this option is a non&hyphen;option argument (i&period;e&period;, has no tag)&period;
| xref:BloombergLP/balcl/Option/name.adoc[`name`] 
| Return the name of this option&period;
| xref:BloombergLP/balcl/Option/occurrenceInfo.adoc[`occurrenceInfo`] 
| Return a `const` reference to the occurrence info for this option (i&period;e&period;, whether the option is required, optional, or hidden, and its default value, if any)&period;
| xref:BloombergLP/balcl/Option/print.adoc[`print`] 
| Format this object to the specified output `stream` at the (absolute value of) the optionally specified indentation `level` and return a reference to `stream`&period; If `level` is specified, optionally specify `spacesPerLevel`, the number of spaces per indentation level for this object&period; If `level` is negative, suppress indentation of the first line&period; If `stream` is not valid on entry, this operation has no effect&period; The behavior is undefined if `spacesPerLevel` is negative&period;
| xref:BloombergLP/balcl/Option/shortTag.adoc[`shortTag`] 
| Return the single character used to identify this option on a command line preceded with a single `&hyphen;`, or 0 if this option only has a long tag&period; The behavior is undefined if this option is a non&hyphen;option argument (i&period;e&period;, has no tag)&period;
| xref:BloombergLP/balcl/Option/tagString.adoc[`tagString`] 
| Return the tag string provided to this object at construction&period; Note that this string is empty if this is a non&hyphen;option argument&period;
| xref:BloombergLP/balcl/Option/typeInfo.adoc[`typeInfo`] 
| Return a `const` reference to the type info for this option (i&period;e&period;, the type of the option, whether the option is linked to a variable, and whether it has a constraint)&period;
| xref:BloombergLP/balcl/Option/2conversion-04.adoc[`operator BloombergLP::bslmf::NestedTraitDeclaration&lt;Option, HasPrintMethod&gt;`] 
| Nested trait declaration for `bslma&colon;&colon;UsesBslmaAllocator`&period;
| xref:BloombergLP/balcl/Option/2conversion-0f.adoc[`operator OptionInfo const&`] 
| Return a `const` reference to the `OptionInfo` object having the value of this option&period;
|===


== Non-Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/balcl/operator_not_eq-009.adoc[`operator!&equals;`]
| Return `true` if the specified `lhs` command&hyphen;line option has a different value from the specified `rhs` command&hyphen;line option, and `false` otherwise&period; Two `Option` objects do not have the same value if their underlying `OptionInfo` objects do not have the same value&period;
| xref:BloombergLP/balcl/operator_eq-09.adoc[`operator&equals;&equals;`]
| Return `true` if the specified `lhs` and `rhs` have the same value, and `false` otherwise&period; Two `Option` objects have the same value if their underlying `OptionInfo` objects have the same value&period;
|===


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