From 7ee008e150bc5bcf76082d726f719ee0fdfda982 Mon Sep 17 00:00:00 2001 From: SulfurNitride Date: Wed, 11 Feb 2026 02:37:39 -0600 Subject: Fluorine Manager: full Linux port of Mod Organizer 2 Complete native Linux port with FUSE-based virtual filesystem, Proton/umu-run integration, and Flatpak packaging. Key features: - FUSE VFS replacing Windows USVFS (in-process + standalone helper for Flatpak) - Proton/GE-Proton/umu-run launcher with env var forwarding - Flatpak support (sandbox-aware VFS, NXM handler, umu-run) - Wine prefix management UI - Case-insensitive path resolution for Linux filesystems - QSettings-safe INI handling (avoids Bethesda INI corruption) - Portable instance support with auto-generated launcher scripts Co-Authored-By: Claude Opus 4.6 --- libs/esptk/src/tes3subrecord.cpp | 52 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 libs/esptk/src/tes3subrecord.cpp (limited to 'libs/esptk/src/tes3subrecord.cpp') diff --git a/libs/esptk/src/tes3subrecord.cpp b/libs/esptk/src/tes3subrecord.cpp new file mode 100644 index 0000000..1f6c137 --- /dev/null +++ b/libs/esptk/src/tes3subrecord.cpp @@ -0,0 +1,52 @@ +#include "tes3subrecord.h" +#include "espexceptions.h" +#include "esptypes.h" +#include +#include +#include + +ESP::TES3SubRecord::TES3SubRecord() : m_Type(TYPE_UNKNOWN), m_Data() {} + +bool ESP::TES3SubRecord::readFrom(std::istream& stream, uint32_t sizeOverride) +{ + static std::unordered_map s_TypeMap = { + {"HEDR", TYPE_HEDR}, {"MAST", TYPE_MAST}, {"DATA", TYPE_DATA}}; + + char typeString[5]; + if (!stream.read(typeString, 4)) { + if (stream.gcount() == 0) { + return false; + } else { + throw ESP::InvalidRecordException("sub-record incomplete (unknown type)"); + } + } + if (stream.gcount() != 4) { + throw ESP::InvalidRecordException( + std::string("sub-record type incomplete (invalid type ") + typeString + ")"); + } + typeString[4] = '\0'; // not sure if this is required, shouldn't be + auto iter = s_TypeMap.find(std::string(typeString)); + uint32_t dataSize; + if (iter != s_TypeMap.end()) { + m_Type = iter->second; + dataSize = readType(stream); + } else { + m_Type = TYPE_UNKNOWN; + dataSize = readType(stream); + stream.seekg(8, std::istream::cur); + } + + if (sizeOverride != 0UL) { + dataSize = sizeOverride; + } + m_Data.resize(dataSize); + + if (dataSize > 0) { + stream.read(reinterpret_cast(m_Data.data()), dataSize); + } + if (!stream) { + throw ESP::InvalidRecordException(std::string("sub-record incomplete: ") + + typeString); + } + return true; +} -- cgit v1.3.1