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

MacBinary is an alternative format to AppleSingle for representing a Macintosh file on a non-Macintosh filesystem. More...

#include <apple.h>

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

Public Types

enum  version_t { MACBIN1 , MACBIN1_GETINFO , MACBIN2 = 129 , MACBIN3 = 130 }
 

Public Member Functions

 MacBinary (version_t version=MACBIN3)
 
 MacBinary (version_t version, version_t minimum_version)
 
 MacBinary (std::shared_ptr< AppleSingleDouble > apple, version_t version, version_t minimum_version)
 
void CRC_Initialize () const
 
void CRC_Step (uint8_t byte=0) const
 
void Skip (const std::shared_ptr< Linker::Writer > &wr, size_t count) const
 
void WriteData (const std::shared_ptr< Linker::Writer > &wr, size_t count, const void *data) const
 
void WriteData (const std::shared_ptr< Linker::Writer > &wr, size_t count, std::string text) const
 
void WriteWord (const std::shared_ptr< Linker::Writer > &wr, size_t bytes, uint64_t value) const
 
template<typename Clock >
void WriteTimestamp (const std::shared_ptr< Linker::Writer > &wr, Timestamp< Clock > timestamp) const
 
void ReadHeader (const std::shared_ptr< Linker::Reader > &rd)
 
void WriteHeader (const std::shared_ptr< Linker::Writer > &wr) const
 
void CalculateOffsets ()
 
void ReadFile (const std::shared_ptr< Linker::Reader > &rd) override
 Loads file into memory.
 
offset_t WriteFile (const std::shared_ptr< 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.
 
- 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 SetFileOffset (offset_t new_offset)
 Attempts to alter the offset to the first byte of the format from the beginning of the file.
 
offset_t ImageSize () const override
 Retrieves the offset of the byte after the last one belonging to this format from the first one.
 
- 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

std::shared_ptr< AppleSingleDouble > apple_single
 
version_t version
 
version_t minimum_version
 
uint16_t secondary_header_size = 0
 
uint16_t crc = 0
 
uint8_t attributes = 0
 
::Timestamp< Macintosh_clock > creation = { }
 
::Timestamp< Macintosh_clock > modification = { }
 
uint32_t data_fork_length = 0
 
uint32_t resource_fork_length = 0
 
uint16_t comment_length = 0
 
std::string generated_file_name
 
- 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.
 

Static Public Attributes

static uint16_t crc_step [256]
 

Detailed Description

MacBinary is an alternative format to AppleSingle for representing a Macintosh file on a non-Macintosh filesystem.

Member Function Documentation

◆ Dump()

void MacBinary::Dump ( Dumper::Dumper &  dump) const
overridevirtual

Display file contents in a nice manner.

Reimplemented from Linker::Format.

◆ ReadFile()

void MacBinary::ReadFile ( const std::shared_ptr< Linker::Reader > &  rd)
overridevirtual

Loads file into memory.

Implements Linker::Format.

◆ WriteFile()

offset_t MacBinary::WriteFile ( const std::shared_ptr< 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: