#cp.nib.archiver

Provides support for loading NIB files stored in the NIBArchive format.


#API Overview

Constants - Useful values which cannot be changed

Functions - API calls offered directly by the extension

Constructors - API calls which return an object, typically one that offers API methods

Methods - API calls which can only be made on an object returned by a constructor


#API Documentation

#Constants

Signaturecp.nib.archiver.SIGNATURE -> string
TypeConstant
DescriptionMarks the data stream as an NIBArchive.
NotesNone
Sourcesrc/extensions/cp/nib/archiver.lua line 324

#Functions

Signaturecp.nib.archiver.isSupported(data) -> boolean
TypeFunction
DescriptionChecks if the given data is an NIBArchive.
Parameters
  • data - The data to check.
Returns
  • true if the data is an NIBArchive, false otherwise.
NotesNone
ExamplesNone
Sourcesrc/extensions/cp/nib/archiver.lua line 329

#Constructors

Signaturecp.nib.archiver.new(decoders) -> cp.nib.archiver
TypeConstructor
DescriptionCreates a new cp.nib.archiver instance, with the specified list of decoders.
Parameters
  • decoders - The list of cp.nib.decoder functions to use.
Returns
  • The new cp.nib.archiver instance.
NotesNone
ExamplesNone
Sourcesrc/extensions/cp/nib/archiver.lua line 343

#Methods

Signaturecp.nib.archiver.fromFile(filename) -> table | nil, string
TypeMethod
DescriptionAttempts to read the specified filename and unarchives it into a table, if it is a valid NIBArchive.
Parameters
  • filename - The string of the file to read.
Returns
  • A table containing the archive data, or nil if the file could not be read.
  • The string error message, if any.
NotesNone
ExamplesNone
Sourcesrc/extensions/cp/nib/archiver.lua line 381