2001-10-06 14:13:28 +00:00
|
|
|
#ifndef IOUTPUTSTREAM_H
|
|
|
|
#define IOUTPUTSTREAM_H
|
|
|
|
|
|
|
|
#include "IInterface.h"
|
|
|
|
#include "BasicTypes.h"
|
|
|
|
|
2002-07-28 17:25:13 +00:00
|
|
|
//! Output stream interface
|
|
|
|
/*!
|
|
|
|
Defines the interface for all output streams.
|
|
|
|
*/
|
2001-10-06 14:13:28 +00:00
|
|
|
class IOutputStream : public IInterface {
|
2002-04-29 14:40:01 +00:00
|
|
|
public:
|
2002-07-28 17:25:13 +00:00
|
|
|
//! @name manipulators
|
|
|
|
//@{
|
2001-10-06 14:13:28 +00:00
|
|
|
|
2002-07-28 17:25:13 +00:00
|
|
|
//! Close the stream
|
|
|
|
/*!
|
|
|
|
Closes the stream. Attempting to write() after close() throws
|
|
|
|
XIOClosed.
|
|
|
|
*/
|
2001-10-14 16:58:01 +00:00
|
|
|
virtual void close() = 0;
|
2001-10-06 14:13:28 +00:00
|
|
|
|
2002-07-28 17:25:13 +00:00
|
|
|
//! Write to stream
|
|
|
|
/*!
|
|
|
|
Write \c n bytes from \c buffer to the stream. If this can't
|
|
|
|
complete immeditely it will block. If cancelled, an indeterminate
|
|
|
|
amount of data may have been written.
|
2001-10-06 14:13:28 +00:00
|
|
|
|
2002-07-28 17:25:13 +00:00
|
|
|
(cancellation point)
|
|
|
|
*/
|
|
|
|
virtual UInt32 write(const void* buffer, UInt32 n) = 0;
|
|
|
|
|
|
|
|
//! Flush the stream
|
|
|
|
/*!
|
|
|
|
Waits until all buffered data has been written to the stream.
|
|
|
|
|
|
|
|
(cancellation point)
|
|
|
|
*/
|
2001-10-14 16:58:01 +00:00
|
|
|
virtual void flush() = 0;
|
2001-10-06 14:13:28 +00:00
|
|
|
|
2002-07-28 17:25:13 +00:00
|
|
|
//@}
|
2001-10-06 14:13:28 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|