Deskflow 1.26.0.314
Keyboard and mouse sharing utility
Loading...
Searching...
No Matches
BaseException.h
Go to the documentation of this file.
1/*
2 * Deskflow -- mouse and keyboard sharing utility
3 * SPDX-FileCopyrightText: (C) 2025 - 2026 Deskflow Developers
4 * SPDX-FileCopyrightText: (C) 2012 - 2016 Synergy App Ltd
5 * SPDX-FileCopyrightText: (C) 2002 Chris Schoeneman
6 * SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
7 */
8
9#pragma once
10
11#include <stdexcept>
12#include <string>
13
14#include <QByteArray>
15#include <QString>
16
18
21class BaseException : public std::runtime_error
22{
23public:
27 explicit BaseException(const QString &msg);
28 ~BaseException() throw() override = default;
29
31 const char *what() const throw() override;
32
33protected:
35 virtual QString getWhat() const noexcept
36 {
37 return {};
38 }
39
41
46 virtual QString format(const char *id, const char *defaultFormat, ...) const noexcept;
47
48private:
49 mutable QByteArray m_what;
50};
virtual QString getWhat() const noexcept
Get a human readable string describing the exception.
Definition BaseException.h:35
virtual QString format(const char *id, const char *defaultFormat,...) const noexcept
Format a string.
Definition BaseException.cpp:38
BaseException()
Use getWhat() as the result of what().
Definition BaseException.cpp:18
const char * what() const override
Reason for exception.
Definition BaseException.cpp:28
~BaseException() override=default