This class describes a command‐line option's occurrence requirement and default value.

Synopsis

Declared in <balcl_occurrenceinfo.h>

class OccurrenceInfo;

Description

This 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.

Enums

Name

Description

OccurrenceType

Enumerate the occurrence requirements for a command‐line option.

Member Functions

Name

Description

OccurrenceInfo [constructor]

Constructors

~OccurrenceInfo [destructor]

Destroy this object.

operator=

Assign to this object the value of the specified rhs object, and return a reference providing modifiable access to this object.

allocator

Return the allocator used by this object to supply memory.

defaultValue

Return a const reference to the default value of this object.

hasDefaultValue

Return true if this object has a default value, and false otherwise.

isHidden

Return true if the described option is hidden (i.e., not printed in the usage string), and false otherwise.

isRequired

Return true if the described option is required, and false otherwise.

occurrenceType

Return the occurrence type of the described option (i.e., required, optional, or hidden).

print

Format this object to the specified output stream and return a reference to stream.

setDefaultValue

Set the default value of the associated option.

setHidden

Set the associated option to be hidden. The behavior is undefined unless the option is optional (e_REQUIRED != occurrenceType()).

operator BloombergLP::bslmf::NestedTraitDeclaration<OccurrenceInfo, HasPrintMethod>

Nested trait declaration for bslma::UsesBslmaAllocator.

Non-Member Functions

Name

Description

operator!=

Return true if the specified lhs and rhs do not have the same value.

operator==

Return true if the specified lhs and rhs have the same value.

Created with MrDocs