    

 ## On this page

  

 

 # simulation\_framework::core::CliParser Class Reference

 Last update: 16.07.2025 

Command-line argument parser for simulation framework. [More...](classsimulation__framework_1_1core_1_1CliParser.xhtml#details)

`#include <<a class="el" href="cli__parser_8h_source.xhtml">cli_parser.h</a>>`

## <a id="pub-methods" name="pub-methods"></a>Public Member Functions

[bool](classsimulation__framework_1_1core_1_1Topic.xhtml) [Parse](classsimulation__framework_1_1core_1_1CliParser.xhtml#acc52be4547ba139f22bae8d100523c5f) ([int](classsimulation__framework_1_1core_1_1Topic.xhtml) [argc](classsimulation__framework_1_1core_1_1Topic.xhtml), [const](classsimulation__framework_1_1core_1_1Topic.xhtml) [char](classsimulation__framework_1_1core_1_1Topic.xhtml) \*\*[argv](classsimulation__framework_1_1core_1_1Topic.xhtml)) Takes the command-line arguments and parses them.   
 std::string [GetParserMessage](classsimulation__framework_1_1core_1_1CliParser.xhtml#a8879b6b14d755297ec58b8d7af3361f8) () [const](classsimulation__framework_1_1core_1_1Topic.xhtml) Returns information provided by the parser (e.g., errors or help), if applicable.   
 [const](classsimulation__framework_1_1core_1_1Topic.xhtml) [SimulationParameters](structsimulation__framework_1_1core_1_1SimulationParameters.xhtml) &amp; [GetSimulationParameters](classsimulation__framework_1_1core_1_1CliParser.xhtml#a475c151971317b0d7c2667053ea385a9) () [const](classsimulation__framework_1_1core_1_1Topic.xhtml) Returns the simulation framework core parameters.   
 std::optional&lt; std::string &gt; [GetInputFileByName](classsimulation__framework_1_1core_1_1CliParser.xhtml#a153cda6b7419e2065357cfdeae0fd0c4) ([const](classsimulation__framework_1_1core_1_1Topic.xhtml) std::string &amp;name) [const](classsimulation__framework_1_1core_1_1Topic.xhtml) Retrieves the input file path by its name.   
 std::string [GetSimulationConfig](classsimulation__framework_1_1core_1_1CliParser.xhtml#a2b6a9281bb2736988da72eae4e3a7bc8) () [const](classsimulation__framework_1_1core_1_1Topic.xhtml) Returns the simulation configuration for the application level.   
 <a id="details" name="details"></a>## Detailed Description

Command-line argument parser for simulation framework.

The `<a class="el" href="classsimulation__framework_1_1core_1_1CliParser.xhtml" title="Command-line argument parser for simulation framework.">CliParser</a>` class provides generic functionality to parse command-line arguments and extract simulation-related parameters, configuration, and input files. It helps in converting command-line input into structured simulation parameters.

See also[SimulationParameters](structsimulation__framework_1_1core_1_1SimulationParameters.xhtml "The SimulationParameters struct encapsulates parameters related to simfwk-core configuration."), File Definition at line [22](cli__parser_8h_source.xhtml#l00022) of file [cli\_parser.h](cli__parser_8h_source.xhtml).



## Member Function Documentation

<a id="a153cda6b7419e2065357cfdeae0fd0c4" name="a153cda6b7419e2065357cfdeae0fd0c4"></a>## [◆ ](#a153cda6b7419e2065357cfdeae0fd0c4)GetInputFileByName()

 std::optional&lt; std::string &gt; simulation\_framework::core::CliParser::GetInputFileByName  ( [const](classsimulation__framework_1_1core_1_1Topic.xhtml) std::string &amp;  *name*)  const

Retrieves the input file path by its name.

Parameters nameThe name of the input file to retrieve. ReturnsAn optional string containing the file path if it exists; otherwise, `std::nullopt`. 



<a id="a8879b6b14d755297ec58b8d7af3361f8" name="a8879b6b14d755297ec58b8d7af3361f8"></a>## [◆ ](#a8879b6b14d755297ec58b8d7af3361f8)GetParserMessage()

 std::string simulation\_framework::core::CliParser::GetParserMessage  ( )  const

Returns information provided by the parser (e.g., errors or help), if applicable.

ReturnsA string containing parser information. 



<a id="a2b6a9281bb2736988da72eae4e3a7bc8" name="a2b6a9281bb2736988da72eae4e3a7bc8"></a>## [◆ ](#a2b6a9281bb2736988da72eae4e3a7bc8)GetSimulationConfig()

 std::string simulation\_framework::core::CliParser::GetSimulationConfig  ( )  const

Returns the simulation configuration for the application level.

ReturnsA string containing the simulation configuration. 



<a id="a475c151971317b0d7c2667053ea385a9" name="a475c151971317b0d7c2667053ea385a9"></a>## [◆ ](#a475c151971317b0d7c2667053ea385a9)GetSimulationParameters()

 [const](classsimulation__framework_1_1core_1_1Topic.xhtml) [SimulationParameters](structsimulation__framework_1_1core_1_1SimulationParameters.xhtml) &amp; simulation\_framework::core::CliParser::GetSimulationParameters  ( )  const

Returns the simulation framework core parameters.

ReturnsA constant reference to `<a class="el" href="structsimulation__framework_1_1core_1_1SimulationParameters.xhtml" title="The SimulationParameters struct encapsulates parameters related to simfwk-core configuration.">SimulationParameters</a>`. 



<a id="acc52be4547ba139f22bae8d100523c5f" name="acc52be4547ba139f22bae8d100523c5f"></a>## [◆ ](#acc52be4547ba139f22bae8d100523c5f)Parse()

 [bool](classsimulation__framework_1_1core_1_1Topic.xhtml) simulation\_framework::core::CliParser::Parse  ( [int](classsimulation__framework_1_1core_1_1Topic.xhtml)  *argc*,    [const](classsimulation__framework_1_1core_1_1Topic.xhtml) [char](classsimulation__framework_1_1core_1_1Topic.xhtml) \*\*  *argv*   ) 

Takes the command-line arguments and parses them.

Returns `false` if there is a parse error; otherwise, returns `true`.

Parameters argcThe number of arguments. argvAn array of argument strings. Returns`true` if parsing is successful; `false` otherwise. 



---

The documentation for this class was generated from the following file:- [cli\_parser.h](cli__parser_8h_source.xhtml)