aboutsummaryrefslogtreecommitdiff
path: root/hotline/flattened_file_object.go
diff options
context:
space:
mode:
authorJeff Halter <868228+jhalter@users.noreply.github.com>2025-11-18 20:56:12 -0800
committerJeff Halter <868228+jhalter@users.noreply.github.com>2025-11-18 20:56:12 -0800
commit489e26d1b3c224beffba2649406efd83580989fe (patch)
treeecb447b869c9af1df15ce8d88d7a5d013133ae1d /hotline/flattened_file_object.go
parentecae9f7cbc7a462aefdb167fa6a8b2ae83009540 (diff)
Replace hardcoded magic values with named constants and improve type safety
Adds new constants for file format identifiers (FormatFILP), fork types (ForkTypeINFO), and platform identifiers (PlatformAMAC, PlatformMWIN) to improve code maintainability and readability. Changes FlatFileForkHeader.ForkType field from [4]byte to ForkType type alias for better compile-time type checking, matching the pattern used in ForkInfoList.Fork.
Diffstat (limited to 'hotline/flattened_file_object.go')
-rw-r--r--hotline/flattened_file_object.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/hotline/flattened_file_object.go b/hotline/flattened_file_object.go
index 99ce204..7c0cd7d 100644
--- a/hotline/flattened_file_object.go
+++ b/hotline/flattened_file_object.go
@@ -45,7 +45,7 @@ type FlatFileInformationFork struct {
func NewFlatFileInformationFork(fileName string, modifyTime [8]byte, typeSignature string, creatorSignature string) FlatFileInformationFork {
return FlatFileInformationFork{
- Platform: [4]byte{0x41, 0x4D, 0x41, 0x43}, // "AMAC" TODO: Remove hardcode to support "AWIN" Platform (maybe?)
+ Platform: PlatformAMAC, // TODO: Remove hardcode to support "MWIN" Platform (maybe?)
TypeSignature: [4]byte([]byte(typeSignature)), // TODO: Don't infer types from filename
CreatorSignature: [4]byte([]byte(creatorSignature)), // TODO: Don't infer types from filename
PlatformFlags: [4]byte{0, 0, 1, 0}, // TODO: What is this?
@@ -128,7 +128,7 @@ func (ffif *FlatFileInformationFork) ReadNameSize() []byte {
}
type FlatFileForkHeader struct {
- ForkType [4]byte // Either INFO, DATA or MACR
+ ForkType ForkType // Either INFO, DATA or MACR
CompressionType [4]byte
RSVD [4]byte
DataSize [4]byte