Audacity 3.2.0
Error.h
Go to the documentation of this file.
1/*
2 * SPDX-License-Identifier: GPL-2.0-or-later
3 * SPDX-FileName: Error.h
4 * SPDX-FileContributor: Dmitry Vedenko
5 */
6
7#pragma once
8
9#include <string>
10
12
13namespace audacity::sqlite
14{
16class SQLITE_HELPERS_API Error final
17{
18public:
19 Error() noexcept;
20 explicit Error(int code) noexcept;
21
22 Error(const Error&) = default;
23 Error(Error&&) = default;
24
25 Error& operator=(const Error&) = default;
26 Error& operator=(Error&&) = default;
27
29 bool IsError() const noexcept;
31 bool IsOk() const noexcept;
33 explicit operator bool() const noexcept;
34
35 [[noreturn]] void Raise () const;
36
37 int GetCode() const noexcept;
38 TranslatableString GetErrorString() const;
39
40private:
41 int mCode;
42};
43} // namespace audacity::sqlite
Holds a msgid for the translation catalog; may also bind format arguments.
A class representing an error in SQLite.
Definition: Error.h:17
Error(Error &&)=default
Error & operator=(const Error &)=default
Error & operator=(Error &&)=default
Error(const Error &)=default