Objective Systems, Inc.  
Home
About ASN.1
Products
Free Software
Documents
Services
Resources
Resellers
Customers
Careers
About Us
Contact Us
 

Google


Objective Systems, Inc.

OSInputStreamIF Class Reference

The base interface class for input streams. More...

#include <rtxCppInputStreamIF.h>

Inheritance diagram for OSInputStreamIF:

OSStreamIF OSInputStream OSBufferedInputStream OSFileInputStream OSMemoryInputStream OSSocketInputStream List of all members.

Public Member Functions

virtual ~OSInputStreamIF ()
 Virtual destructor.
virtual int close ()=0
 Closes the input or output stream and releases any system resources associated with the stream.
virtual size_t currentPos ()=0
 This method returns the current position in the stream (in octets).
virtual int flush ()=0
 Flushes the buffered data to the stream.
virtual int getStatus () const =0
 This method returns the completion status of previous operation.
virtual OSBOOL isOpened ()=0
 Checks, is the stream opened or not.
virtual OSBOOL markSupported ()=0
 Tests if this input stream supports the mark and reset methods.
virtual int mark (size_t readAheadLimit)=0
 This method marks the current position in this input stream.
virtual long read (OSOCTET *pDestBuf, size_t maxToRead)=0
 Read data from the stream.
virtual long readBlocking (OSOCTET *pDestBuf, size_t toReadBytes)=0
 Read data from the stream.
virtual int reset ()=0
 Repositions this stream to the position at the time the mark method was last called on this input stream.
virtual int skip (size_t n)=0
 Skips over and discards the specified amount of data octets from this input stream.

Detailed Description

The base interface class for input streams.

Definition at line 36 of file rtxCppInputStreamIF.h.


Constructor & Destructor Documentation

virtual OSInputStreamIF::~OSInputStreamIF  )  [virtual]
 

Virtual destructor.

Closes the stream if it was opened.


Member Function Documentation

virtual int OSInputStreamIF::close  )  [pure virtual]
 

Closes the input or output stream and releases any system resources associated with the stream.

For output streams this function also flushes all internal buffers to the stream.

Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.
See also:
rtxStreamClose

Implements OSStreamIF.

Implemented in OSInputStream.

virtual size_t OSInputStreamIF::currentPos  )  [pure virtual]
 

This method returns the current position in the stream (in octets).

Returns:
The number of octets already read from the stream.

Implemented in OSInputStream.

virtual int OSInputStreamIF::flush  )  [pure virtual]
 

Flushes the buffered data to the stream.

Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.
See also:
rtxStreamFlush

Implements OSStreamIF.

Implemented in OSInputStream.

virtual int OSInputStreamIF::getStatus  )  const [pure virtual]
 

This method returns the completion status of previous operation.

It can be used to check completion status of constructors or methods, which do not return completion status.

Returns:
Runtime status code:
  • 0 = success,
  • negative return value is error.

Implements OSStreamIF.

Implemented in OSInputStream.

virtual OSBOOL OSInputStreamIF::isOpened  )  [pure virtual]
 

Checks, is the stream opened or not.

Returns:
s TRUE, if the stream is opened, FALSE otherwise.
See also:
rtxStreamIsOpened

Implements OSStreamIF.

Implemented in OSInputStream.

virtual int OSInputStreamIF::mark size_t  readAheadLimit  )  [pure virtual]
 

This method marks the current position in this input stream.

A subsequent call to the reset method repositions this stream at the last marked position so that subsequent reads re-read the same bytes. The readAheadLimit argument tells this input stream to allow that many bytes to be read before the mark position gets invalidated.

Parameters:
readAheadLimit the maximum limit of bytes that can be read before the mark position becomes invalid.
Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.
See also:
rtxStreamMark, rtxStreamReset

Implemented in OSInputStream.

virtual OSBOOL OSInputStreamIF::markSupported  )  [pure virtual]
 

Tests if this input stream supports the mark and reset methods.

Whether or not mark and reset are supported is an invariant property of a particular input stream instance. By default, it returns FALSE.

Returns:
TRUE if this stream instance supports the mark and reset methods; FALSE otherwise.
See also:
rtxStreamIsMarkSupported

Implemented in OSInputStream.

virtual long OSInputStreamIF::read OSOCTET *  pDestBuf,
size_t  maxToRead
[pure virtual]
 

Read data from the stream.

This method reads up to maxToRead bytes from the stream. It may return a value less then this if the mamimum number of bytes is not available.

Parameters:
pDestBuf Pointer to a buffer to receive a data.
maxToRead Size of the buffer.
Returns:
The total number of octets read into the buffer, or negative value with error code if any error is occurred.
See also:
rtxStreamRead

Implemented in OSInputStream.

virtual long OSInputStreamIF::readBlocking OSOCTET *  pDestBuf,
size_t  toReadBytes
[pure virtual]
 

Read data from the stream.

This method reads up to maxToRead bytes from the stream. It may return a value less then this if the mamimum number of bytes is not available.

Parameters:
pDestBuf Pointer to a buffer to receive a data.
toReadBytes Number of bytes to be read.
Returns:
The total number of octets read into the buffer, or negative value with error code if any error is occurred.
See also:
rtxStreamRead

Implemented in OSInputStream.

virtual int OSInputStreamIF::reset  )  [pure virtual]
 

Repositions this stream to the position at the time the mark method was last called on this input stream.

Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.
See also:
rtxStreamMark, rtxStreamReset

Implemented in OSInputStream.

virtual int OSInputStreamIF::skip size_t  n  )  [pure virtual]
 

Skips over and discards the specified amount of data octets from this input stream.

Parameters:
n The number of octets to be skipped.
Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.
See also:
rtxStreamSkip

Implemented in OSInputStream.


The documentation for this class was generated from the following file:

This file was last modified on 8 Jan 2007.
XBinder, Version 1.1.9