ScummVM API documentation
Sci::Resource Class Reference

#include <resource.h>

Inheritance diagram for Sci::Resource:
Sci::SciSpan< const byte > Sci::SciSpanImpl< const byte, SciSpan > Common::NamedSpanImpl< const byte, SciSpan > Common::SpanImpl< const byte, SciSpan > Common::SpanBase< const byte, SciSpan > Common::SafeBool< SciSpan< const byte > > Common::impl::no_base< SciSpan< const byte > >

Public Member Functions

 Resource (ResourceManager *resMan, ResourceId id)
 
void unalloc ()
 
ResourceType getType () const
 
uint16 getNumber () const
 
bool isLocked () const
 
void writeToStream (Common::WriteStream *stream) const
 
const Common::PathgetResourceLocation () const
 
uint32 getAudioCompressionType () const
 
uint16 getNumLockers () const
 
- Public Member Functions inherited from Sci::SciSpan< const byte >
 SciSpan (const pointer data_, const size_type size_, const Common::String &name_=Common::String(), const size_type sourceByteOffset_=0)
 
 SciSpan (const Other &other)
 
- Public Member Functions inherited from Sci::SciSpanImpl< const byte, SciSpan >
 SciSpanImpl (const pointer data_, const size_type size_, const Common::String &name_=Common::String(), const size_type sourceByteOffset_=0)
 
 SciSpanImpl (const Other &other)
 
const_iterator cbegin () const
 
const_iterator cend () const
 
const_iterator begin () const
 
iterator begin ()
 
const_iterator end () const
 
iterator end ()
 
int16 getInt16SEAt (const size_type index) const
 
uint16 getUint16SEAt (const size_type index) const
 
uint16 getUint16SE32At (const size_type index) const
 
int32 getInt32SEAt (const size_type index) const
 
uint32 getUint32SEAt (const size_type index) const
 
void setUint16SEAt (const size_type index, uint16 value)
 
void setUint32SEAt (const size_type index, uint32 value)
 
const_reference operator* () const
 
reference operator* ()
 
mutable_derived_type & operator+= (const difference_type delta)
 
mutable_derived_type & operator++ ()
 
mutable_derived_type operator++ (int)
 
mutable_derived_type operator+ (const difference_type delta) const
 
- Public Member Functions inherited from Common::NamedSpanImpl< const byte, SciSpan >
 NamedSpanImpl (const pointer data_, const size_type size_, const String &name_=String(), const size_type sourceByteOffset_=0)
 
 NamedSpanImpl (const Other &other)
 
void clear ()
 
const Stringname () const
 
Stringname ()
 
const size_type & sourceByteOffset () const
 
size_type & sourceByteOffset ()
 
const SciSpan< NewValueType > subspan (const index_type index, const size_type numEntries=kSpanMaxSize, const String &name_=String(), const size_type sourceByteOffset_=kSpanKeepOffset) const
 
SciSpan< NewValueType > subspan (const index_type index, const size_type numEntries=kSpanMaxSize, const String &name_=String(), const size_type sourceByteOffset_=kSpanKeepOffset)
 
const_derived_type subspan (const index_type index, const size_type numEntries=kSpanMaxSize, const String &name_=String(), const size_type sourceByteOffset_=kSpanKeepOffset) const
 
mutable_derived_type subspan (const index_type index, const size_type numEntries=kSpanMaxSize, const String &name_=String(), const size_type sourceByteOffset_=kSpanKeepOffset)
 
String getValidationMessage (const index_type index, const difference_type deltaInBytes, const SpanValidationMode mode) const
 
mutable_value_derived_type & allocate (const size_type numEntries, const String &name_=String())
 
mutable_value_derived_type & allocateFromSpan (const NamedSpanImpl< OtherValueType, SciSpan > &other)
 
mutable_value_derived_type & allocateFromSpan (const SpanImpl< OtherValueType, OtherDerived > &other)
 
mutable_value_derived_type & allocateFromStream (SeekableReadStream &stream, size_type numEntries=kSpanMaxSize, const String &name_=String())
 
