1 /* 2 * Copyright 2006 Sony Computer Entertainment Inc. 3 * 4 * Licensed under the MIT Open Source License, for details please see license.txt or the website 5 * http://www.opensource.org/licenses/mit-license.php 6 * 7 */ 8 9 #ifndef _STDERR_PLUGIN_ 10 #define _STDERR_PLUGIN_ 11 12 #include <dae/daeTypes.h> 13 #include <dae/daeErrorHandler.h> 14 15 /** 16 * The @c stdErrPlugin class is the default implementation of daeErrorHandler. It routes the Error 17 * and Warning messaged to stdout. 18 */ 19 class DLLSPEC stdErrPlugin : public daeErrorHandler { 20 public: 21 stdErrPlugin(); 22 virtual ~stdErrPlugin(); 23 24 public: 25 void handleError( daeString msg ); 26 void handleWarning( daeString msg ); 27 }; 28 29 /** 30 * The @c quietErrorHandler class is an alternative implementation of daeErrorHandler. It suppresses 31 * error and warning messages. The easiest way to use it is like this: 32 * daeErrorHandler::setErrorHandler(&quietErrorHandler::getInstance()); 33 */ 34 class DLLSPEC quietErrorHandler : public daeErrorHandler { 35 public: quietErrorHandler()36 quietErrorHandler() { } handleError(daeString msg)37 void handleError(daeString msg) { } handleWarning(daeString msg)38 void handleWarning(daeString msg) { } 39 getInstance()40 static quietErrorHandler& getInstance() { return theInstance; } 41 42 private: 43 static quietErrorHandler theInstance; 44 }; 45 46 #endif 47