Cupt
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator
format2.hpp
00001 /**************************************************************************
00002 *   Copyright (C) 2011 by Eugene V. Lyubimkin                             *
00003 *                                                                         *
00004 *   This program is free software; you can redistribute it and/or modify  *
00005 *   it under the terms of the GNU General Public License                  *
00006 *   (version 3 or above) as published by the Free Software Foundation.    *
00007 *                                                                         *
00008 *   This program is distributed in the hope that it will be useful,       *
00009 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00010 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00011 *   GNU General Public License for more details.                          *
00012 *                                                                         *
00013 *   You should have received a copy of the GNU GPL                        *
00014 *   along with this program; if not, write to the                         *
00015 *   Free Software Foundation, Inc.,                                       *
00016 *   51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA               *
00017 **************************************************************************/
00018 
00019 // only for internal inclusion
00020 
00022 
00023 #include <common/format2.hpp>
00024 
00025 namespace cupt {
00026 
00027 CUPT_API void __mwrite_line(const char*, const string&);
00028 
00029 template < typename... Args >
00030 void fatal2(const char* format, const Args&... args)
00031 {
00032     auto errorString = format2(format, args...);
00033     __mwrite_line("E: ", errorString);
00034     throw Exception(errorString);
00035 }
00036 
00037 template < typename... Args >
00038 void fatal2e(const char* format, const Args&... args)
00039 {
00040     auto errorString = format2e(format, args...);
00041     __mwrite_line("E: ", errorString);
00042     throw Exception(errorString);
00043 }
00044 
00045 template < typename... Args >
00046 void warn2(const char* format, const Args&... args)
00047 {
00048     __mwrite_line("W: ", format2(format, args...));
00049 }
00050 
00051 template < typename... Args >
00052 void warn2e(const char* format, const Args&... args)
00053 {
00054     __mwrite_line("W: ", format2e(format, args...));
00055 }
00056 
00057 template < typename... Args >
00058 void debug2(const char* format, const Args&... args)
00059 {
00060     __mwrite_line("D: ", format2(format, args...));
00061 }
00062 
00063 template < typename... Args >
00064 void simulate2(const char* format, const Args&... args)
00065 {
00066     __mwrite_line("S: ", format2(format, args...));
00067 }
00068 
00069 }
00070 
00072 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator