ArchiveEntry

The ArchiveEntry type represents an entry in SLADE.

Properties

Property Type Description
name string The entry name.
As an example, for an entry Actors/Weapons/Gun1.txt this will be Gun1.txt
path string The path to the entry in the archive, beginning and ending with /.
As an example, for an entry Actors/Weapons/Gun1.txt, this will be /Actors/Weapons/. If the entry isn't in a directory this will be just /
type EntryType The entry's type information
size number The size of the entry in bytes
data string The entry's data
crc32 number The 32-bit crc value calculated from the entry's data

Constructors

No Constructors

This type can not be created directly in scripts.

See:

Functions

formattedName

Parameters

  • [boolean include_path : true]: Whether to include the entry path
  • [boolean include_extension : true]: Whether to include the entry extension
  • [boolean upper_case : false]: Whether to convert the entry name to uppercase

Returns string

Returns a formatted name of the entry, depending on the parameters given. Note that upper_case will not affect the path.


formattedSize

Returns string

Returns the size of the entry in a formatted string, eg. 1.3kb


importFile

Parameters

  • string path: The full path to the file to import

Returns boolean

Imports the file at the given path into the entry. Returns true if the import succeeded.

If the import fails, the error that occurred should be available via slade.globalError().


importEntry

Parameters

  • ArchiveEntry entry: The entry to import data from

Returns boolean

Imports (copies) the data from entry. Returns true if the import succeeded.

If the import fails, the error that occurred should be available via slade.globalError().


importData

Parameters

  • string data: The data to import

Returns boolean

Imports data into the entry. Returns true if the import succeeded.

If the import fails, the error that occurred should be available via slade.globalError().


exportFile

Parameters

  • string path: The full path to the file to export

Returns boolean

Exports the entry data to a file at path. If a file already exists at path, it will be overwritten. Returns true if the export succeeded.

If the export fails, the error that occurred should be available via slade.globalError().