--[[----------------------------------------------------------------------------

WFStruct.lua

--------------------------------------------------------------------------------

ADOBE CONFIDENTIAL
------------------
Copyright 2025 Adobe
All Rights Reserved.

NOTICE: All information contained herein is, and remain the property of
Adobe and its suppliers, if any. The intellectual and
technical concepts contained herein are proprietary to Adobe Systems
Incorporated and its suppliers and may be covered by U.S. and Foreign
Patents, patents in process, and are protected by trade secret or copyright
law.  Dissemination of this information or reproduction of this material is
strictly forbidden unless prior written permission is obtained from
Adobe.

------------------------------------------------------------------------------]]

local WFStructImp = require 'WFStructImp'
--------------------------------------------------------------------------------

local WFStruct = {}

--[[!
	\brief Unpack a memory block.
	
	\param format (string) the format string to use for unpacking the data
	\param data (KSData) the file path to digest
	
	The format string is a sequence of format chars, potentially prefixed with a count. The format chars are:
	* \c x: a pad byte (has no value)
	* \c c: a character, represented as a Lua string of length 0
	* \c b: a signed byte, represented as a Lua number
	* \c B: an unsigned byte, represented as a Lua number
	* \c h: a signed short
	* \c H: an unsigned short
	* \c i: a signed integer
	* \c I: an unsigned integer
	* \c l: a signed long
	* \c L: an unsigned long
	* \c f: a float
	* \c d: a double
	* \c s: a string
	* \c p: a a Pascal string (string prefixed with a length byte)
	* ?: a boolean
	
	\return An array with the unpacked data.
]]
function WFStruct.unpack( format, data )
	-- DOXYGEN STUB
end

--------------------------------------------------------------------------------

--[[!
	\brief Pack a memory block.
	
	\param format (string) the format string to use for packing the data
	\param ... (any) the data to pack
	
	The format string is a sequence of format chars, potentially prefixed with a count. The format chars are:
	* \c x: a pad byte (has no value)
	* \c c: a character, represented as a Lua string of length 0
	* \c b: a signed byte, represented as a Lua number
	* \c B: an unsigned byte, represented as a Lua number
	* \c h: a signed short
	* \c H: an unsigned short
	* \c i: a signed integer
	* \c I: an unsigned integer
	* \c l: a signed long
	* \c L: an unsigned long
	* \c f: a float
	* \c d: a double
	* \c s: a string
	* \c p: a a Pascal string (string prefixed with a length byte)
	* ?: a boolean

	\return The binary data as \c KSData.
]]
function WFStruct.pack( format, ... )
	-- DOXYGEN STUB
end

--------------------------------------------------------------------------------

for k, v in pairs( WFStructImp ) do
	WFStruct[ k ] = v
end

return WFStruct
