StormByte C++ Library: Buffer module 0.0.9999
StormByte-Buffer is a StormByte library module for handling buffers
Loading...
Searching...
No Matches
exception.hxx
1#pragma once
2
3#include <StormByte/buffer/visibility.h>
4#include <StormByte/exception.hxx>
5
14namespace StormByte::Buffer {
15 // Generic Buffer exceptions
16 class STORMBYTE_BUFFER_PUBLIC Exception: public StormByte::Exception {
17 public:
18 template <typename... Args>
19 Exception(const std::string& component, std::format_string<Args...> fmt, Args&&... args):
20 StormByte::Exception("Buffer::" +component, fmt, std::forward<Args>(args)...) {}
21 };
22
27 class STORMBYTE_BUFFER_PUBLIC Error: public Exception {
28 public:
29 using Exception::Exception;
30 };
31
38 class STORMBYTE_BUFFER_PUBLIC ReadError: public Error {
39 public:
40 template <typename... Args>
41 ReadError(std::format_string<Args...> fmt, Args&&... args):
42 Error("Buffer::ReadError", fmt, std::forward<Args>(args)...) {}
43 };
44
51 class STORMBYTE_BUFFER_PUBLIC WriteError: public Error {
52 public:
53 template <typename... Args>
54 WriteError(std::format_string<Args...> fmt, Args&&... args):
55 Error("Buffer::WriteError", fmt, std::forward<Args>(args)...) {}
56 };
57}
General exception class for buffer errors.
Definition exception.hxx:27
Definition exception.hxx:16
Exception class for read errors from buffers.
Definition exception.hxx:38
Exception class for write errors to buffers.
Definition exception.hxx:51