stdErrPlugin.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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. #ifndef _STDERR_PLUGIN_
  9. #define _STDERR_PLUGIN_
  10. #include <dae/daeTypes.h>
  11. #include <dae/daeErrorHandler.h>
  12. /**
  13. * The @c stdErrPlugin class is the default implementation of daeErrorHandler. It routes the Error
  14. * and Warning messaged to stdout.
  15. */
  16. class DLLSPEC stdErrPlugin : public daeErrorHandler {
  17. public:
  18. stdErrPlugin();
  19. virtual ~stdErrPlugin();
  20. public:
  21. void handleError( daeString msg );
  22. void handleWarning( daeString msg );
  23. };
  24. /**
  25. * The @c quietErrorHandler class is an alternative implementation of daeErrorHandler. It suppresses
  26. * error and warning messages. The easiest way to use it is like this:
  27. * daeErrorHandler::setErrorHandler(&quietErrorHandler::getInstance());
  28. */
  29. class DLLSPEC quietErrorHandler : public daeErrorHandler {
  30. public:
  31. quietErrorHandler() { }
  32. void handleError(daeString msg) { }
  33. void handleWarning(daeString msg) { }
  34. static quietErrorHandler& getInstance() { return theInstance; }
  35. private:
  36. static quietErrorHandler theInstance;
  37. };
  38. #endif