BashSpark
Loading...
Searching...
No Matches
bs::shell_parser_exception Class Referencefinal

Exception class for handling shell-specific errors. More...

#include <shell_parser_exception.h>

Inheritance diagram for bs::shell_parser_exception:
Collaboration diagram for bs::shell_parser_exception:

Public Member Functions

 shell_parser_exception (shell_status nStatus, std::string sCommand, std::size_t nPos)
 Constructs a shell_exception instance.
 
shell_status get_status () const noexcept
 Returns the error status associated with the exception.
 
const std::string & get_command () const noexcept
 Returns the command that caused the exception.
 
std::size_t get_position () const noexcept
 Returns the position in the command where the error occurred.
 

Detailed Description

Exception class for handling shell-specific errors.

This exception class is used to capture and report errors encountered during the parsing and execution of shell commands.

Constructor & Destructor Documentation

◆ shell_parser_exception()

bs::shell_parser_exception::shell_parser_exception ( shell_status  nStatus,
std::string  sCommand,
std::size_t  nPos 
)

Constructs a shell_exception instance.

Parameters
nStatusThe status indicating the type of error.
sCommandThe command that caused the error.
nPosThe position in the command where the error occurred.

Member Function Documentation

◆ get_command()

const std::string & bs::shell_parser_exception::get_command ( ) const
inlinenoexcept

Returns the command that caused the exception.

Returns
A string containing the command.

◆ get_position()

std::size_t bs::shell_parser_exception::get_position ( ) const
inlinenoexcept

Returns the position in the command where the error occurred.

Returns
The position as a size_t value.

◆ get_status()

shell_status bs::shell_parser_exception::get_status ( ) const
inlinenoexcept

Returns the error status associated with the exception.

Returns
The shell_status indicating the type of error.

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