home *** CD-ROM | disk | FTP | other *** search
/ Chip 2001 Mobile / Chip_Mobile_2001.iso / palm / business / printcar / printcar.exe / src / Util / DataOutputStream.h < prev    next >
C/C++ Source or Header  |  2000-06-05  |  608b  |  28 lines

  1. //
  2. //  $Id: DataOutputStream.h,v 1.2 2000/06/04 23:23:50 sergey Exp $
  3. //
  4.  
  5. #ifndef _DataOutputStream_h_
  6. #define _DataOutputStream_h_
  7.  
  8. #include "OutputStream.h"
  9.  
  10.  
  11. namespace Util
  12. {
  13.     //
  14.     // Abstract base stream class, oriented to write concrete data types.
  15.     //
  16.     class DataOutputStream: public OutputStream
  17.     {
  18.     public:
  19.         void write(const char* string)  { writeData(string, strlen(string)+1); }
  20.  
  21.         template <typename T>
  22.         void write(T value)             { writeData(&value, sizeof(value)); }
  23.     };
  24. }
  25. // namespace Util
  26.  
  27. #endif // _DataOutputStream_h_
  28.