Unicorn XML Toolkit
Version 1.50.00

Namespace Core
Class IStream

class IStream: public CInterface {
public:
    enum {
        begin,
        current,
        end
        };
public:
    virtual ~IStream();
public:
    virtual int Read(BYTE *pBuf, int nCount);
    virtual void Write(const BYTE *pBuf, int nCount);
    virtual void SetPosition(long lOff, int nFrom);
    virtual long GetPosition();
    };
typedef XInterface<IStream> XStream;

The base class for byte streams.

Since:
1.00.00
Version:
1.50.00
Author:
Alexey Gokhberg
Constructor/Destructor Summary
~IStream ();
����������Destroys the byte stream.

Function Summary
int Read (BYTE *pBuf, int nCount);
����������Reads the specified number of bytes into the specified buffer from this stream.
void Write (const BYTE *pBuf, int nCount);
����������Writes the specified number of bytes from the specified buffer to this stream.
void SetPosition (long lOff, int nFrom);
����������Moves the stream I/O pointer to the specified position.
long GetPosition ();
����������Returns a current position of the stream I/O pointer.

Constructor/Destructor Detail

~IStream

virtual ~IStream();

Destroys the byte stream.

Function Detail

Read

virtual int Read(BYTE *pBuf, int nCount);

Reads the specified number of bytes into the specified buffer from this stream.

The number of bytes actually read may be less than the number of bytes requested.

Parameters:
pBuf - the buffer to hold result
nCount - the number of bytes to read
Returns:
the number of bytes actually read; the negative integer if read error occured

Write

virtual void Write(const BYTE *pBuf, int nCount);

Writes the specified number of bytes from the specified buffer to this stream.

Parameters:
pBuf - the buffer to write
nCount - the number of bytes to write

SetPosition

virtual void SetPosition(long lOff, int nFrom);

Moves the stream I/O pointer to the specified position.

The stream I/O pointer is positioned relatively to the origin. The origin is specified using the origin code; allowed values are: begin for beginning of the stream, current for current position of the stream I/O pointer, and end for end of the stream.

Parameters:
lOff - the relative position
nFrom - the origin code

GetPosition

virtual long GetPosition();

Returns a current position of the stream I/O pointer.

Returns:
the current position of the stream I/O pointer

Unicorn XML Toolkit
Version 1.50.00


This document was created using Unicorn DOC++.

Copyright 1999-2001 Unicorn Enterprises SA.
All Rights Reserved.