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

#include <elm/io/WinInStream.h>

+ Inheritance diagram for WinInStream:

Public Member Functions

 WinInStream (void *fd)
 
voidfd (void) const
 
virtual int read (void *buffer, int size)
 
virtual int read (void)
 
virtual CString lastErrorMessage (void)
 
- Public Member Functions inherited from InStream
virtual ~InStream (void)
 

Protected Attributes

void_fd
 

Additional Inherited Members

- Static Public Attributes inherited from InStream
static const int FAILED = -1
 
static const int ENDED = -2
 
static InStreamnull = _null
 

Detailed Description

Input stream implementation using the Win low-level IO system.

Constructor & Destructor Documentation

◆ WinInStream()

WinInStream ( void fd)

Build a new Win input stream with the given file descriptor.

Parameters
fdFile descriptor to use.

Member Function Documentation

◆ fd()

int fd ( void  ) const
inline

Get the file descriptor of this Win file stream.

Returns
File descriptor.

References WinInStream::_fd.

◆ lastErrorMessage()

CString lastErrorMessage ( void  )
virtual

Return a message for the last error.

Returns
Message of the last error.

Reimplemented from InStream.

References elm::win::getErrorMessage(), and String::toCString().

◆ read() [1/2]

int read ( void buffer,
int  size 
)
virtual

Read some bytes from the stream and store them in the given buffer. This method does not ever read as many bytes as available in the buffer even if the stream is not ended. Insteadn a read returning 0 bytes means the end of stream is reached.

Parameters
bufferBuffer to write bytes in.
sizeSize of the buffer.
Returns
Number of read bytes, 0 for end of stream, -1 for an error.

Implements InStream.

References WinInStream::_fd, and elm::win::setError().

◆ read() [2/2]

virtual int read ( void  )
inlinevirtual

Read one byte from the stream.

Returns
Read byte, FAILED for an error, ENDED for end of stream.

Reimplemented from InStream.

References InStream::read().

Member Data Documentation

◆ _fd

void* _fd
protected

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