#[non_exhaustive]pub enum Platform {
Win32,
Ps3,
Ps4,
Unknown(u16),
}Expand description
Target platform for SqPack file path resolution.
FFXIV’s SqPack archive files live in platform-specific subdirectories
under the game install root. For example, a data file for the Windows
client lives at sqpack/ffxiv/000000.win32.dat0, while the PS4 equivalent
is sqpack/ffxiv/000000.ps4.dat0. The Platform value stored in an
ApplyContext selects which suffix is used when resolving chunk targets
to filesystem paths.
§Default
An ApplyContext defaults to Platform::Win32. Override this at
construction time with ApplyContext::with_platform.
§Runtime override via SqpkTargetInfo
In practice, real FFXIV patch files begin with an SQPK T chunk
(chunk::SqpkTargetInfo) that declares the target platform. When
Apply::apply is called on that chunk (see src/apply/sqpk.rs,
apply_target_info), it overwrites ApplyContext::platform with the
decoded Platform value. This means the default is only relevant for
synthetic patches or when you know the target in advance and want to assert
it before the stream starts.
§Forward compatibility
The enum is #[non_exhaustive]. The Platform::Unknown variant
preserves unrecognised platform IDs so that newer patch files do not fail
parsing when a new platform is introduced. Path resolution falls back to
the win32 layout for unknown variants.
§Display
Implements std::fmt::Display: "Win32", "PS3", "PS4", or
"Unknown(N)" where N is the raw platform ID.
§Example
use zipatch_rs::{ApplyContext, Platform};
let ctx = ApplyContext::new("/opt/ffxiv/game")
.with_platform(Platform::Win32);
assert_eq!(ctx.platform(), Platform::Win32);
assert_eq!(format!("{}", Platform::Unknown(99)), "Unknown(99)");Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Win32
Windows / PC client (win32 path suffix).
This is the platform used by all current PC releases of FFXIV and is
the default for ApplyContext.
Ps3
PlayStation 3 client (ps3 path suffix).
PS3 support was discontinued after FFXIV: A Realm Reborn. Patches targeting this platform are no longer issued by Square Enix, but the variant is retained for completeness.
Ps4
PlayStation 4 client (ps4 path suffix).
Active platform alongside Windows. PS4 patches share the same chunk structure as Windows patches but target different file paths.
Unknown(u16)
Unrecognised platform ID preserved from a SqpkTargetInfo chunk.
When apply_target_info in src/apply/sqpk.rs encounters a
platform_id it does not recognise, it stores the raw u16 value
here and emits a warn! tracing event. Path resolution then falls
back to the win32 layout so that the apply operation can proceed
rather than hard-failing on an unknown platform.