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

Class used to parse string inputs into typed argument values based on the command definition. More...

#include <parser.h>

Public Member Functions

 Parser (const CliConfig &config)
 Creates a new Parser instance with the given configuration.
 
void parseArguments (const cli::commands::Command &command, const std::vector< std::string > &inputs, ContextBuilder &contextBuilder) const
 Parse the given inputs according to the specified command and populate the context builder with the parsed values.
 

Detailed Description

Class used to parse string inputs into typed argument values based on the command definition.

Constructor & Destructor Documentation

◆ Parser()

cli::parsing::Parser::Parser ( const CliConfig config)
inlineexplicit

Creates a new Parser instance with the given configuration.

Parameters
configThe configuration to use for the parser.

Member Function Documentation

◆ parseArguments()

inline_t void cli::parsing::Parser::parseArguments ( const cli::commands::Command command,
const std::vector< std::string > &  inputs,
ContextBuilder contextBuilder 
) const

Parse the given inputs according to the specified command and populate the context builder with the parsed values.

Parameters
commandThe command to parse the inputs for.
inputsThe inputs to parse.
contextBuilderThe context builder to populate with the parsed values.

The documentation for this class was generated from the following files: