home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 17 / CD_ASCQ_17_101194.iso / dos / prg / todb101 / todb / lib / cpperr.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-04-21  |  1.8 KB  |  77 lines

  1. // ========================================================================
  2. //  TODB LIBRARY
  3. //    cpperr.h
  4. //
  5. //    Object for reporting errors
  6. //    ErrReporter class, DosErrReporter class
  7. //
  8. //    Version: see TODB.H file
  9. //
  10. //    Copyright 1993 Christian Thérien
  11. //    All rights reserved
  12. //
  13. //  See Scott R. Ladd reference in the documentation manual for a
  14. //  complete implementation of these classes.
  15. //
  16. //  Complete implementation is:
  17. //    Copyright 1992 Scott Robert Ladd
  18. //    All Rights Reserved
  19. //
  20. // ========================================================================
  21.  
  22. #ifndef _CPPERR_H
  23. #define _CPPERR_H
  24.  
  25. class ErrReporter;
  26. #include "strn.h"
  27. #include <iostream.h>
  28.  
  29. //-------------------------------------------------------------------------
  30. // ErrReporter class
  31. //    Error message generator
  32. //-------------------------------------------------------------------------
  33.  
  34. class ErrReporter
  35. {
  36. public:
  37.     virtual ~ErrReporter();
  38.  
  39.     virtual void Abort( const String & msg ) = 0;
  40.     virtual void Fatal( const String & msg ) = 0;
  41.  
  42. protected:
  43.     virtual void MsgOut( const String & msg ) = 0;
  44. };
  45.  
  46. inline ErrReporter::~ErrReporter()
  47. {
  48. }
  49.  
  50. //-------------------------------------------------------------------------
  51. // DosErrReporter class
  52. //    Error message generator for DOS
  53. //-------------------------------------------------------------------------
  54.  
  55. class DosErrReporter : public ErrReporter
  56. {
  57. public:
  58.     DosErrReporter( ostream * strm = NULL );
  59.  
  60.     ~DosErrReporter();
  61.  
  62.     void Abort( const String & msg );
  63.     void Fatal( const String & msg );
  64.  
  65. protected:
  66.     void MsgOut( const String & msg );
  67.  
  68. private:
  69.     ostream * destination_;
  70. };
  71.  
  72. inline DosErrReporter::~DosErrReporter()
  73. {
  74. }
  75.  
  76. #endif // _CPPERR_H
  77.