hfs_catalog.hpp

1. Overview

The hfs_catalog.hpp file decodes catalog records, names, hierarchy and file metadata from HFS+ volumes.

This is an interface and data-contract file. It declares the public and internal types used by this subsystem, allowing implementation files and callers to share a stable compile-time contract.

Its paired source or interface file is hfs_catalog.cpp.

Primary responsibilities:

  • Parse catalog keys and records
  • Reconstruct parent-child relationships
  • Extract file and folder metadata
  • Support recovery path reconstruction

2. File Identity and Scope

  • Source path: src/hfs_catalog.hpp
  • Language: C++
  • File role: interface and data-contract file
  • Physical lines: 197
  • Non-empty lines: 173
  • SHA-256: b8e251e83c504c88d5b60561bca6ccc91723c39bd340a983a7859302023c9a75

Declared namespaces:

  • hfs

3. Dependencies

3.1 Project Headers

  • hfs_format.hpp
  • hfs_btree.hpp

3.2 Standard and External Headers

  • cstdint
  • string
  • vector

These dependencies define the file’s compile-time integration with the recovery engine, GTK interface, on-disk format decoders, operating-system services, or C++ standard library.


4. Declared Types

  • struct BSDInfo.
  • struct FinderInfo16.
  • struct CatalogFolder.
  • struct CatalogFile.
  • struct ChildEntry.

5. Constants and Configuration Values

  • constexpr uint32_t kSymLinkFileType=0x736C6E6B
  • constexpr uint32_t kSymLinkCreator=0x72686170
  • constexpr uint32_t kHardLinkFileType=0x686C6E6B
  • constexpr uint32_t kHFSPlusCreator=0x6866732B
  • constexpr uint16_t kHFSFileLockedBit=0x0001
  • constexpr uint16_t kHFSThreadExistsBit=0x0002
  • constexpr uint16_t kHFSHasAttributesBit=0x0004
  • constexpr uint16_t kHFSHasSecurityBit=0x0008
  • constexpr uint16_t kHFSHasFolderCountBit=0x0010
  • constexpr uint16_t kHFSHasLinkChainBit=0x0020
  • constexpr uint16_t kHFSHasChildLinkBit=0x0040
  • constexpr uint16_t kHFSHasDateAddedBit=0x0080
  • constexpr uint8_t UF_COMPRESSED=0x20
  • constexpr int kHFSPrivateDataNameLength=21

5.1 Operational Strings, Paths, Formats, or Commands

The following code literals are operationally relevant and may identify filesystem paths, helper commands, formats, signatures, or subsystem labels:

  • HFS Plus Volume Format
  • hfs_format.hpp
  • hfs_btree.hpp