mutable_value_derived_type & allocateFromStream (File &file, const size_type numEntries=kSpanMaxSize)
 
- Public Member Functions inherited from Common::SpanImpl< const byte, SciSpan >
 SpanImpl (const pointer data_, const size_type size_)
 
 SpanImpl (const Other &other)
 
void clear ()
 
size_type size () const
 
pointer data () const
 
const_iterator cbegin () const
 
const_iterator cend () const
 
const_iterator begin () const
 
iterator begin ()
 
const_iterator end () const
 
iterator end ()
 
const String name () const
 
String getValidationMessage (const index_type index, const difference_type deltaInBytes, const SpanValidationMode mode) const
 
const SciSpan< NewValueType > subspan (const index_type index, size_type numEntries=kSpanMaxSize) const
 
SciSpan< NewValueType > subspan (const index_type index, size_type numEntries=kSpanMaxSize)
 
const_derived_type subspan (const index_type index, const size_type numEntries=kSpanMaxSize) const
 
mutable_derived_type subspan (const index_type index, const size_type numEntries=kSpanMaxSize)
 
mutable_value_derived_type & allocate (const size_type numEntries)
 
mutable_value_derived_type & allocateFromSpan (const Other &other)
 
mutable_value_derived_type & allocateFromStream (SeekableReadStream &stream, size_type numEntries=kSpanMaxSize)
 
- Public Member Functions inherited from Common::SpanBase< const byte, SciSpan >
size_type byteSize () const
 
const_reference operator[] (const index_type index) const
 
reference operator[] (const index_type index)
 
int8 getInt8At (const index_type index) const
 
uint8 getUint8At (const index_type index) const
 
int16 getInt16BEAt (const index_type index) const
 
int16 getInt16LEAt (const index_type index) const
 
uint16 getUint16BEAt (const index_type index) const
 
uint16 getUint16LEAt (const index_type index) const
 
uint32 getUint24LEAt (const index_type index) const
 
uint32 getUint32At (const index_type index) const
 
int32 getInt32BEAt (const index_type index) const
 
int32 getInt32LEAt (const index_type index) const
 
uint32 getUint32BEAt (const index_type index) const
 
uint32 getUint32LEAt (const index_type index) const
 
String getStringAt (const index_type index, size_type numEntries=kSpanMaxSize) const
 
const_pointer getUnsafeDataAt (const index_type index, size_type numEntries=kSpanMaxSize) const
 
pointer getUnsafeDataAt (const index_type index, size_type numEntries=kSpanMaxSize)
 
MemoryReadStream toStream (const index_type index=0, size_type numEntries=kSpanMaxSize) const
 
bool operator== (const Other &other) const
 
bool operator!= (const Other &other) const
 
difference_type operator- (const Other &other) const
 
bool operator< (const Other &other) const
 
bool operator<= (const Other &other) const
 
bool operator> (const Other &other) const
 
bool operator>= (const Other &other) const
 
void unsafeCopyDataTo (void *target) const
 
void copyDataTo (Other &target) const
 
- Public Member Functions inherited from Common::SafeBool< SciSpan< const byte > >
 operator bool_type () const
 
 operator bool_type ()
 

Protected Member Functions

bool loadPatch (Common::SeekableReadStream *file)
 
bool loadFromPatchFile ()
 
bool loadFromWaveFile (Common::SeekableReadStream *file)
 
bool loadFromAudioVolumeSCI1 (Common::SeekableReadStream *file)
 
bool loadFromAudioVolumeSCI11 (Common::SeekableReadStream *file)
 
int decompress (ResVersion volVersion, Common::SeekableReadStream *file)
 
int readResourceInfo (ResVersion volVersion, Common::SeekableReadStream *file, uint32 &szPacked, ResourceCompression &compression)
 
- Protected Member Functions inherited from Common::NamedSpanImpl< const byte, SciSpan >
void populateSubspan (SciSpan< NewValueType > &span, const index_type index, size_type numEntries, const String &name_, const size_type sourceByteOffset_=kSpanKeepOffset) const
 
