FlatImage
A configurable Linux containerization system
Loading...
Searching...
No Matches
ns_parser::VecArgs Class Reference

Vector-based argument container with pop operations. More...

#include <parser.hpp>

Public Member Functions

 VecArgs (char **begin, char **end)
 Constructs a VecArgs from an iterator range.
 
template<ns_string::static_string Format, typename... Ts>
Value< std::string > pop_front (Ts &&... ts)
 Pops the front element with formatted error message.
 
std::vector< std::string > const & data ()
 Returns a const reference to the underlying data.
 
size_t size ()
 Returns the number of arguments.
 
bool empty ()
 Checks if the argument vector is empty.
 
void clear ()
 Clears all arguments.
 

Detailed Description

Vector-based argument container with pop operations.

Wraps a vector of strings to provide convenient argument parsing with formatted error messages.

Definition at line 97 of file parser.hpp.

Constructor & Destructor Documentation

◆ VecArgs()

ns_parser::VecArgs::VecArgs ( char ** begin,
char ** end )
inline

Constructs a VecArgs from an iterator range.

Parameters
beginBeginning of the argument range
endEnd of the argument range

Definition at line 107 of file parser.hpp.

Member Function Documentation

◆ clear()

void ns_parser::VecArgs::clear ( )
inline

Clears all arguments.

Definition at line 171 of file parser.hpp.

Here is the caller graph for this function:

◆ data()

std::vector< std::string > const & ns_parser::VecArgs::data ( )
inline

Returns a const reference to the underlying data.

Returns
Const reference to the vector of strings

Definition at line 145 of file parser.hpp.

Here is the caller graph for this function:

◆ empty()

bool ns_parser::VecArgs::empty ( )
inline

Checks if the argument vector is empty.

Returns
True if empty, false otherwise

Definition at line 163 of file parser.hpp.

Here is the caller graph for this function:

◆ pop_front()

template<ns_string::static_string Format, typename... Ts>
Value< std::string > ns_parser::VecArgs::pop_front ( Ts &&... ts)
inline

Pops the front element with formatted error message.

Template Parameters
FormatError message format string
TsTypes of format arguments
Parameters
tsFormat arguments
Returns
Value containing the popped string or error

Definition at line 123 of file parser.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ size()

size_t ns_parser::VecArgs::size ( )
inline

Returns the number of arguments.

Returns
Size of the argument vector

Definition at line 154 of file parser.hpp.


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