OTest2
A C++ testing framework
exc.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2018 Ondrej Starek
3  *
4  * This file is part of OTest2.
5  *
6  * OTest2 is free software: you can redistribute it and/or modify it under
7  * the terms of the GNU Lesser General Public License as published by
8  * the Free Software Foundation, either version 3 of the License,
9  * or (at your option) any later version.
10  *
11  * OTest2 is distributed in the hope that it will be useful, but WITHOUT
12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13  * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
14  * License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public License
17  * along with OTest2. If not, see <http://www.gnu.org/licenses/>.
18  */
19 
20 #ifndef OTest2__INCLUDE_OTEST2_EXCEPTION_H_
21 #define OTest2__INCLUDE_OTEST2_EXCEPTION_H_
22 
23 #include <exception>
24 #include <string>
25 
26 namespace OTest2 {
27 
31 class Exception : public std::exception {
32  protected:
36  Exception();
37 
41  Exception(
42  Exception&& exc_) noexcept;
43 
47  virtual ~Exception();
48 
49  public:
50  /* -- avoid copying */
51  Exception(
52  const Exception&) = delete;
54  const Exception&) = delete;
55 
56  /* -- std::exception */
57  virtual const char* what() const noexcept;
58 
63  virtual std::string reason() const = 0;
64 };
65 
66 } /* namespace OTest2 */
67 
68 #endif /* OTest2__INCLUDE_OTEST2_EXCEPTION_H_ */
OTest2::Exception::reason
virtual std::string reason() const =0
Get exception reason.
OTest2::Exception::Exception
Exception()
Ctor.
Definition: exc.cpp:24
OTest2::Exception::what
virtual const char * what() const noexcept
Definition: exc.cpp:37
OTest2::Exception::~Exception
virtual ~Exception()
Dtor.
Definition: exc.cpp:33
OTest2
Definition: assertbean.h:25
OTest2::Exception
Generic OTest2 exception.
Definition: exc.h:31
OTest2::Exception::operator=
Exception & operator=(const Exception &)=delete