ScummVM
Glk::Streams Class Reference

Streams manager. More...

#include <streams.h>

Collaboration diagram for Glk::Streams:

Public Member Functions

 Streams ()
 Constructor. More...
 
 ~Streams ()
 Destructor. More...
 
FileStreamopenFileStream (frefid_t fref, uint fmode, uint rock=0, bool unicode=false)
 Open a file stream. More...
 
IOStreamopenStream (Common::SeekableReadStream *rs, uint rock=0)
 Open a ScummVM read stream. More...
 
IOStreamopenStream (Common::WriteStream *ws, uint rock=0)
 Open a ScummVM write stream. More...
 
WindowStreamopenWindowStream (Window *window)
 Open a window stream. More...
 
MemoryStreamopenMemoryStream (void *buf, size_t buflen, FileMode mode, uint rock=0, bool unicode=true)
 Open a memory stream. More...
 
void deleteStream (Stream *stream)
 Delete a stream. More...
 
StreamgetFirst (uint *rock)
 Start an Iteration through streams. More...
 
void setCurrent (Stream *stream)
 Set the current output stream. More...
 
StreamgetCurrent () const
 Gets the current output stream. More...
 
frefid_t createByPrompt (uint usage, FileMode fmode, uint rock)
 Prompt for a savegame to load or save, and populate a file reference from the result. More...
 
frefid_t createRef (int slot, const Common::String &desc, uint usage, uint rock)
 Create a new file reference. More...
 
frefid_t createRef (const Common::String &filename, uint usage, uint rock)
 Create a new file reference. More...
 
frefid_t createTemp (uint usage, uint rock)
 Create a new temporary file reference. More...
 
frefid_t createFromRef (frefid_t fref, uint usage, uint rock)
 Create a new file reference from an old one. More...
 
void deleteRef (frefid_t fref)
 Delete a file reference. More...
 
frefid_t iterate (frefid_t fref, uint *rock)
 Iterates to the next file reference following the specified one, or the first if null is passed. More...
 

Private Member Functions

void addStream (Stream *stream)
 Adds a created stream to the list. More...
 
void removeStream (Stream *stream)
 Remove a stream. More...
 

Private Attributes

Stream_streamList
 
Stream_currentStream
 
FileRefArray _fileReferences
 

Friends

class Stream
 

Detailed Description

Streams manager.

Definition at line 580 of file streams.h.

Constructor & Destructor Documentation

◆ Streams()

Glk::Streams::Streams ( )

Constructor.

Definition at line 1347 of file streams.cpp.

◆ ~Streams()

Glk::Streams::~Streams ( )

Destructor.

Definition at line 1350 of file streams.cpp.

Member Function Documentation

◆ addStream()

void Glk::Streams::addStream ( Stream stream)
private

Adds a created stream to the list.

Definition at line 1387 of file streams.cpp.

◆ createByPrompt()

frefid_t Glk::Streams::createByPrompt ( uint  usage,
FileMode  fmode,
uint  rock 
)

Prompt for a savegame to load or save, and populate a file reference from the result.

Definition at line 1419 of file streams.cpp.

◆ createFromRef()

frefid_t Glk::Streams::createFromRef ( frefid_t  fref,
uint  usage,
uint  rock 
)

Create a new file reference from an old one.

Definition at line 1482 of file streams.cpp.

◆ createRef() [1/2]

frefid_t Glk::Streams::createRef ( int  slot,
const Common::String desc,
uint  usage,
uint  rock 
)

Create a new file reference.

Definition at line 1456 of file streams.cpp.

◆ createRef() [2/2]

frefid_t Glk::Streams::createRef ( const Common::String filename,
uint  usage,
uint  rock 
)

Create a new file reference.

Definition at line 1467 of file streams.cpp.

◆ createTemp()

frefid_t Glk::Streams::createTemp ( uint  usage,
uint  rock 
)

Create a new temporary file reference.

Definition at line 1477 of file streams.cpp.

◆ deleteRef()

void Glk::Streams::deleteRef ( frefid_t  fref)

Delete a file reference.

Definition at line 1486 of file streams.cpp.

◆ deleteStream()

void Glk::Streams::deleteStream ( Stream stream)
inline

Delete a stream.

Definition at line 635 of file streams.h.

◆ getCurrent()

Stream* Glk::Streams::getCurrent ( ) const
inline

Gets the current output stream.

Definition at line 655 of file streams.h.

◆ getFirst()

Stream * Glk::Streams::getFirst ( uint rock)

Start an Iteration through streams.

Definition at line 1412 of file streams.cpp.

◆ iterate()

frefid_t Glk::Streams::iterate ( frefid_t  fref,
uint rock 
)

Iterates to the next file reference following the specified one, or the first if null is passed.

Definition at line 1495 of file streams.cpp.

◆ openFileStream()

FileStream * Glk::Streams::openFileStream ( frefid_t  fref,
uint  fmode,
uint  rock = 0,
bool  unicode = false 
)

Open a file stream.

Definition at line 1357 of file streams.cpp.

◆ openMemoryStream()

MemoryStream * Glk::Streams::openMemoryStream ( void buf,
size_t  buflen,
FileMode  mode,
uint  rock = 0,
bool  unicode = true 
)

Open a memory stream.

Definition at line 1381 of file streams.cpp.

◆ openStream() [1/2]

IOStream * Glk::Streams::openStream ( Common::SeekableReadStream rs,
uint  rock = 0 
)

Open a ScummVM read stream.

Definition at line 1363 of file streams.cpp.

◆ openStream() [2/2]

IOStream * Glk::Streams::openStream ( Common::WriteStream ws,
uint  rock = 0 
)

Open a ScummVM write stream.

Definition at line 1369 of file streams.cpp.

◆ openWindowStream()

WindowStream * Glk::Streams::openWindowStream ( Window window)

Open a window stream.

Definition at line 1375 of file streams.cpp.

◆ removeStream()

void Glk::Streams::removeStream ( Stream stream)
private

Remove a stream.

Definition at line 1394 of file streams.cpp.

◆ setCurrent()

void Glk::Streams::setCurrent ( Stream stream)
inline

Set the current output stream.

Definition at line 647 of file streams.h.

Friends And Related Function Documentation

◆ Stream

friend class Stream
friend

Definition at line 581 of file streams.h.

Member Data Documentation

◆ _currentStream

Stream* Glk::Streams::_currentStream
private

Definition at line 584 of file streams.h.

◆ _fileReferences

FileRefArray Glk::Streams::_fileReferences
private

Definition at line 585 of file streams.h.

◆ _streamList

Stream* Glk::Streams::_streamList
private

Definition at line 583 of file streams.h.


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