[#ArgsManager-GetArg-0b]
= xref:ArgsManager.adoc[ArgsManager]::GetArg
:relfileprefix: ../
:mrdocs:

`GetArg` overloads

== Synopses

Declared in `&lt;common&sol;args&period;h&gt;`

Return string argument, or std&colon;&colon;nullopt if it was not set&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
&lsqb;&lsqb;requires&lowbar;capability(0x7f9524a22708)&rsqb;&rsqb;
std::optional&lt;std::string&gt;
xref:ArgsManager/GetArg-0f.adoc[GetArg](std::string const& strArg) const;
----

[.small]#xref:ArgsManager/GetArg-0f.adoc[_» more&period;&period;&period;_]#

Return integer argument, or std&colon;&colon;nullopt if it was not set&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;std::integral Int&gt;
&lsqb;&lsqb;requires&lowbar;capability(0x7f9524a22ac8)&rsqb;&rsqb;
std::optional&lt;Int&gt;
xref:ArgsManager/GetArg-00.adoc[GetArg](std::string const& strArg) const;
----

[.small]#xref:ArgsManager/GetArg-00.adoc[_» more&period;&period;&period;_]#

Return string argument or default value


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
&lsqb;&lsqb;requires&lowbar;capability(0x7f9524a225c8)&rsqb;&rsqb;
std::string
xref:ArgsManager/GetArg-06.adoc[GetArg](
    std::string const& strArg,
    std::string const& strDefault) const;
----

[.small]#xref:ArgsManager/GetArg-06.adoc[_» more&period;&period;&period;_]#

Return integer argument or default value


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;std::integral Int&gt;
&lsqb;&lsqb;requires&lowbar;capability(0x7f9524a22988)&rsqb;&rsqb;
Int
xref:ArgsManager/GetArg-08.adoc[GetArg](
    std::string const& strArg,
    Int nDefault) const;
----

[.small]#xref:ArgsManager/GetArg-08.adoc[_» more&period;&period;&period;_]#

== Return Value

* The argument value, or std&colon;&colon;nullopt if unset&period;
* The integer value, or std&colon;&colon;nullopt if unset&period;
* command&hyphen;line argument or default value
* command&hyphen;line argument (0 if invalid number) or default value

== Parameters

[cols="1,4"]
|===
| Name| Description
| *strArg*
| Argument to get (e&period;g&period; &quot;&hyphen;foo&quot;)&period;
| *strDefault*
| (e&period;g&period; &quot;1&quot;)
| *nDefault*
| (e&period;g&period; 1)
|===


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