Skip to content
This repository has been archived by the owner on Jun 9, 2023. It is now read-only.

Latest commit

 

History

History
32 lines (25 loc) · 2.91 KB

cp.plist.archiver.md

File metadata and controls

32 lines (25 loc) · 2.91 KB

docs » cp.plist.archiver


Supports 'defrosting' a table which is made up from an 'NSKeyArchiver' record.

API Overview

API Documentation

Functions

Signature cp.plist.archiver.unarchive(archive, defrostFn) -> table
Type Function
Description Unarchives a LUA table which was archived into a plist using the NSKeyedArchiver.
Parameters
  • archive - the table containing the archive plist as a table
  • defrostFn - (optional) a function which will be passed an object with a '$class' entry
Returns
  • The unarchived plist table
Notes
  • A 'defrost' function can be provided, which will be called whenever a table with a '$class' structure is present. It will receive the table and the classname and should either return a modified value if the class was handled, or nil if it was unable to handle the class. Eg:
Signature cp.plist.archiver.unarchiveFile(filename, defrostFn) -> table
Type Function
Description Unarchives a plist file which was archived into a plist using the NSKeyedArchiver.
Parameters
  • filename - the file containing the archive plist
  • defrostFn - (optional) a function which will be passed an object with a '$class' entry
Returns
  • The unarchived plist.
Notes
  • A 'defrost' function can be provided, which will be called whenever a table with a '$class' structure is present. It will receive the table and the classname and should either return a modified value if the class was handled, or nil if it was unable to handle the class. Eg: