ChainCLI
A modern C++20 command-line interface library
Loading...
Searching...
No Matches
cli::parsing::ParseHelper Struct Reference

Helper struct providing static methods for parsing strings into various types. More...

#include <parser_utils.h>

Static Public Member Functions

template<typename T >
static T parse (const std::string &input)
 Parses a string input into a value of type T.
 
template<typename T >
static void parse (const std::string &input, T &value)
 Parses a string input into a value of type T.
 

Detailed Description

Helper struct providing static methods for parsing strings into various types.

Member Function Documentation

◆ parse() [1/2]

template<typename T >
static T cli::parsing::ParseHelper::parse ( const std::string &  input)
inlinestatic

Parses a string input into a value of type T.

Template Parameters
TThe type to parse the input into.
Parameters
inputThe input string to parse.
Returns
The parsed value of type T.

◆ parse() [2/2]

template<typename T >
static void cli::parsing::ParseHelper::parse ( const std::string &  input,
T &  value 
)
inlinestatic

Parses a string input into a value of type T.

Template Parameters
TThe type to parse the input into.
Parameters
inputThe input string to parse.
valueThe variable to store the parsed value.

The documentation for this struct was generated from the following file: