Etermal
Embeddable Terminal and shell for OpenGL
Public Member Functions | List of all members
etm::ArgFilter::DefaultErrorHandle Class Reference

The default error handle. More...

#include <ArgFilter.h>

Inheritance diagram for etm::ArgFilter::DefaultErrorHandle:
etm::ArgFilter::ErrorHandle

Public Member Functions

 DefaultErrorHandle ()
 Construct a new object.
 
std::string badDatatype (int position, const std::string &data, datatype expectedType) override
 Called when the data cannot be parsed to the expected datatype. More...
 
std::string noParam (int position, const std::string &lastFlag, datatype expectedType) override
 Called when the flag was configured to accept a parameter, but instead hit the end of the commands list. More...
 
std::string badFlag (int position, const std::string &badFlag) override
 Called when the given flag does not exist. More...
 
std::string tooManyArgs (int position, unsigned int max) override
 Called when there are too many array arguments. More...
 
std::string internalError (int position, const std::string &errMsg) override
 Called when some internal error occurred. More...
 
bool doFailfast () override
 Check if the ArgFilter should stop processing the commands as soon as it encounters and error. More...
 
bool doFail () override
 Check if the Shell should not execute the command if there was an error parsing the commands. More...
 

Detailed Description

The default error handle.

See also
getStoreDefaultErrorHandle()
setDefaultErrorHandle(ErrorHandle &handle)

Member Function Documentation

◆ badDatatype()

std::string etm::ArgFilter::DefaultErrorHandle::badDatatype ( int  position,
const std::string &  data,
datatype  expectedType 
)
overridevirtual

Called when the data cannot be parsed to the expected datatype.

Parameters
[in]positionThe argument position (with 0 being the invokation)
[in]dataThe parameter given
[in]expectedTypeThe type data was expected to be
Returns
String to display to the user

Implements etm::ArgFilter::ErrorHandle.

◆ badFlag()

std::string etm::ArgFilter::DefaultErrorHandle::badFlag ( int  position,
const std::string &  badFlag 
)
overridevirtual

Called when the given flag does not exist.

Parameters
[in]positionThe argument position (with 0 being the invokation)
[in]badFlagThe flag
Returns
String to display to the user

Implements etm::ArgFilter::ErrorHandle.

◆ doFail()

bool etm::ArgFilter::DefaultErrorHandle::doFail ( )
overridevirtual

Check if the Shell should not execute the command if there was an error parsing the commands.

Returns
true

Implements etm::ArgFilter::ErrorHandle.

◆ doFailfast()

bool etm::ArgFilter::DefaultErrorHandle::doFailfast ( )
overridevirtual

Check if the ArgFilter should stop processing the commands as soon as it encounters and error.

Returns
true

Implements etm::ArgFilter::ErrorHandle.

◆ internalError()

std::string etm::ArgFilter::DefaultErrorHandle::internalError ( int  position,
const std::string &  errMsg 
)
overridevirtual

Called when some internal error occurred.

This should never happen, but it's good to have some way to handle it if it does.

Parameters
[in]positionThe argument position (with 0 being the invokation)
[in]errMsgThe error message
Returns
String to display to the user

Implements etm::ArgFilter::ErrorHandle.

◆ noParam()

std::string etm::ArgFilter::DefaultErrorHandle::noParam ( int  position,
const std::string &  lastFlag,
datatype  expectedType 
)
overridevirtual

Called when the flag was configured to accept a parameter, but instead hit the end of the commands list.

Parameters
[in]positionThe argument position (with 0 being the invokation)
[in]lastFlagThe last flag, the one that the parameter was for
[in]expectedTypeThe type data was expected to be
Returns
String to display to the user

Implements etm::ArgFilter::ErrorHandle.

◆ tooManyArgs()

std::string etm::ArgFilter::DefaultErrorHandle::tooManyArgs ( int  position,
unsigned int  max 
)
overridevirtual

Called when there are too many array arguments.

Parameters
[in]positionThe argument position (with 0 being the invokation)
[in]maxThe max allowed args
Returns
String to display to the user

Implements etm::ArgFilter::ErrorHandle.


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