    

 ## 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 name="pub-methods"></a>Public Member Functions

bool [Parse](classsimulation__framework_1_1core_1_1CliParser.xhtml#acc52be4547ba139f22bae8d100523c5f) (int argc, const char \*\*argv) Takes the command-line arguments and parses them. [More...](classsimulation__framework_1_1core_1_1CliParser.xhtml#acc52be4547ba139f22bae8d100523c5f)  
 std::string [GetParserMessage](classsimulation__framework_1_1core_1_1CliParser.xhtml#a8879b6b14d755297ec58b8d7af3361f8) () const Returns information provided by the parser (e.g., errors or help), if applicable. [More...](classsimulation__framework_1_1core_1_1CliParser.xhtml#a8879b6b14d755297ec58b8d7af3361f8)  
 const [SimulationParameters](structsimulation__framework_1_1core_1_1SimulationParameters.xhtml) &amp; [GetSimulationParameters](classsimulation__framework_1_1core_1_1CliParser.xhtml#a58ce70020052ac45bef2842d91826229) () const Returns the simulation framework core parameters. [More...](classsimulation__framework_1_1core_1_1CliParser.xhtml#a58ce70020052ac45bef2842d91826229)  
 std::optional&lt; std::string &gt; [GetInputFileByName](classsimulation__framework_1_1core_1_1CliParser.xhtml#a55ed7acb4801d80c5a331a02f19c0b9b) (const std::string &amp;name) const Retrieves the input file path by its name. [More...](classsimulation__framework_1_1core_1_1CliParser.xhtml#a55ed7acb4801d80c5a331a02f19c0b9b)  
 std::string [GetSimulationConfig](classsimulation__framework_1_1core_1_1CliParser.xhtml#a2b6a9281bb2736988da72eae4e3a7bc8) () const Returns the simulation configuration for the application level. [More...](classsimulation__framework_1_1core_1_1CliParser.xhtml#a2b6a9281bb2736988da72eae4e3a7bc8)  
 <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 

## Member Function Documentation

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

 std::optional&lt;std::string&gt; simulation\_framework::core::CliParser::GetInputFileByName  ( const 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"></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"></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="a58ce70020052ac45bef2842d91826229"></a>## [◆ ](#a58ce70020052ac45bef2842d91826229)GetSimulationParameters()

 const [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"></a>## [◆ ](#acc52be4547ba139f22bae8d100523c5f)Parse()

 bool simulation\_framework::core::CliParser::Parse  ( int  *argc*,    const char \*\*  *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)