docs » cp.plist.archiver


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

API Overview

API Documentation

Functions

unarchive

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:

unarchiveFile

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:

results matching ""

    No results matching ""