LIBEUNOMIA
読み取り中…
検索中…
一致する文字列を見つけられません
exception.h
[詳解]
1/*
2 * Copyright 2021 oZ/acy (名賀月晃嗣) <acy@hiemalis.org>
3 *
4 * Redistribution and use in source and binary forms,
5 * with or without modification,
6 * are permitted provided that the following conditions are met:
7 *
8 * 1. Redistributions of source code must retain the above copyright notice,
9 * this list of conditions and the following disclaimer.
10 *
11 * 2. Redistributions in binary form must reproduce the above copyright notice,
12 * this list of conditions and the following disclaimer in the documentation
13 * and/or other materials provided with the distribution.
14 *
15 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
16 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
17 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
18 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
19 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
20 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
21 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
22 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
23 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
24 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
25 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 *
27 */
36#ifndef INCLUDE_GUARD_EUNOMIA_EXCEPTION_H
37#define INCLUDE_GUARD_EUNOMIA_EXCEPTION_H
38
39#include <string>
40#include <stdexcept>
41
42namespace eunomia
43{
49class Exception : public std::runtime_error
50{
51public:
55 Exception() : runtime_error("eunomia::Exception") {}
56
62 explicit Exception(const std::string& m) : runtime_error(m) {}
63
69 Exception(const std::string& f, const std::string& m)
70 : runtime_error(f + "(): " + m)
71 {}
72
80 Exception(const std::string& c, const std::string& f, const std::string& m)
81 : runtime_error(c + "::" + f + "(): " + m)
82 {}
83};
84
85
86}// end of namespace eunomia
87
88
89#endif // INCLUDE_GUARD_EUNOMIA_EXCEPT_H
例外
Definition exception.h:50
Exception(const std::string &c, const std::string &f, const std::string &m)
構築子
Definition exception.h:80
Exception()
デフォルト構築子
Definition exception.h:55
Exception(const std::string &m)
構築子
Definition exception.h:62
Exception(const std::string &f, const std::string &m)
構築子
Definition exception.h:69
Definition colour.h:49