- Protected Member Functions inherited from Common::SpanImpl< const byte, SciSpan >
void populateSubspan (SciSpan< NewValueType > &span, const index_type index, size_type numEntries) const
 
- Protected Member Functions inherited from Common::SpanBase< const byte, SciSpan >
 SpanBase (const SpanBase &)
 
SpanBaseoperator= (const SpanBase &)
 
const_derived_type & impl () const
 
mutable_derived_type & impl ()
 
void clear ()
 
size_type size () const
 
const_iterator cbegin () const
 
const_iterator cend () const
 
const_iterator begin () const
 
iterator begin ()
 
const_iterator end () const
 
iterator end ()
 
pointer data () const
 
bool operator_bool () const
 
bool checkInvalidBounds (const index_type index, const difference_type deltaInBytes) const
 
void validate (const index_type index, const difference_type deltaInBytes, const SpanValidationMode mode=kValidateRead) const
 

Protected Attributes

byte * _header
 
uint32 _headerSize
 
ResourceId _id
 
int32 _fileOffset
 
ResourceStatus _status
 
uint16 _lockers
 
ResourceSource_source
 
ResourceManager_resMan
 

Additional Inherited Members

- Public Types inherited from Sci::SciSpanImpl< const byte, SciSpan >
typedef super_type::value_type value_type
 
typedef super_type::difference_type difference_type
 
typedef super_type::index_type index_type
 
typedef super_type::size_type size_type
 
typedef SciSpanInternal::SciSpanIterator< derived_type, true > const_iterator
 
typedef SciSpanInternal::SciSpanIterator< derived_type, false > iterator
 
typedef super_type::pointer pointer
 
typedef super_type::const_pointer const_pointer
 
typedef super_type::reference reference
 
typedef super_type::const_reference const_reference
 
- Public Types inherited from Common::NamedSpanImpl< const byte, SciSpan >
typedef super_type::value_type value_type
 
typedef super_type::difference_type difference_type
 
typedef super_type::index_type index_type
 
typedef super_type::size_type size_type
 
typedef super_type::const_iterator const_iterator
 
typedef super_type::iterator iterator
 
typedef super_type::pointer pointer
 
typedef super_type::const_pointer const_pointer
 
typedef super_type::reference reference
 
typedef super_type::const_reference const_reference
 
- Public Types inherited from Common::SpanImpl< const byte, SciSpan >
typedef super_type::value_type value_type
 
typedef super_type::difference_type difference_type
 
typedef super_type::index_type index_type
 
typedef super_type::size_type size_type
 
typedef super_type::const_iterator const_iterator
 
typedef super_type::iterator iterator
 
typedef super_type::pointer pointer
 
typedef super_type::const_pointer const_pointer
 
typedef super_type::reference reference
 
typedef super_type::const_reference const_reference
 
- Public Types inherited from Common::SpanBase< const byte, SciSpan >
typedef const byte value_type
 
typedef int32 difference_type
 
typedef uint32 index_type
 
typedef uint32 size_type
 
typedef SpanInternal::SpanIterator< derived_type, true > const_iterator
 
typedef SpanInternal::SpanIterator< derived_type, false > iterator
 
typedef value_type * pointer
 
typedef const value_type * const_pointer
 
typedef value_type & reference
 
typedef const value_type & const_reference
 
- Public Attributes inherited from Common::SpanImpl< const byte, SciSpan >
value_type * _data
 
size_type _size
 

Detailed Description

Class for storing resources in memory

Member Function Documentation

◆ writeToStream()

void Sci::Resource::writeToStream ( Common::WriteStream stream) const

Write the resource to the specified stream. This method is used only by the "dump" debugger command.

Member Data Documentation

◆ _header

byte* Sci::Resource::_header
protected

Holds the extra header data from view, pic, and palette patches so that these patches can be rewritten to disk as valid patch files by the diskdump debugger command.

◆ _fileOffset

int32 Sci::Resource::_fileOffset
protected

Offset in file

◆ _lockers

uint16 Sci::Resource::_lockers
protected

Number of places where this resource was locked


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