Scripting API

Scripting API

PackageArchive

Class in Abyss.Core, from Abyss.Core.

A package as one file, acme.physics-1.2.0.abypackage: a zip of what it carries (PackageFiles) and PackageFiles.FileName, every file's hash, which is what Export writes, the registry keeps and a store will send. Any zip tool opens it.

public static class PackageArchive

Methods

NameOf

public static string NameOf(string id, string version)

What an archive of a package is called where it is given away: acme.physics-1.2.0.abypackage.

Parameters

  • id
  • version

Write

public static PackageFiles Write(string folder, string archive)

Writes the package in folder as an archive, and says the hashes it holds.

Parameters

  • folder
  • archive

Exceptions

  • InvalidOperationException: Its manifest cannot be read.

Read

public static PackageInArchive Read(string archive)

What the archive archive holds, every file checked against the hash it gives: a manifest, a hash for each file and a file for each hash, each where a package keeps one.

Parameters

  • archive

Exceptions

  • FormatException: It is not an archive of a package, or a file differs from its hash, saying which.

Extract

public static PackageInArchive Extract(string archive, string folder)

Writes what the archive holds into folder, its hashes beside it as PackageFiles.FileName, having checked them; what it held.

Parameters

  • archive
  • folder

Exceptions

Constants

Extension

public const string Extension = ".abypackage"

What an archive of a package is named with.