BashSpark
Loading...
Searching...
No Matches
shell_parser_exception.h
Go to the documentation of this file.
1
30#pragma once
31
32#include <vector>
33
36
37namespace bs {
45 class shell_parser_exception final : public std::runtime_error {
46 public:
54 shell_status nStatus,
55 std::string sCommand,
56 std::size_t nPos
57 );
58
59 public:
64 [[nodiscard]] shell_status get_status() const noexcept {
65 return m_nStatus;
66 }
67
72 [[nodiscard]] const std::string &get_command() const noexcept {
73 return m_sCommand;
74 }
75
80 [[nodiscard]] std::size_t get_position() const noexcept {
81 return m_nPos;
82 }
83
84 private:
86 shell_status m_nStatus;
88 std::string m_sCommand;
90 std::size_t m_nPos;
91 };
92}
Exception class for handling shell-specific errors.
Definition shell_parser_exception.h:45
std::size_t get_position() const noexcept
Returns the position in the command where the error occurred.
Definition shell_parser_exception.h:80
const std::string & get_command() const noexcept
Returns the command that caused the exception.
Definition shell_parser_exception.h:72
shell_status get_status() const noexcept
Returns the error status associated with the exception.
Definition shell_parser_exception.h:64
Generic input and output stream classes with character types.
BashSpark main namespace.
Definition command.h:39
shell_status
Shell status codes.
Definition shell_status.h:47
Defines status codes for the shell.