MPSolve 3.2.1
Loading...
Searching...
No Matches
mps::MemoryFileStream Class Reference

The MemoryFileStream class provides an implementation of the abstract class AbstractInputStream that will stream the data contained in the area stored in memory. More...

#include <memory-file-stream.h>

Inheritance diagram for mps::MemoryFileStream:
mps::AbstractInputStream

Public Member Functions

 MemoryFileStream (const char *source)
 Allocate a new MemoryFileStream that wil provide that data stored by the given pointer. More...
 
size_t readline (char **buffer, size_t *length)
 Implementation of the readline() method of the AbstractInputStream parent. More...
 
bool eof ()
 Implementation of the eof() method of AbstractInputStream. More...
 
int getchar ()
 Obtain a single character. More...
 
virtual size_t readline (char **buffer, size_t *length)=0
 Return a new line of the stream or NULL if we are at the end. More...
 
virtual bool eof ()=0
 Check if we are at the end of the stream. More...
 
virtual int getchar ()=0
 Obtain a single character. More...
 

Detailed Description

The MemoryFileStream class provides an implementation of the abstract class AbstractInputStream that will stream the data contained in the area stored in memory.

Constructor & Destructor Documentation

◆ MemoryFileStream()

MemoryFileStream::MemoryFileStream ( const char *  source)

Allocate a new MemoryFileStream that wil provide that data stored by the given pointer.

Parameters
sourceA pointer to the data that should be provided by this instance.

Member Function Documentation

◆ eof()

bool MemoryFileStream::eof ( )
virtual

Implementation of the eof() method of AbstractInputStream.

Returns
true if the source stream has reached the end.

Implements mps::AbstractInputStream.

◆ getchar()

int MemoryFileStream::getchar ( )
virtual

Obtain a single character.

Returns
A new character read from the stream.

Implements mps::AbstractInputStream.

◆ readline()

size_t MemoryFileStream::readline ( char **  buffer,
size_t *  length 
)
virtual

Implementation of the readline() method of the AbstractInputStream parent.

Parameters
bufferA pointer to the buffer where the line will be stored.
lengthA pointer where the length of the allocated buffer at the end will be saved.
Returns
The number of characters that have been stored in buffer.

Implements mps::AbstractInputStream.


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