RetroLinker
Linker for several 8-bit, 16-bit and 32-bit formats
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Protected Member Functions | List of all members
Apple::MacintoshResourceFileFormat::Resource Class Referenceabstract

A single resource in the resource file. More...

#include <macos.h>

Inheritance diagram for Apple::MacintoshResourceFileFormat::Resource:
Linker::Format Linker::Contents Apple::MacintoshResourceFileFormat::CodeFragmentResource Apple::MacintoshResourceFileFormat::CodeResource Apple::MacintoshResourceFileFormat::GenericResource Apple::MacintoshResourceFileFormat::JumpTableCodeResource Apple::MacintoshResourceFileFormat::SizeResource Apple::RSegResource

Public Member Functions

virtual void ReadFile (const std::shared_ptr< Linker::Reader > &rd, offset_t length)=0
 
void Dump (Dumper::Dumper &dump) const override
 Display file contents in a nice manner.
 
virtual int GetDisplayOptions () const
 
virtual void Dump (Dumper::Dumper &dump, offset_t file_offset) const
 
virtual void AddFields (Dumper::Dumper &dump, Dumper::Region &region, offset_t file_offset) const
 
virtual std::unique_ptr< Dumper::Region > CreateRegion (std::string name, offset_t offset, offset_t length, unsigned display_width) const
 
virtual void EffectFormat (MacintoshResourceFileFormat &format, const std::shared_ptr< Linker::Reader > &rd)
 Apply some changes to the format after parsing.
 
offset_t ImageSize () const override=0
 Retrieves the offset of the byte after the last one belonging to this format from the first one.
 
virtual void CalculateValues ()=0
 
- Public Member Functions inherited from Linker::Format
 Format (offset_t file_offset=0)
 
virtual void Clear ()
 Resets all fields to their default values, deallocate memory.
 
virtual void ReadFile (const std::shared_ptr< Reader > &rd)=0
 Loads file into memory.
 
offset_t WriteFile (const std::shared_ptr< Writer > &wr) const override=0
 Stores data in memory to file.
 
virtual void SetFileOffset (offset_t new_offset)
 Attempts to alter the offset to the first byte of the format from the beginning of the file.
 
- Public Member Functions inherited from Linker::Contents
virtual std::shared_ptr< const Image > AsImage () const
 Retrieves a randomly accessible image.
 
std::shared_ptr< Image > AsImage ()
 Retrieves a randomly accessible image.
 

Public Attributes

char type [4]
 
uint16_t id
 
std::optional< std::string > name
 
uint8_t attributes
 
- Public Attributes inherited from Linker::Format
offset_t file_offset
 The offset of the first byte used by this format in the file it is stored in.
 

Protected Member Functions

 Resource (const char type[4], uint16_t id, uint8_t attributes=0)
 
 Resource (const char type[4], uint16_t id, std::optional< std::string > name, uint8_t attributes=0)
 

Detailed Description

A single resource in the resource file.

Member Function Documentation

◆ Dump()

void MacintoshResourceFileFormat::Resource::Dump ( Dumper::Dumper &  dump) const
overridevirtual

Display file contents in a nice manner.

Reimplemented from Linker::Format.

◆ EffectFormat()

void MacintoshResourceFileFormat::Resource::EffectFormat ( MacintoshResourceFileFormat &  format,
const std::shared_ptr< Linker::Reader > &  rd 
)
virtual

Apply some changes to the format after parsing.

Reimplemented in Apple::MacintoshResourceFileFormat::CodeFragmentResource, and Apple::RSegResource.

◆ ImageSize()

offset_t Apple::MacintoshResourceFileFormat::Resource::ImageSize ( ) const
overridepure virtual

Retrieves the offset of the byte after the last one belonging to this format from the first one.

Returns
The size of the image, or offset_t(-1) if it cannot be determined before writing to the file

Reimplemented from Linker::Format.

Implemented in Apple::MacintoshResourceFileFormat::GenericResource, Apple::MacintoshResourceFileFormat::JumpTableCodeResource, Apple::MacintoshResourceFileFormat::CodeResource, Apple::MacintoshResourceFileFormat::SizeResource, Apple::MacintoshResourceFileFormat::CodeFragmentResource, and Apple::RSegResource.


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