InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
IXferBytes Class Referenceabstract

#include <IXferBytes.h>

Inheritance diagram for IXferBytes:
IDHAMemoryXferBytesPrtMemMemoryXferBytes

Public Member Functions

virtual uint32 Read (void *buffer, uint32 num)=0
 
virtual uint32 Write (void *buffer, uint32 num)=0
 
virtual uint64 Seek (int64 numberOfBytes, SeekFromWhere fromHere)=0
 
virtual void Flush ()=0
 
virtual StreamState GetStreamState ()=0
 
virtual void SetEndOfStream ()=0
 

Detailed Description

IXferBytes is a very simple streaming protocol that underlies the streaming classes. Generally you do not need to access it directly, but it can be useful if you are want to have a read-write stream, or if you need to implement a new stream implementation.

See Also
IPMStream

Member Function Documentation

virtual void IXferBytes::Flush ()
pure virtual

Flush all pending output out to the stream.

Implemented in PrtMemMemoryXferBytes, and IDHAMemoryXferBytes.

virtual StreamState IXferBytes::GetStreamState ()
pure virtual

Get the stream status (how to check for end of file).

Implemented in PrtMemMemoryXferBytes, and IDHAMemoryXferBytes.

virtual uint32 IXferBytes::Read (void * buffer,
uint32 num 
)
pure virtual

Read the next num bytes from the stream into the buffer. Returns the number of bytes that were read in, this can be less than the number requested if end of stream or some other error is encountered.

Parameters
bufferwhere to put the data read in
numnumber of bytes requested to read
Returns
uint32 number of bytes actually read.

Implemented in PrtMemMemoryXferBytes, and IDHAMemoryXferBytes.

virtual uint64 IXferBytes::Seek (int64 numberOfBytes,
SeekFromWhere fromHere 
)
pure virtual

Set the stream's current location. Returns the current (new) position as an offset from the start of the stream.

Parameters
numberOfByteshow far to seek
fromHereseek relative to this point (start, current, or end)
Returns
uint32 new location, returned relative to the start of the stream

Implemented in PrtMemMemoryXferBytes, and IDHAMemoryXferBytes.

virtual void IXferBytes::SetEndOfStream ()
pure virtual

Truncate the stream at the current location. Any read past this point will encounter end of stream.

Implemented in PrtMemMemoryXferBytes, and IDHAMemoryXferBytes.

virtual uint32 IXferBytes::Write (void * buffer,
uint32 num 
)
pure virtual

Write num bytes from the buffer into the stream at the current location. Returns the number of bytes that were actually written out.

Parameters
buffercontains the data to write
numnumber of bytes requested to write
Returns
uint32 number of bytes actually written

Implemented in PrtMemMemoryXferBytes, and IDHAMemoryXferBytes.