summaryrefslogtreecommitdiffstats
path: root/public/sdk/inc/memser.hxx
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--public/sdk/inc/memser.hxx79
1 files changed, 79 insertions, 0 deletions
diff --git a/public/sdk/inc/memser.hxx b/public/sdk/inc/memser.hxx
new file mode 100644
index 000000000..b3a8d74a6
--- /dev/null
+++ b/public/sdk/inc/memser.hxx
@@ -0,0 +1,79 @@
+//+-------------------------------------------------------------------------
+//
+// Microsoft Windows
+// Copyright (C) Microsoft Corporation, 1992 - 1992.
+//
+// File: MemSer.hxx
+//
+// History: 29-Jul-94 KyleP Created
+//
+//--------------------------------------------------------------------------
+
+#if !defined( __MEMSER_HXX__ )
+#define __MEMSER_HXX__
+
+#include <restrict.hxx>
+#include <SStream.hxx>
+
+class CMemSerStream : public PSerStream
+{
+public:
+
+ CMemSerStream( unsigned cb );
+ CMemSerStream(BYTE * pb, ULONG cb);
+
+ virtual ~CMemSerStream();
+
+ inline BYTE *AcqBuf();
+
+ virtual void PutByte( BYTE b );
+
+ virtual void PutChar( char const * pc, ULONG cc );
+
+ virtual void PutWChar( WCHAR const * pwc, ULONG cc );
+
+ virtual void PutUShort( USHORT us );
+
+ virtual void PutULong( ULONG ul );
+
+ virtual void PutLong( long l );
+
+ virtual void PutFloat( float f );
+
+ virtual void PutDouble( double d );
+
+ virtual void PutString( char const * psz );
+
+ virtual void PutWString( WCHAR const * pwsz );
+
+ virtual void PutBlob( BYTE const * pb, ULONG cb );
+
+ virtual void PutGUID( GUID const & guid );
+
+ inline unsigned Size() { return _cb; }
+
+protected:
+
+ unsigned _cb;
+ BYTE * _pb;
+ BYTE * _pbCurrent;
+ BYTE * _pbEnd;
+};
+
+inline BYTE * CMemSerStream::AcqBuf()
+{
+ BYTE * pb;
+
+ if ( _cb > 0 )
+ {
+ pb = _pb;
+ _pb = 0;
+ _cb = 0;
+ }
+ else
+ pb = 0;
+
+ return( pb );
+}
+
+#endif // __MEMSER_HXX__