Elm  2
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
UnixOutStream Class Reference

#include <>>

+ Inheritance diagram for UnixOutStream:

Public Member Functions

 UnixOutStream (int fd)
 
 ~UnixOutStream ()
 
int fd (void) const
 
int write (const char *buffer, int size) override
 
int flush () override
 
CString lastErrorMessage () override
 
bool supportsANSI () const override
 
- Public Member Functions inherited from OutStream
virtual ~OutStream (void)
 
virtual int write (char byte)
 

Protected Attributes

int _fd
 

Additional Inherited Members

- Static Public Attributes inherited from OutStream
static OutStreamnull = _null
 

Detailed Description

Output stream implementation using the Unix low-level IO system (only on OSes supporting POSIX).

Constructor & Destructor Documentation

◆ UnixOutStream()

UnixOutStream ( int  _fd)

Build an Unix output stream.

Parameters
fdFile descriptor.

Build a Unix output stream using a file descriptor identifier.

Parameters
_fdFile descriptor identifier.

References UnixOutStream::fd().

◆ ~UnixOutStream()

Close an Unix output stream.

References UnixOutStream::_fd.

Member Function Documentation

◆ fd()

int fd ( void  ) const
inline

◆ flush()

int flush ( )
overridevirtual

Cause the current stream to dump its buffer to the medium.

Returns
0 for success, less than 0 for error.

Implements OutStream.

◆ lastErrorMessage()

CString lastErrorMessage ( )
overridevirtual

Return the last occurred error message.

Returns
Last error message.

Reimplemented from OutStream.

◆ supportsANSI()

bool supportsANSI ( ) const
overridevirtual

Test if the current stream knows how to decode ANSI special codes. The default implementation returns false.

Returns
True if ANSI code are supported, false else.

Reimplemented from OutStream.

References UnixOutStream::_fd.

◆ write()

int write ( const char *  buffer,
int  size 
)
overridevirtual

This is the main method of an output stream: the given buffer is put on the stream.

Parameters
bufferByte buffer to write.
sizeSize of the byte buffer.
Returns
Number of transferred bytes or less than 0 for an error.

Implements OutStream.

References UnixOutStream::_fd, and elm::io::write().

Member Data Documentation

◆ _fd


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