The Conroy & Conroy Subroutine Library (2021.3 edition)

TCOM_Stream
What: Class
Ancestor: TCommon_COM_Interface
File: _Streams
Layer: 0
Platforms: C++, Pascal (All)

This class is the abstract base class for COM streams. The methods in this class use the stdcall calling convention. The class contains the following methods:

At_End
bool At_End()
function At_End : boolean
Returns True if there is no more data in the stream to read.

Read
int32 Read( void* Buffer, int32 _Size )
function Read( var Buffer ; var _Size : longint ) : longint
Reads the specified number of bytes from the stream. Returns the actual bytes transferred in _Size. In C++ and Pascal, any kind of data can be read from the stream. All other platforms read an integer value of the specified length.

Read_Line
void Read_Line( void* Buffer, int32 &_Size )
procedure Read_Line( var Buffer ; var _Size : longint )
Reads one line of input, up to the size of the buffer. The line is assumed to end at an ASCII 13 code. The ASCII 13 code is not included in the returned data. Size is modified to be the actual bytes transferred.

Seek
void Seek( int32 Position )
procedure Seek( Position : longint )
Position to specified byte within streamed data.

Size
int32 Size()
function Size : longint
Returns size of stream data, in bytes. -1 indicate that the size is unknown or larger than 2^31.

Write
int32 Write( void* Buffer, int32 _Size )
procedure Write( var Buffer ; _Size : longint )
Writes the specified buffer, of the specified size in bytes, to the stream. Any kind of data can be passed in C++ and Pascal. All other platforms require the Buffer to be an integer of the largest size for that platform (32 or 64-bits), although only as many bytes as specified are written to the stream. All other types of data should be serialized to a string and written using Write_Line.

Write_Line
void Write_Line( char* Buffer )
procedure Write_Line( Buffer : PChar )
Writes the specified null-terminated text to the stream. An ASCII code 13 is appended to the text on output.