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

AppleSingle & AppleDouble. More...

#include <apple.h>

Inheritance diagram for Apple::AppleSingleDouble:
Linker::Format Linker::Contents

Classes

class  Entry
 
class  UnknownEntry
 

Public Types

enum  format_type { SINGLE = 0x00051600 , DOUBLE = 0x00051607 }
 
enum  hfs_type {
  HFS_UNDEFINED , HFS_Macintosh , HFS_ProDOS , HFS_MSDOS ,
  HFS_UNIX , HFS_VAX_VMS
}
 
enum  {
  ID_DataFork = 1 , ID_ResourceFork , ID_RealName , ID_Comment ,
  ID_IconBW , ID_IconColor , ID_FileInfo , ID_FileDatesInfo ,
  ID_FinderInfo , ID_MacintoshFileInfo , ID_ProDOSFileInfo , ID_MSDOSFileInfo ,
  ID_AFPShortName , ID_AFPFileInfo , ID_AFPDirectoryID
}
 

Public Member Functions

offset_t ImageSize () const override
 Retrieves size of stored data.
 
void ReadFile (Linker::Reader &rd) override
 Loads file into memory.
 
hfs_type GetHomeFileSystem () const
 
void SetHomeFileSystem (hfs_type type)
 
 AppleSingleDouble (format_type type, unsigned version, hfs_type home_file_system)
 
 AppleSingleDouble (format_type type, hfs_type home_file_system)
 
 AppleSingleDouble (format_type type, unsigned version=2)
 
 AppleSingleDouble (AppleSingleDouble &other, format_type type)
 
 AppleSingleDouble (AppleSingleDouble &other)
 
std::shared_ptr< const EntryFindEntry (uint32_t id) const
 
std::shared_ptr< EntryFindEntry (uint32_t id)
 
void AppendEntry (std::shared_ptr< Entry > entry)
 
std::shared_ptr< EntryGetFileDatesInfo ()
 
std::shared_ptr< EntryGetMacintoshFileInfo ()
 
std::shared_ptr< EntryGetAUXFileInfo ()
 
std::shared_ptr< EntryGetProDOSFileInfo ()
 
std::shared_ptr< EntryGetMSDOSFileInfo ()
 
std::shared_ptr< EntryGetDataFork ()
 
std::shared_ptr< EntryGetResourceFork ()
 
std::shared_ptr< EntryGetFinderInfo ()
 
std::shared_ptr< EntryGetRealName ()
 
void SetCreationDate (uint32_t CreationDate)
 
void SetModificationDate (uint32_t ModificationDate)
 
void SetBackupDate (uint32_t BackupDate)
 
void SetAccessDate (uint32_t AccessDate)
 
void SetMacintoshAttributes (uint32_t Attributes)
 
void SetProDOSAccess (uint16_t Access)
 
void SetProDOSFileType (uint16_t FileType)
 
void SetProDOSAUXType (uint32_t AUXType)
 
void SetMSDOSAttributes (uint16_t Attributes)
 
uint32_t GetCreationDate ()
 Retrieves creation date field and creates it if it does not exist.
 
uint32_t GetModificationDate ()
 Retrieves modification date field and creates it if it does not exist.
 
uint32_t GetMacintoshAttributes ()
 Retrieves Macintosh attributes field and creates it if it does not exist.
 
uint32_t ReadCreationDate ()
 Retrieves creation date field if it exists.
 
uint32_t ReadModificationDate ()
 Retrieves modification date field if it exists.
 
uint32_t ReadMacintoshAttributes ()
 Retrieves Macintosh attributes field if it exists.
 
void CalculateValues ()
 
offset_t WriteFile (Linker::Writer &wr) const override
 Stores data in memory to file.
 
void Dump (Dumper::Dumper &dump) const override
 Display file contents in a nice manner.
 
std::string PrefixFilename (std::string prefix, std::string filename)
 
std::string PrefixFilename (std::string prefix, std::string filename, size_t limit)
 
std::string ReplaceExtension (std::string filename, std::string extension, size_t limit)
 
std::string GetUNIXDoubleFilename (std::string filename)
 
std::string GetMacOSXDoubleFilename (std::string filename)
 
std::string GetProDOSDoubleFilename (std::string filename)
 
std::string GetMSDOSDoubleFilename (std::string filename)
 
- 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.
 
offset_t ImageSize () const override
 Retrieves size of stored data.
 
offset_t WriteFile (Writer &wr, offset_t count, offset_t offset=0) const override
 Writes data of non-zero filled sections.
 
- Public Member Functions inherited from Linker::Contents
virtual std::shared_ptr< const ImageAsImage () const
 Retrieves a randomly accessible image.
 
std::shared_ptr< ImageAsImage ()
 Retrieves a randomly accessible image.
 

Public Attributes

format_type type = DOUBLE
 
unsigned version = 2
 
char home_file_system_string [16] = ""
 
std::vector< std::shared_ptr< Entry > > entries
 
offset_t image_size = offset_t(-1)
 
- Public Attributes inherited from Linker::Format
offset_t file_offset
 

Protected Attributes

hfs_type home_file_system
 

Detailed Description

AppleSingle & AppleDouble.

Permits storing certain metadata alongside the byte stream of a file, used for several Apple products

On classic Macintosh systems, each file has two associated parts called forks: the data fork and the resource fork. Classic 68000 applications store all the executable data in the resource fork, which is usually not transferred to non-Macintosh platforms. The AppleSingle and AppleDouble formats provide a way to store both the data and resource fork, or the resource fork, as a separate file, alongside other metadata, which is essential when storing it on a non-Macintosh system.

This container format was first invented for the A/UX Apple UNIX system. It has two versions, and version 2 is used most commonly. See also Apple::MacintoshResourceFileFormat.

Member Function Documentation

◆ Dump()

void AppleSingleDouble::Dump ( Dumper::Dumper dump) const
overridevirtual

Display file contents in a nice manner.

Reimplemented from Linker::Format.

◆ ImageSize()

offset_t AppleSingleDouble::ImageSize ( ) const
overridevirtual

Retrieves size of stored data.

Implements Linker::Contents.

◆ ReadFile()

void AppleSingleDouble::ReadFile ( Linker::Reader rd)
overridevirtual

Loads file into memory.

Implements Linker::Format.

◆ WriteFile()

offset_t AppleSingleDouble::WriteFile ( Linker::Writer wr) const
overridevirtual

Stores data in memory to file.

Implements Linker::Format.


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