class EE::System::IOStream

Overview

An abstraction for custom input/output stream files. More…

#include <iostream.hpp>

class IOStream {
public:
    // construction

    virtual ~IOStream();

    // methods

    virtual ios_size read(char* data, ios_size size) = 0;
    virtual ios_size write(const char* data, ios_size size) = 0;
    virtual ios_size seek(ios_size position) = 0;
    virtual ios_size tell() = 0;
    virtual ios_size getSize() = 0;
    virtual bool isOpen() = 0;
};

Detailed Documentation

An abstraction for custom input/output stream files.

Methods

virtual ios_size read(char* data, ios_size size) = 0

Read data from the stream.

Parameters:

data

Buffer where to copy the read data

size

Desired number of bytes to read

Returns:

The number of bytes actually read

virtual ios_size write(const char* data, ios_size size) = 0

Write data to the virtual file.

Parameters:

data

Data to write in the file

size

Size of the data that needs to be writed

virtual ios_size seek(ios_size position) = 0

Change the current reading position.

Parameters:

position

The position to seek to, from the beginning

Returns:

The position actually sought to.

virtual ios_size tell() = 0

Get the current reading position in the stream.

Returns:

The current position, or -1 on error.

virtual ios_size getSize() = 0

Return the size of the stream.

Returns:

The total number of bytes available in the stream

virtual bool isOpen() = 0

Returns:

If the virtual stream file is open