#ifndef _library__fileimage_patch__hpp__included__ #define _library__fileimage_patch__hpp__included__ #include #include #include #include #include namespace fileimage { std::vector patch(const std::vector& original, const std::vector& patch, int32_t offset) throw(std::bad_alloc, std::runtime_error); /** * ROM patcher. */ struct patcher { /** * Constructor. */ patcher() throw(std::bad_alloc); /** * Destructor. */ virtual ~patcher() throw(); /** * Identify patch. * * Parameter patch: The patch. * Returns: True if my format, false if not. */ virtual bool identify(const std::vector& patch) throw() = 0; /** * Do the patch. */ virtual void dopatch(std::vector& out, const std::vector& original, const std::vector& patch, int32_t offset) throw(std::bad_alloc, std::runtime_error) = 0; }; } #endif