Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

120 lines
2.9 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1992 - 1992.
  5. //
  6. // File: SStream.hxx
  7. //
  8. // Contents: Stream classes to serialize/deseriale C++ wrapper(s) for
  9. // restrictions, variants, etc.
  10. //
  11. // History: 01-Aug-94 KyleP Created
  12. //
  13. //--------------------------------------------------------------------------
  14. #if !defined( __SSTREAM_HXX__ )
  15. #define __SSTREAM_HXX__
  16. //+-------------------------------------------------------------------------
  17. //
  18. // Class: PSerStream
  19. //
  20. // Purpose: Pure-virtual class used to serialize basic types.
  21. //
  22. // History: 28-Jul-94 KyleP Created
  23. //
  24. //--------------------------------------------------------------------------
  25. class PSerStream
  26. {
  27. public:
  28. virtual ~PSerStream() {};
  29. virtual void PutByte( BYTE b ) = 0;
  30. virtual void PutChar( char const * pc, ULONG cc ) = 0;
  31. virtual void PutWChar( WCHAR const * pwc, ULONG cc ) = 0;
  32. virtual void PutUShort( USHORT us ) = 0;
  33. virtual void PutULong( ULONG ul ) = 0;
  34. virtual void PutLong( long l ) = 0;
  35. virtual void PutFloat( float f ) = 0;
  36. virtual void PutDouble( double d ) = 0;
  37. virtual void PutString( char const * psz ) = 0;
  38. virtual void PutWString( WCHAR const * pwsz ) = 0;
  39. virtual void PutBlob( BYTE const * pb, ULONG cb ) = 0;
  40. virtual void PutGUID( GUID const & guid ) = 0;
  41. };
  42. //+-------------------------------------------------------------------------
  43. //
  44. // Class: PDeSerStream
  45. //
  46. // Purpose: Pure-virtual class used to serialize basic types.
  47. //
  48. // History: 28-Jul-94 KyleP Created
  49. //
  50. //--------------------------------------------------------------------------
  51. class PDeSerStream
  52. {
  53. public:
  54. virtual ~PDeSerStream() {};
  55. virtual BYTE GetByte() = 0;
  56. virtual void SkipByte() = 0;
  57. virtual void GetChar( char * pc, ULONG cc ) = 0;
  58. virtual void SkipChar( ULONG cc ) = 0;
  59. virtual void GetWChar( WCHAR * pwc, ULONG cc ) = 0;
  60. virtual void SkipWChar( ULONG cc ) = 0;
  61. virtual USHORT GetUShort() = 0;
  62. virtual void SkipUShort() = 0;
  63. virtual ULONG GetULong() = 0;
  64. virtual void SkipULong() = 0;
  65. virtual ULONG PeekULong() = 0;
  66. virtual long GetLong() = 0;
  67. virtual void SkipLong() = 0;
  68. #if defined(KERNEL) // Can not return floating point #'s in the kernel
  69. virtual ULONG GetFloat() = 0;
  70. virtual LONGLONG GetDouble() = 0;
  71. #else
  72. virtual float GetFloat() = 0;
  73. virtual double GetDouble() = 0;
  74. #endif
  75. virtual void SkipFloat() = 0;
  76. virtual void SkipDouble() = 0;
  77. virtual char * GetString() = 0;
  78. virtual WCHAR * GetWString() = 0;
  79. virtual void GetBlob( BYTE * pb, ULONG cb ) = 0;
  80. virtual void SkipBlob( ULONG cb ) = 0;
  81. virtual void GetGUID( GUID & guid ) = 0;
  82. virtual void SkipGUID() = 0;
  83. };
  84. #endif // __SSTREAM_HXX__