    

 ## On this page

  

 

 # cli\_parser

 Last update: 16.07.2025 

<a id="l00001" name="l00001"></a> 1 

<a id="l00003" name="l00003"></a> 3 

<a id="l00004" name="l00004"></a> 4\#pragma once

<a id="l00005" name="l00005"></a> 5 

<a id="l00006" name="l00006"></a> 6\#include "core/service/parameter/simulation\_parameters.h"

<a id="l00007" name="l00007"></a> 7\#include &lt;optional&gt;

<a id="l00012" name="l00012"></a> 12namespace [simulation\_framework](namespacesimulation__framework.xhtml)

<a id="l00013" name="l00013"></a> 13{

<a id="l00014" name="l00014"></a> 14namespace [core](namespacecore.xhtml)

<a id="l00015" name="l00015"></a> 15{

<a id="l00016" name="l00016"></a> 16 

<a id="l00022" name="l00022"></a>[ 22](classsimulation__framework_1_1core_1_1CliParser.xhtml)class [CliParser](classsimulation__framework_1_1core_1_1CliParser.xhtml) [final](classsimulation__framework_1_1core_1_1Topic.xhtml)

<a id="l00023" name="l00023"></a> 23{

<a id="l00024" name="l00024"></a> 24 public:

<a id="l00030" name="l00030"></a>[ 30](classsimulation__framework_1_1core_1_1CliParser.xhtml#acc52be4547ba139f22bae8d100523c5f) bool [Parse](classsimulation__framework_1_1core_1_1CliParser.xhtml#acc52be4547ba139f22bae8d100523c5f)(int [argc](classsimulation__framework_1_1core_1_1Topic.xhtml), const char** [argv](classsimulation__framework_1_1core_1_1Topic.xhtml));

<a id="l00031" name="l00031"></a> 31 

<a id="l00034" name="l00034"></a>[ 34](classsimulation__framework_1_1core_1_1CliParser.xhtml#a8879b6b14d755297ec58b8d7af3361f8) std::string [GetParserMessage](classsimulation__framework_1_1core_1_1CliParser.xhtml#a8879b6b14d755297ec58b8d7af3361f8)() const;

<a id="l00035" name="l00035"></a> 35 

<a id="l00038" name="l00038"></a>[ 38](classsimulation__framework_1_1core_1_1CliParser.xhtml#a475c151971317b0d7c2667053ea385a9) const [SimulationParameters](structsimulation__framework_1_1core_1_1SimulationParameters.xhtml)&amp; [GetSimulationParameters](classsimulation__framework_1_1core_1_1CliParser.xhtml#a475c151971317b0d7c2667053ea385a9)() const;

<a id="l00039" name="l00039"></a> 39 

<a id="l00043" name="l00043"></a>[ 43](classsimulation__framework_1_1core_1_1CliParser.xhtml#a153cda6b7419e2065357cfdeae0fd0c4) std::optional&lt;std::string&gt; [GetInputFileByName](classsimulation__framework_1_1core_1_1CliParser.xhtml#a153cda6b7419e2065357cfdeae0fd0c4)(const std::string&amp; name) const;

<a id="l00044" name="l00044"></a> 44 

<a id="l00047" name="l00047"></a>[ 47](classsimulation__framework_1_1core_1_1CliParser.xhtml#a2b6a9281bb2736988da72eae4e3a7bc8) std::string [GetSimulationConfig](classsimulation__framework_1_1core_1_1CliParser.xhtml#a2b6a9281bb2736988da72eae4e3a7bc8)() const;

<a id="l00048" name="l00048"></a> 48 

<a id="l00049" name="l00049"></a> 49 private:

<a id="l00055" name="l00055"></a> 55 bool ConvertFileStringIntoFiles(const std::vector&lt;std::string&gt;&amp; [input\_args](classsimulation__framework_1_1core_1_1Topic.xhtml), std::vector&lt;File&gt;&amp; [files](classsimulation__framework_1_1core_1_1Topic.xhtml));

<a id="l00056" name="l00056"></a> 56 

<a id="l00058" name="l00058"></a> 58 [SimulationParameters](structsimulation__framework_1_1core_1_1SimulationParameters.xhtml) core_parameters_{};

<a id="l00059" name="l00059"></a> 59 

<a id="l00061" name="l00061"></a> 61 std::string parser_message_{};

<a id="l00062" name="l00062"></a> 62};



<a id="l00063" name="l00063"></a> 63 

<a id="l00064" name="l00064"></a> 64} // namespace core

<a id="l00065" name="l00065"></a> 65} // namespace simulation\_framework

[simulation\_framework::core::CliParser](classsimulation__framework_1_1core_1_1CliParser.xhtml)

Command-line argument parser for simulation framework.

**Definition** [cli\_parser.h:23](cli__parser_8h_source.xhtml#l00022)



[simulation\_framework::core::CliParser::GetInputFileByName](classsimulation__framework_1_1core_1_1CliParser.xhtml#a153cda6b7419e2065357cfdeae0fd0c4)

std::optional&lt; std::string &gt; GetInputFileByName(const std::string &amp;name) const

Retrieves the input file path by its name.



[simulation\_framework::core::CliParser::GetSimulationConfig](classsimulation__framework_1_1core_1_1CliParser.xhtml#a2b6a9281bb2736988da72eae4e3a7bc8)

std::string GetSimulationConfig() const

Returns the simulation configuration for the application level.



[simulation\_framework::core::CliParser::GetSimulationParameters](classsimulation__framework_1_1core_1_1CliParser.xhtml#a475c151971317b0d7c2667053ea385a9)

const SimulationParameters &amp; GetSimulationParameters() const

Returns the simulation framework core parameters.



[simulation\_framework::core::CliParser::GetParserMessage](classsimulation__framework_1_1core_1_1CliParser.xhtml#a8879b6b14d755297ec58b8d7af3361f8)

std::string GetParserMessage() const

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



[simulation\_framework::core::CliParser::Parse](classsimulation__framework_1_1core_1_1CliParser.xhtml#acc52be4547ba139f22bae8d100523c5f)

bool Parse(int argc, const char **argv)

Takes the command-line arguments and parses them.



[simulation\_framework::core::Topic](classsimulation__framework_1_1core_1_1Topic.xhtml)

This is the concrete Topic class that can be used for creation of a communication channel with given ...

**Definition** [topic.h:38](topic_8h_source.xhtml#l00037)



[core](namespacecore.xhtml)

The namespace for all core functionalities under namespace simulation_framework.



[simulation\_framework](namespacesimulation__framework.xhtml)

The top namespace for simulation framework.



[simulation\_framework::core::SimulationParameters](structsimulation__framework_1_1core_1_1SimulationParameters.xhtml)

The SimulationParameters struct encapsulates parameters related to simfwk-core configuration.

**Definition** [simulation\_parameters.h:29](simulation__parameters_8h_source.xhtml#l00028)