vengine  0.0.1
3D graphics engine
Loading...
Searching...
No Matches
ven::Parser Class Reference

Class for Parser. More...

#include <Parser.hpp>

+ Collaboration diagram for ven::Parser:

Public Member Functions

 Parser (int argc, char *argv[], char *envp[])
 
 ~Parser ()=default
 
 Parser (const Parser &)=delete
 
Parseroperator= (const Parser &)=delete
 
 Parser (Parser &&)=delete
 
Parseroperator= (Parser &&)=delete
 
void printArguments () const
 
Config getConfig () const
 

Private Member Functions

void parseArgs (const std::vector< std::string_view > &argv)
 
void parseEnv (const std::unordered_map< std::string, std::string > &envp)
 
void handleLongOption (const std::string_view &arg, const std::vector< std::string_view > &argv, size_t &index)
 
void handleShortOptions (const std::string_view &arg)
 

Static Private Member Functions

static bool isValidOption (const std::string_view &option)
 

Private Attributes

Config m_config
 
bool m_state = true
 

Detailed Description

Class for Parser.

Definition at line 134 of file Parser.hpp.

Constructor & Destructor Documentation

◆ Parser() [1/3]

ven::Parser::Parser ( int argc,
char * argv[],
char * envp[] )

Definition at line 54 of file parser.cpp.

◆ ~Parser()

ven::Parser::~Parser ( )
default

◆ Parser() [2/3]

ven::Parser::Parser ( const Parser & )
delete

◆ Parser() [3/3]

ven::Parser::Parser ( Parser && )
delete

Member Function Documentation

◆ getConfig()

Config ven::Parser::getConfig ( ) const
inlinenodiscard

Definition at line 148 of file Parser.hpp.

References m_config.

◆ handleLongOption()

void ven::Parser::handleLongOption ( const std::string_view & arg,
const std::vector< std::string_view > & argv,
size_t & index )
private

Definition at line 6 of file parser.cpp.

References ven::FUNCTION_MAP_OPT_LONG, isValidOption(), and m_config.

+ Here is the call graph for this function:

◆ handleShortOptions()

void ven::Parser::handleShortOptions ( const std::string_view & arg)
private

Definition at line 15 of file parser.cpp.

References ven::FUNCTION_MAP_OPT_SHORT.

◆ isValidOption()

static bool ven::Parser::isValidOption ( const std::string_view & option)
inlinestaticnodiscardprivate

Definition at line 161 of file Parser.hpp.

References ven::FUNCTION_MAP_OPT_LONG, and ven::FUNCTION_MAP_OPT_SHORT.

Referenced by handleLongOption().

+ Here is the caller graph for this function:

◆ operator=() [1/2]

Parser & ven::Parser::operator= ( const Parser & )
delete

◆ operator=() [2/2]

Parser & ven::Parser::operator= ( Parser && )
delete

◆ parseArgs()

void ven::Parser::parseArgs ( const std::vector< std::string_view > & argv)
private

Definition at line 38 of file parser.cpp.

◆ parseEnv()

void ven::Parser::parseEnv ( const std::unordered_map< std::string, std::string > & envp)
private

Definition at line 27 of file parser.cpp.

◆ printArguments()

void ven::Parser::printArguments ( ) const

Member Data Documentation

◆ m_config

Config ven::Parser::m_config
private

Definition at line 152 of file Parser.hpp.

Referenced by getConfig(), and handleLongOption().

◆ m_state

bool ven::Parser::m_state = true
private

Definition at line 153 of file Parser.hpp.


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