diff options
| author | Carl Hetherington <cth@carlh.net> | 2025-09-10 19:37:07 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2025-09-10 23:24:26 +0200 |
| commit | 60a0242e7c5275b73bf3007d3245b8f35bb77c18 (patch) | |
| tree | 1f362ca696b695964e9123229b84f401b7b7580b /src/KM_error.h | |
| parent | af1cabad632b5ad811c1020f6084b5063a36b407 (diff) | |
Pass some more OS error codes up through Result_t.
Diffstat (limited to 'src/KM_error.h')
| -rwxr-xr-x | src/KM_error.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/KM_error.h b/src/KM_error.h index ad94f6c..81a01c9 100755 --- a/src/KM_error.h +++ b/src/KM_error.h @@ -49,6 +49,10 @@ namespace Kumu { int value; std::string label, symbol, message; + /** operating-system-dependent error code, if known. + * 0 on success or if the OS error code is not known. + */ + int os_error = 0; Result_t(); public: @@ -67,6 +71,8 @@ namespace Kumu static const Result_t& Get(unsigned int); Result_t(int v, const std::string& s, const std::string& l); + // Create a new Result_t from an existing one with a specified operating system error code + Result_t(const Result_t& other, int o); Result_t(const Result_t& rhs); const Result_t& operator=(const Result_t& rhs); ~Result_t(); @@ -86,6 +92,7 @@ namespace Kumu inline operator const char*() const { return label.c_str(); } inline const char* Symbol() const { return symbol.c_str(); } inline const char* Message() const { return message.c_str(); } + inline int OsError() const { return os_error; } }; KM_DECLARE_RESULT(FALSE, 1, "Successful but not true."); |
