Deskflow 1.22.0.197
Keyboard and mouse sharing utility
Loading...
Searching...
No Matches
XBase.h
Go to the documentation of this file.
1/*
2 * Deskflow -- mouse and keyboard sharing utility
3 * SPDX-FileCopyrightText: (C) 2012 - 2016 Symless Ltd.
4 * SPDX-FileCopyrightText: (C) 2002 Chris Schoeneman
5 * SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
6 */
7
8#pragma once
9
10#include <stdexcept>
11#include <string>
12
14
17class XBase : public std::runtime_error
18{
19public:
21 XBase();
23 explicit XBase(const std::string &msg);
24 ~XBase() throw() override = default;
25
27 const char *what() const throw() override;
28
29protected:
31 virtual std::string getWhat() const noexcept
32 {
33 return "";
34 }
35
37
42 virtual std::string format(const char *id, const char *defaultFormat, ...) const noexcept;
43
44private:
45 mutable std::string m_what;
46};
XBase()
Use getWhat() as the result of what()
Definition XBase.cpp:17
virtual std::string getWhat() const noexcept
Get a human readable string describing the exception.
Definition XBase.h:31
~XBase() override=default
virtual std::string format(const char *id, const char *defaultFormat,...) const noexcept
Format a string.
Definition XBase.cpp:37
const char * what() const override
Reason for exception.
Definition XBase.cpp:27
Definition Config.h:29