From bcfd51a7fabf7adf5f134247ca1020fac98b24b5 Mon Sep 17 00:00:00 2001 From: crupest Date: Wed, 5 Jul 2023 01:54:08 +0800 Subject: Add CFileStream. Move ErrnoException. --- include/cru/common/Exception.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'include/cru/common/Exception.h') diff --git a/include/cru/common/Exception.h b/include/cru/common/Exception.h index 365d2064..6f458d35 100644 --- a/include/cru/common/Exception.h +++ b/include/cru/common/Exception.h @@ -29,4 +29,21 @@ class CRU_BASE_API TextEncodeException : public Exception { public: using Exception::Exception; }; + +class ErrnoException : public Exception { + public: + ErrnoException() : ErrnoException(String{}) {} + explicit ErrnoException(const String& message); + ErrnoException(const String& message, int errno_code); + + CRU_DELETE_COPY(ErrnoException) + CRU_DELETE_MOVE(ErrnoException) + + ~ErrnoException() override = default; + + int GetErrnoCode() const { return errno_code_; } + + private: + int errno_code_; +}; } // namespace cru -- cgit v1.2.3