CBFSFilterStream Type
Syntax
CBFSFilterStream (declared in cbfsfilter.h)
Remarks
The CBFSFilterStream type is returned by some of the CBFilter class's methods. All stream types in CBFS Filter share a common API, documented below.
Properties | |
Length |
Gets or sets the length of the stream, in bytes.
int64 GetLength(); |
Position |
Gets or sets the current position within the stream.
int64 GetPosition(); |
Methods | |
Close |
Closes the stream, releasing all resources currently allocated for it.
void Close(); This method is called automatically when a CBFSFilterStream object is deleted. |
Flush |
Forces all data held by the stream's buffers to be written out to storage.
void Flush(); |
GetLastError |
If the previous operation failed, returns the associated error message, if any.
char* GetLastError(); |
GetLastErrorCode |
If the previous operation failed, returns a non-zero error code; otherwise returns zero.
int GetLastErrorCode(); This method will always return -1 after Close has been called. |
Read |
Reads a sequence of bytes from the stream and advances the current position within the stream by the number of bytes read.
int Read(void* buffer, int count); Buffer specifies the buffer to populate with data from the stream. Count specifies the number of bytes that should be read from the stream. Returns the total number of bytes read into Buffer. This may be less than Count if that many bytes are not currently available, or may be 0 if the end of the stream has been reached. |
Seek |
Sets the current position within the stream based on a particular point of origin.
int64 Seek(int64 offset, SeekOrigin origin); Offset specifies the offset in the stream to seek to, relative to Origin. SeekOrigin is an enum declared alongside the CBFSFilterStream class as shown above. Returns the new position within the stream. |
Write |
Writes a sequence of bytes to the stream and advances the current position within the stream by the number of bytes written.
int Write(void* buffer, int count); Buffer specifies the buffer with data to write to the stream. Count specifies the number of bytes that should be written to the stream. Returns the total number of bytes written to the stream. |