OSDN Git Service

Add facility for control of child window placement.
[mingw/wtklite.git] / errtext.cpp
1 /*
2  * errtext.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::error_text class,
12  * a utility class to facilitate formatting of diagnostic messages for
13  * use with the WTK::runtime_error exception class.
14  *
15  * Written by Keith Marshall <keithmarshall@users.sourceforge.net>
16  * Copyright (C) 2012, MinGW.org Project.
17  *
18  * ---------------------------------------------------------------------------
19  *
20  * Permission is hereby granted, free of charge, to any person obtaining a
21  * copy of this software and associated documentation files (the "Software"),
22  * to deal in the Software without restriction, including without limitation
23  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
24  * and/or sell copies of the Software, and to permit persons to whom the
25  * Software is furnished to do so, subject to the following conditions:
26  *
27  * The above copyright notice, this permission notice, and the following
28  * disclaimer shall be included in all copies or substantial portions of
29  * the Software.
30  *
31  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
32  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
33  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
34  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
35  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
36  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
37  * DEALINGS IN THE SOFTWARE.
38  *
39  * ---------------------------------------------------------------------------
40  *
41  */
42 #include <stdio.h>
43 #include <stdarg.h>
44
45 #include "wtkexcept.h"
46
47 namespace WTK
48 {
49   char error_text::message[256];
50
51   error_text::error_text( const char *fmt, ... ) throw()
52   {
53     /* Constructor: uses printf semantics to format an error message,
54      * storing the resultant text int the class's static buffer.
55      */
56     va_list argv;
57     va_start( argv, fmt );
58     vsnprintf( message, sizeof( message ), fmt, argv );
59     va_end( argv );
60   }
61 }
62
63 /* $RCSfile$: end of file */