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

Google


Objective Systems, Inc.

OSOutputStream Class Reference

The base class for output streams. More...

#include <rtxCppOutputStream.h>

Inheritance diagram for OSOutputStream:

OSStream OSOutputStreamIF OSStreamIF OSStreamIF OSFileOutputStream OSMemoryOutputStream OSSocketOutputStream List of all members.

Public Member Functions

 OSOutputStream ()
 The default constructor.
virtual ~OSOutputStream ()
 Virtual destructor.
virtual int close ()
 Closes the output or output stream and releases any system resources associated with the stream.
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.
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 write (const OSOCTET *pdata, size_t size)
 Write data to the stream.

Detailed Description

The base class for output streams.

Definition at line 37 of file rtxCppOutputStream.h.


Constructor & Destructor Documentation

OSOutputStream::OSOutputStream  ) 
 

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:
OSStreamException Stream create or initialize failed.

virtual OSOutputStream::~OSOutputStream  )  [virtual]
 

Virtual destructor.

Closes the stream if it was opened.


Member Function Documentation

virtual int OSOutputStream::close  )  [virtual]
 

Closes the output 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 OSOutputStreamIF.

virtual int OSOutputStream::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 OSOutputStreamIF.

virtual OSCtxtPtr OSOutputStream::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 87 of file rtxCppOutputStream.h.

References OSStream::getContext().

virtual OSCTXT* OSOutputStream::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 97 of file rtxCppOutputStream.h.

References OSStream::getCtxtPtr().

virtual char* OSOutputStream::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 128 of file rtxCppOutputStream.h.

References OSStream::getErrorInfo().

virtual char* OSOutputStream::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 108 of file rtxCppOutputStream.h.

References OSStream::getErrorInfo().

virtual int OSOutputStream::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 OSOutputStreamIF.

Definition at line 141 of file rtxCppOutputStream.h.

References OSStream::getStatus().

virtual OSBOOL OSOutputStream::isOpened  )  [virtual]
 

Checks, is the stream opened or not.

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

Implements OSOutputStreamIF.

virtual long OSOutputStream::write const OSOCTET *  pdata,
size_t  size
[virtual]
 

Write data to the stream.

This method writes the given number of octets from the given array to the output stream.

Parameters:
pdata The pointer to the data to be written.
size The number of octets to write.
Returns:
The total number of octets written into the stream, or negative value with error code if any error is occurred.
See also:
rtxStreamWrite

Implements OSOutputStreamIF.


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