diff --git a/lib/functions.incpat b/lib/functions.incpat new file mode 100644 index 0000000..8ecc9c9 --- /dev/null +++ b/lib/functions.incpat @@ -0,0 +1,51 @@ +// /*************************************************************************** +// Aaru Data Preservation Suite +// ---------------------------------------------------------------------------- +// +// Filename : functions.hexpat +// Author(s) : Natalia Portillo +// +// Component : Functions shared between different ImHex patterns. +// Version : 1.00 +// +// --[ Description ] ---------------------------------------------------------- +// +// Functions to be shared between ImHex patterns. +// +// --[ History ] -------------------------------------------------------------- +// +// 1.00: Initial release. +// +// --[ License ] -------------------------------------------------------------- +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// ---------------------------------------------------------------------------- +// Copyright © 2011-2025 Natalia Portillo +// ****************************************************************************/ + +#pragma once +#pragma author Nat Portillo + +//import std.sys; + +fn format_array_as_hex(ref auto arg) +{ + str result; + + for (u8 i = 0, i < sizeof(arg), i += 1) + result += std::format("{:02X}", arg[i]); + + return result; +};