|
|
 |
 |
|
OSInputStream Class ReferenceThe base class for input streams.
More...
#include <rtxCppInputStream.h>
Inheritance diagram for OSInputStream:
List of all members.
|
Public Member Functions |
| | OSInputStream () |
| | The default constructor.
|
| virtual | ~OSInputStream () |
| | Virtual destructor.
|
| virtual int | close () |
| | Closes the input or output stream and releases any system resources associated with the stream.
|
| virtual size_t | currentPos () |
| | This method returns the current position in the stream (in octets).
|
| virtual int | flush () |
| | Flushes the buffered data to the stream.
|
| virtual OSCtxtPtr | getContext () |
| | This method returns a pointer to the underlying OSContext object.
|
| virtual OSCTXT * | getCtxtPtr () |
| | This method returns a pointer to the underlying OSCTXT object.
|
| virtual char * | getErrorInfo () |
| | Returns error text in a dynamic memory buffer.
|
| virtual char * | getErrorInfo (char *pBuf, size_t &bufSize) |
| | Returns error text in a memory buffer.
|
| virtual int | getStatus () const |
| | This method returns the completion status of previous operation.
|
| virtual OSBOOL | isOpened () |
| | Checks, is the stream opened or not.
|
| virtual OSBOOL | markSupported () |
| | Tests if this input stream supports the mark and reset methods.
|
| virtual int | mark (size_t readAheadLimit) |
| | This method marks the current position in this input stream.
|
|
void | printErrorInfo () |
| | The printErrorInfo method prints information on errors contained within the context.
|
|
void | resetErrorInfo () |
| | The resetErrorInfo method resets information on errors contained within the context.
|
| virtual long | read (OSOCTET *pDestBuf, size_t maxToRead) |
| | Read data from the stream.
|
| virtual long | readBlocking (OSOCTET *pDestBuf, size_t toReadBytes) |
| | Read data from the stream.
|
| virtual int | reset () |
| | 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) |
| | Skips over and discards the specified amount of data octets from this input stream.
|
Detailed Description
The base class for input streams.
Definition at line 37 of file rtxCppInputStream.h.
Constructor & Destructor Documentation
| OSInputStream::OSInputStream |
( |
|
) |
|
|
|
|
The default constructor.
It initializes a buffered stream. A buffered stream maintains data in memory before reading or writing to the device. This generally provides better performance than an unbuffered stream.
- Exceptions:
-
|
| virtual OSInputStream::~OSInputStream |
( |
|
) |
[virtual] |
|
|
|
Virtual destructor.
Closes the stream if it was opened. |
Member Function Documentation
| virtual int OSInputStream::close |
( |
|
) |
[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, rtxStreamBufClose
Implements OSInputStreamIF. |
| virtual size_t OSInputStream::currentPos |
( |
|
) |
[virtual] |
|
|
|
This method returns the current position in the stream (in octets).
- Returns:
- The number of octets already read from the stream.
Implements OSInputStreamIF. |
| virtual int OSInputStream::flush |
( |
|
) |
[virtual] |
|
|
|
Flushes the buffered data to the stream.
- Returns:
- Completion status of operation:
- 0 = success,
- negative return value is error.
- See also:
- rtxStreamFlush, rtxStreamBufFlush
Implements OSInputStreamIF. |
| virtual OSCtxtPtr OSInputStream::getContext |
( |
|
) |
[inline, virtual] |
|
|
|
This method returns a pointer to the underlying OSContext object.
- Returns:
- A reference-counted pointer to an OSContext object. The OSContext object will not be released until all referenced-counted pointer variables go out of scope. This allows safe sharing of the context between different run-time classes.
Reimplemented from OSStream.
Definition at line 94 of file rtxCppInputStream.h.
References OSStream::getContext(). |
| virtual OSCTXT* OSInputStream::getCtxtPtr |
( |
|
) |
[inline, virtual] |
|
|
|
This method returns a pointer to the underlying OSCTXT object.
This is the structure used in calls to low-level C encode/decode functions.
- Returns:
- Pointer to a context (OSCTXT) structure.
Reimplemented from OSStream.
Definition at line 104 of file rtxCppInputStream.h.
References OSStream::getCtxtPtr(). |
| virtual char* OSInputStream::getErrorInfo |
( |
char * |
pBuf, |
|
|
size_t & |
bufSize |
|
) |
[inline, virtual] |
|
|
|
Returns error text in a memory buffer.
If buffer pointer is specified in parameters (not NULL) then error text will be copied in the passed buffer. Otherwise, this method allocates memory using the 'operator new []' function. The calling routine is responsible to free the memory by using 'operator delete []'.
- Parameters:
-
| pBuf | A pointer to a destination buffer to obtain the error text. If NULL, dynamic buffer will be allocated. |
| bufSize | A reference to buffer size. If pBuf is NULL it will receive the size of allocated dynamic buffer. |
- Returns:
- A pointer to a buffer with error text. If pBuf is not NULL, the return pointer will be equal to it. Otherwise, returns newly allocated buffer with error text. NULL, if error occured.
Reimplemented from OSStream.
Definition at line 135 of file rtxCppInputStream.h.
References OSStream::getErrorInfo(). |
| virtual char* OSInputStream::getErrorInfo |
( |
|
) |
[inline, virtual] |
|
|
|
Returns error text in a dynamic memory buffer.
Buffer will be allocated by 'operator new []'. The calling routine is responsible to free the memory by using 'operator delete []'.
- Returns:
- A pointer to a newly allocated buffer with error text.
Reimplemented from OSStream.
Definition at line 115 of file rtxCppInputStream.h.
References OSStream::getErrorInfo(). |
| virtual int OSInputStream::getStatus |
( |
|
) |
const [inline, 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 OSInputStreamIF.
Definition at line 148 of file rtxCppInputStream.h.
References OSStream::getStatus(). |
| virtual OSBOOL OSInputStream::isOpened |
( |
|
) |
[virtual] |
|
|
|
Checks, is the stream opened or not.
- Returns:
- s TRUE, if the stream is opened, FALSE otherwise.
- See also:
- rtxStreamIsOpened
Implements OSInputStreamIF. |
| virtual int OSInputStream::mark |
( |
size_t |
readAheadLimit |
) |
[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
Implements OSInputStreamIF. |
| virtual OSBOOL OSInputStream::markSupported |
( |
|
) |
[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
Implements OSInputStreamIF. |
| virtual long OSInputStream::read |
( |
OSOCTET * |
pDestBuf, |
|
|
size_t |
maxToRead |
|
) |
[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. |
- Exceptions:
-
- See also:
- rtxStreamRead
Implements OSInputStreamIF. |
| virtual long OSInputStream::readBlocking |
( |
OSOCTET * |
pDestBuf, |
|
|
size_t |
toReadBytes |
|
) |
[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. |
- Exceptions:
-
- See also:
- rtxStreamRead
Implements OSInputStreamIF. |
| virtual int OSInputStream::reset |
( |
|
) |
[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
Implements OSInputStreamIF. |
| virtual int OSInputStream::skip |
( |
size_t |
n |
) |
[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
Implements OSInputStreamIF. |
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 |