[#BloombergLP-balcl-CommandLine-2constructor-03]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/balcl.adoc[balcl]::xref:BloombergLP/balcl/CommandLine.adoc[CommandLine]::CommandLine
:relfileprefix: ../../../
:mrdocs:

Constructors

== Synopses

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

Create a command&hyphen;line object having the value of the specified `original` command line, if the `original` is parsed, and otherwise having a state such that parsing command&hyphen;line arguments results in the same value as parsing the same command&hyphen;line arguments with the `original`&period; Optionally specify a `basicAllocator` used to supply memory&period; If `basicAllocator` is 0, the currently installed default allocator is used&period; The behavior is undefined unless `original` is valid (i&period;e&period;, `original&period;isValid()` returns `true`)&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/balcl/CommandLine/2constructor-0a.adoc[CommandLine](
    xref:BloombergLP/balcl/CommandLine.adoc[CommandLine] const& original,
    xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator = 0);
----

[.small]#xref:BloombergLP/balcl/CommandLine/2constructor-0a.adoc[_» more&period;&period;&period;_]#

Same as the overload taking `const OptionInfo (&amp;)&lsqb;LENGTH&rsqb;`, but accepts a non&hyphen;const `specTable` whose entries may be updated in place&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;int LENGTH&gt;
explicit
xref:BloombergLP/balcl/CommandLine/2constructor-05.adoc[CommandLine](
    xref:BloombergLP/balcl/OptionInfo.adoc[OptionInfo](& specTable)[],
    xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator = 0);
----

[.small]#xref:BloombergLP/balcl/CommandLine/2constructor-05.adoc[_» more&period;&period;&period;_]#

Create an object accepting the command&hyphen;line options described by the specified (statically&hyphen;initialized) `specTable`&period; Optionally specify a `basicAllocator` used to supply memory&period; If `basicAllocator` is 0, the currently installed default allocator is used&period; The behavior is undefined unless `specTable` satisfies the `isValidOptionSpecificationTable` function&period; Note that an appropriate error message is written to `bsl&colon;&colon;cerr`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;int LENGTH&gt;
explicit
xref:BloombergLP/balcl/CommandLine/2constructor-02.adoc[CommandLine](
    xref:BloombergLP/balcl/OptionInfo.adoc[OptionInfo] const(& specTable)[],
    xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator = 0);
----

[.small]#xref:BloombergLP/balcl/CommandLine/2constructor-02.adoc[_» more&period;&period;&period;_]#

Create an object accepting the command&hyphen;line options described by the specified `specTable` of the specified `length`&period; Optionally specify a `basicAllocator` used to supply memory&period; If `basicAllocator` is 0, the currently installed default allocator is used&period; The behavior is undefined unless `specTable` satisfies the `isValidOptionSpecificationTable` function&period; Note that an appropriate error message is written to `bsl&colon;&colon;cerr`&period; Also note that `specTable` need not be statically initialized&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/balcl/CommandLine/2constructor-0d.adoc[CommandLine](
    xref:BloombergLP/balcl/OptionInfo.adoc[OptionInfo] const* specTable,
    int length,
    xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator = 0);
----

[.small]#xref:BloombergLP/balcl/CommandLine/2constructor-0d.adoc[_» more&period;&period;&period;_]#

Same as the preceding overload, but accepts a non&hyphen;const `specTable` whose entries may be updated in place&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;int LENGTH&gt;
xref:BloombergLP/balcl/CommandLine/2constructor-0f.adoc[CommandLine](
    xref:BloombergLP/balcl/OptionInfo.adoc[OptionInfo](& specTable)[],
    std::ostream& errorStream,
    xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator = 0);
----

[.small]#xref:BloombergLP/balcl/CommandLine/2constructor-0f.adoc[_» more&period;&period;&period;_]#

Create an object accepting the command&hyphen;line options described by the specified (statically&hyphen;initialized) `specTable`&period; Optionally specify a `basicAllocator` used to supply memory&period; If `basicAllocator` is 0, the currently installed default allocator is used&period; The behavior is undefined unless `specTable` satisfies the `isValidOptionSpecificationTable` function&period; Note that an appropriate error message is written to the specified `errorStream`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;int LENGTH&gt;
xref:BloombergLP/balcl/CommandLine/2constructor-07.adoc[CommandLine](
    xref:BloombergLP/balcl/OptionInfo.adoc[OptionInfo] const(& specTable)[],
    std::ostream& errorStream,
    xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator = 0);
----

[.small]#xref:BloombergLP/balcl/CommandLine/2constructor-07.adoc[_» more&period;&period;&period;_]#

Create an object accepting the command&hyphen;line options described by the specified `specTable` of the specified `length`&period; Optionally specify a `basicAllocator` used to supply memory&period; If `basicAllocator` is 0, the currently installed default allocator is used&period; The behavior is undefined unless `specTable` satisfies the `isValidOptionSpecificationTable` function&period; Note that an appropriate error message is written to the specified `errorStream`&period; Also note that `specTable` need not be statically initialized&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/balcl/CommandLine/2constructor-00.adoc[CommandLine](
    xref:BloombergLP/balcl/OptionInfo.adoc[OptionInfo] const* specTable,
    int length,
    std::ostream& errorStream,
    xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator = 0);
----

[.small]#xref:BloombergLP/balcl/CommandLine/2constructor-00.adoc[_» more&period;&period;&period;_]#


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