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/lootcli/include/lootcli/lootcli.h | 116 +++++++++++++++++++++++++++++++++ 1 file changed, 116 insertions(+) create mode 100644 libs/lootcli/include/lootcli/lootcli.h (limited to 'libs/lootcli/include') diff --git a/libs/lootcli/include/lootcli/lootcli.h b/libs/lootcli/include/lootcli/lootcli.h new file mode 100644 index 0000000..90305a6 --- /dev/null +++ b/libs/lootcli/include/lootcli/lootcli.h @@ -0,0 +1,116 @@ +#ifndef MODORGANIZER_LOOTCLI_INCLUDED +#define MODORGANIZER_LOOTCLI_INCLUDED + +#include + +namespace lootcli +{ + +enum class LogLevels +{ + Trace = 0, + Debug, + Info, + Warning, + Error +}; + +inline LogLevels logLevelFromString(const std::string& s) +{ + if (s == "trace") { + return LogLevels::Trace; + } else if (s == "debug") { + return LogLevels::Debug; + } else if (s == "info") { + return LogLevels::Info; + } else if (s == "warning") { + return LogLevels::Warning; + } else if (s == "error") { + return LogLevels::Error; + } else { + return LogLevels::Info; + } +} + +inline std::string logLevelToString(LogLevels level) +{ + switch (level) { + case LogLevels::Trace: + return "trace"; + case LogLevels::Debug: + return "debug"; + case LogLevels::Info: + return "info"; + case LogLevels::Warning: + return "warning"; + case LogLevels::Error: + return "error"; + default: + return "info"; + } +} + +enum class Progress +{ + None = 0, + CheckingMasterlistExistence, + UpdatingMasterlist, + LoadingLists, + ReadingPlugins, + SortingPlugins, + WritingLoadorder, + ParsingLootMessages, + Done +}; + +enum class MessageType +{ + None = 0, + Progress, + Log +}; + +struct Message +{ + MessageType type = MessageType::None; + Progress progress = Progress::None; + LogLevels logLevel = LogLevels::Info; + std::string log; + + static Message fromProgress(Progress p) + { + return {MessageType::Progress, p, LogLevels::Info, ""}; + } + + static Message fromLog(LogLevels level, std::string log) + { + return {MessageType::Log, Progress::None, level, std::move(log)}; + } +}; + +inline Message parseMessage(const std::string_view& line) +{ + static std::regex e(R"(^\[([a-z]+)\] (.+)$)"); + + std::match_results m; + if (!std::regex_match(line.begin(), line.end(), m, e)) { + return {}; + } + + const auto type = m[1]; + + if (type == "progress") { + try { + const auto p = std::stoi(m[2]); + return Message::fromProgress(static_cast(p)); + } catch (std::exception&) { + return {}; + } + } else { + return Message::fromLog(logLevelFromString(type), m[2]); + } +} + +} // namespace lootcli + +#endif // MODORGANIZER_LOOTCLI_INCLUDED -- cgit v1.3.1