OSDN Git Service

Initial commit for new package.
[mingw/wtklite.git] / wtkexcept.cpp
1 /*
2  * wtkexcept.cpp
3  *
4  * ---------------------------------------------------------------------------
5  *
6  * Implementation of a minimal C++ class framework for use with the
7  * Microsoft Windows Application Programming Interface.
8  *
9  * $Id$
10  *
11  * This file provides the implementation for the WTK::runtime_error class,
12  * a derivative of std::exception similar to std::runtime_error, but using
13  * a "const char *" argument in preference to a std::string, to classify
14  * the exception.
15  *
16  * Written by Keith Marshall <keithmarshall@users.sourceforge.net>
17  * Copyright (C) 2012, MinGW.org Project.
18  *
19  * Based on the implementation of mingw-get's dmh_exception class
20  * Originally written by Charles Wilson <cwilso11@users.sourceforge.net>
21  *
22  * ---------------------------------------------------------------------------
23  *
24  * Permission is hereby granted, free of charge, to any person obtaining a
25  * copy of this software and associated documentation files (the "Software"),
26  * to deal in the Software without restriction, including without limitation
27  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
28  * and/or sell copies of the Software, and to permit persons to whom the
29  * Software is furnished to do so, subject to the following conditions:
30  *
31  * The above copyright notice and this permission notice shall be included
32  * in all copies or substantial portions of the Software.
33  *
34  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
35  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
36  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
37  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
38  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
39  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
40  * DEALINGS IN THE SOFTWARE.
41  *
42  * ---------------------------------------------------------------------------
43  *
44  */
45 #include "wtkexcept.h"
46
47 namespace WTK
48 {
49   static const char *unspecified = "Unspecified exception";
50
51   runtime_error::runtime_error() throw(): message( unspecified ){}
52
53   runtime_error::runtime_error( const char *msg ) throw(): message( unspecified )
54   { if( msg && *msg ) message = msg; }
55
56   const char *runtime_error::what() const throw(){ return message; }
57 }
58
59 /* $RCSfile$: end of file */