[#BloombergLP-balcl-OccurrenceInfo] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/balcl.adoc[balcl]::OccurrenceInfo :relfileprefix: ../../ :mrdocs: 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. == Synopsis Declared in `<balcl_occurrenceinfo.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- class OccurrenceInfo; ---- == Enums [cols="1,4"] |=== | Name| Description | xref:BloombergLP/balcl/OccurrenceInfo/OccurrenceType-09.adoc[`OccurrenceType`] | Enumerate the occurrence requirements for a command‐line option. |=== == Member Functions [cols="1,4"] |=== | Name| Description | xref:BloombergLP/balcl/OccurrenceInfo/2constructor-0d56.adoc[`OccurrenceInfo`] [.small]#[constructor]# | Constructors | xref:BloombergLP/balcl/OccurrenceInfo/2destructor.adoc[`~OccurrenceInfo`] [.small]#[destructor]# | Destroy this object. | xref:BloombergLP/balcl/OccurrenceInfo/operator_assign.adoc[`operator=`] | Assign to this object the value of the specified `rhs` object, and return a reference providing modifiable access to this object. | xref:BloombergLP/balcl/OccurrenceInfo/allocator.adoc[`allocator`] | Return the allocator used by this object to supply memory. Note that if no allocator was supplied at construction the currently installed default allocator at construction is used. | xref:BloombergLP/balcl/OccurrenceInfo/defaultValue.adoc[`defaultValue`] | Return a `const` reference to the default value of this object. | xref:BloombergLP/balcl/OccurrenceInfo/hasDefaultValue.adoc[`hasDefaultValue`] | Return `true` if this object has a default value, and `false` otherwise. | xref:BloombergLP/balcl/OccurrenceInfo/isHidden.adoc[`isHidden`] | Return `true` if the described option is hidden (i.e., not printed in the usage string), and `false` otherwise. | xref:BloombergLP/balcl/OccurrenceInfo/isRequired.adoc[`isRequired`] | Return `true` if the described option is required, and `false` otherwise. | xref:BloombergLP/balcl/OccurrenceInfo/occurrenceType-08.adoc[`occurrenceType`] | Return the occurrence type of the described option (i.e., required, optional, or hidden). | xref:BloombergLP/balcl/OccurrenceInfo/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`. If `level` is specified, optionally specify `spacesPerLevel`, the number of spaces per indentation level for this object. If `level` is negative, suppress indentation of the first line. If `stream` is not valid on entry, this operation has no effect. The behavior is undefined if `spacesPerLevel` is negative. | xref:BloombergLP/balcl/OccurrenceInfo/setDefaultValue.adoc[`setDefaultValue`] | Set the type and default value of the associated option to the specified `defaultValue`. The behavior is undefined unless the this object describes an optional argument (`e_REQUIRED != occurrenceType()`) and `defaultValue.type()` is neither `OptionType::e_BOOL` nor 'OptionType::e_VOID nor a null value (`false == defaultValue.isNull()`). | xref:BloombergLP/balcl/OccurrenceInfo/setHidden.adoc[`setHidden`] | Set the associated option to be hidden. The behavior is undefined unless the option is optional (`e_REQUIRED != occurrenceType()`). | xref:BloombergLP/balcl/OccurrenceInfo/2conversion.adoc[`operator BloombergLP::bslmf::NestedTraitDeclaration<OccurrenceInfo, HasPrintMethod>`] | Nested trait declaration for `bslma::UsesBslmaAllocator`. |=== == Non-Member Functions [cols="1,4"] |=== | Name| Description | xref:BloombergLP/balcl/operator_not_eq-01.adoc[`operator!=`] | Return `true` if the specified `lhs` and `rhs` do not have the same value, and `false` otherwise. Two objects of type `OccurrenceInfo` do not have the same value if and only if they have different occurrence types, or exactly one has a default value, or else both have a default value but their respective default values have either different types or different values. | xref:BloombergLP/balcl/operator_eq-0a.adoc[`operator==`] | Return `true` if the specified `lhs` and `rhs` have the same value, and `false` otherwise. Two objects of type `OccurrenceInfo` have the same value if and only if they have the same occurrence type and either both do not have a default value, or their respective default values have the same type and value. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#