#pragma once #include #include #include #include namespace hex { namespace prv { class Provider; } enum class IPSError { AddressOutOfRange, PatchTooLarge, InvalidPatchHeader, InvalidPatchFormat, MissingEOF }; class Patches { public: Patches() = default; Patches(std::map &&patches) : m_patches(std::move(patches)) {} static wolv::util::Expected fromProvider(hex::prv::Provider *provider); static wolv::util::Expected fromIPSPatch(const std::vector &ipsPatch); static wolv::util::Expected fromIPS32Patch(const std::vector &ipsPatch); wolv::util::Expected, IPSError> toIPSPatch() const; wolv::util::Expected, IPSError> toIPS32Patch() const; const auto& get() const { return this->m_patches; } auto& get() { return this->m_patches; } private: std::map m_patches; }; }