ScummVM
Glk::Blorb Class Reference

Blorb file manager. More...

#include <blorb.h>

Inheritance diagram for Glk::Blorb:
Collaboration diagram for Glk::Blorb:

Public Member Functions

 Blorb (const Common::String &filename, InterpreterType interpType)
 Constructor. More...
 
 Blorb (const Common::FSNode &fileNode, InterpreterType interpType)
 Constructor. More...
 
virtual bool hasFile (const Common::String &name) const override
 Check if a member with the given name is present in the Archive. More...
 
virtual int listMembers (Common::ArchiveMemberList &list) const override
 Add all members of the Archive to list. More...
 
virtual const Common::ArchiveMemberPtr getMember (const Common::String &name) const override
 Returns a ArchiveMember representation of the given file. More...
 
virtual Common::SeekableReadStreamcreateReadStreamForMember (const Common::String &name) const override
 Create a stream bound to a member with the specified name in the archive. More...
 
- Public Member Functions inherited from Common::Archive
virtual ~Archive ()
 
virtual int listMatchingMembers (ArchiveMemberList &list, const String &pattern) const
 Add all members of the Archive matching the specified pattern to list. More...
 

Static Public Member Functions

static bool readRIdx (Common::SeekableReadStream &stream, Common::Array< ChunkEntry > &chunks)
 Read the RIdx section from the stream. More...
 
static bool isBlorb (Common::SeekableReadStream &stream, uint32 type=0)
 Returns true if a given file is a Blorb file. More...
 
static bool isBlorb (const Common::String &filename, uint32 type=0)
 Returns true if a given filename specifies a Blorb file. More...
 
static bool hasBlorbExt (const Common::String &filename)
 Returns true if a given filename has a Blorb file extension. More...
 
static void getBlorbFilenames (const Common::String &srcFilename, Common::StringArray &filenames, InterpreterType interpType, const Common::String &gameId)
 Return a list of possible filenames for blorb files. More...
 

Private Member Functions

Common::ErrorCode load ()
 Parses the Blorb file index to load in a list of the chunks. More...
 

Static Private Member Functions

static void getInfocomBlorbFilenames (Common::StringArray &filenames, const Common::String &gameId)
 Add possible Blorb filenames for Infocom games. More...
 

Private Attributes

Common::String _filename
 
Common::FSNode _fileNode
 
InterpreterType _interpType
 
Common::Array< ChunkEntry_chunks
 list of chunk descriptors More...
 

Detailed Description

Blorb file manager.

Definition at line 83 of file blorb.h.

Constructor & Destructor Documentation

◆ Blorb() [1/2]

Glk::Blorb::Blorb ( const Common::String filename,
InterpreterType  interpType 
)

Constructor.

Definition at line 30 of file blorb.cpp.

◆ Blorb() [2/2]

Glk::Blorb::Blorb ( const Common::FSNode fileNode,
InterpreterType  interpType 
)

Constructor.

Definition at line 36 of file blorb.cpp.

Member Function Documentation

◆ createReadStreamForMember()

Common::SeekableReadStream * Glk::Blorb::createReadStreamForMember ( const Common::String name) const
overridevirtual

Create a stream bound to a member with the specified name in the archive.

If no member with this name exists, 0 is returned.

Returns
the newly created input stream

Implements Common::Archive.

Definition at line 66 of file blorb.cpp.

◆ getBlorbFilenames()

void Glk::Blorb::getBlorbFilenames ( const Common::String srcFilename,
Common::StringArray filenames,
InterpreterType  interpType,
const Common::String gameId 
)
static

Return a list of possible filenames for blorb files.

Definition at line 266 of file blorb.cpp.

◆ getInfocomBlorbFilenames()

void Glk::Blorb::getInfocomBlorbFilenames ( Common::StringArray filenames,
const Common::String gameId 
)
staticprivate

Add possible Blorb filenames for Infocom games.

Definition at line 298 of file blorb.cpp.

◆ getMember()

const Common::ArchiveMemberPtr Glk::Blorb::getMember ( const Common::String name) const
overridevirtual

Returns a ArchiveMember representation of the given file.

Implements Common::Archive.

Definition at line 59 of file blorb.cpp.

◆ hasBlorbExt()

bool Glk::Blorb::hasBlorbExt ( const Common::String filename)
static

Returns true if a given filename has a Blorb file extension.

Definition at line 260 of file blorb.cpp.

◆ hasFile()

bool Glk::Blorb::hasFile ( const Common::String name) const
overridevirtual

Check if a member with the given name is present in the Archive.

Patterns are not allowed, as this is meant to be a quick File::exists() replacement.

Implements Common::Archive.

Definition at line 42 of file blorb.cpp.

◆ isBlorb() [1/2]

bool Glk::Blorb::isBlorb ( Common::SeekableReadStream stream,
uint32  type = 0 
)
static

Returns true if a given file is a Blorb file.

Definition at line 226 of file blorb.cpp.

◆ isBlorb() [2/2]

bool Glk::Blorb::isBlorb ( const Common::String filename,
uint32  type = 0 
)
static

Returns true if a given filename specifies a Blorb file.

Definition at line 252 of file blorb.cpp.

◆ listMembers()

int Glk::Blorb::listMembers ( Common::ArchiveMemberList list) const
overridevirtual

Add all members of the Archive to list.

Must only append to list, and not remove elements from it.

Returns
the number of names added to list

Implements Common::Archive.

Definition at line 51 of file blorb.cpp.

◆ load()

Common::ErrorCode Glk::Blorb::load ( )
private

Parses the Blorb file index to load in a list of the chunks.

Definition at line 100 of file blorb.cpp.

◆ readRIdx()

bool Glk::Blorb::readRIdx ( Common::SeekableReadStream stream,
Common::Array< ChunkEntry > &  chunks 
)
static

Read the RIdx section from the stream.

Definition at line 190 of file blorb.cpp.

Member Data Documentation

◆ _chunks

Common::Array<ChunkEntry> Glk::Blorb::_chunks
private

list of chunk descriptors

Definition at line 88 of file blorb.h.

◆ _filename

Common::String Glk::Blorb::_filename
private

Definition at line 85 of file blorb.h.

◆ _fileNode

Common::FSNode Glk::Blorb::_fileNode
private

Definition at line 86 of file blorb.h.

◆ _interpType

InterpreterType Glk::Blorb::_interpType
private

Definition at line 87 of file blorb.h.


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