📄 str_base.h
字号:
// File name: $Workfile: str_base.h $
// Last modified: $Modtime: 9/20/00 11:42a $
// Last modified by: $Author: Bill $
//
// VCS archive path: $Archive: /Hank/DMM/FirmWare/Level3/ObDatMgr/str_base.h $
// VCS revision: $Revision: 6 $
// External interfaces
class CPQDIF_StreamProcessor;
class CPQDIF_StreamIO
{
public:
CPQDIF_StreamIO();
virtual ~CPQDIF_StreamIO();
// Attributes
public:
// Operations
public:
virtual bool SeekPos( long pos ) = 0;
virtual bool GetPos( long& pos ) = 0;
virtual bool SeekEnd( void ) = 0;
virtual BYTE * ReadBlock( long size, long& actualSize ) = 0;
virtual bool CanWriteFull( void ) const { return m_canWriteFull; }
virtual bool CanWriteIncremental( void ) const { return m_canWriteInc; }
virtual bool BeginBlock( void );
virtual bool AppendBlock( BYTE * buffer, long size );
virtual bool WriteBlock( long &sizeActual ) = 0;
virtual void Flush( void ) {} // Optional (default behavior: nothing)
virtual bool ConnectProcessor( CPQDIF_StreamProcessor * proc );
virtual long GetChecksum( void );
virtual void ResetChecksum( void );
// Called by the processor
// =======================
// Dereferences data buffered in the stream for the processor to read.
// The number of bytes available is returned in sizeActual. If max is 0,
// the total remaining length of the input buffer is returned.
// Returns FALSE when at end of buffer, TRUE otherwise.
virtual bool ProcessRead ( const BYTE * &buffer, long max, long& sizeActual );
// Reserves storage in the stream for the processor to write
// data into.
virtual bool ProcessWriteReserve( BYTE * &buffer, long size );
// This function is set the actual size of the buffer reserved
// by preceeding ProceWriteReserve call.
virtual bool ProcessWriteRelease( long sizeActual );
// Implementation
protected:
virtual bool ExecuteProcessorEncode( void );
virtual bool ExecuteProcessorDecode( void );
// Member data
protected:
// This is connected to the object, but not owned by it.
CPQDIF_StreamProcessor * m_processor;
// These are owned by the stream object
bool m_canWriteFull;
bool m_canWriteInc;
CPQByteArray m_buffRead;
long m_sizeRead;
long m_posRead;
CPQByteArray m_buffWrite;
long m_sizeWrite;
long m_posWrite;
};
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -