Options
All
  • Public
  • Public/Protected
  • All
Menu

Implements operations for reading and writing SmileBASIC SmileBASICFileType.Text files.

Hierarchy

Index

Constructors

constructor

Properties

Content

Content: string

The content of this file as a string.

Footer

Footer: Buffer

Stores the SHA-1 HMAC footer of this file, if present. META files do not have a footer.

Header

Header: Header

The parsed Header of this file.

RawContent

RawContent: Buffer

Stores the raw contents of this file as a raw Buffer.

Static FileTypeMappings

FileTypeMappings: Map<SmileBASICFileType, typeof SmileBASICFile> = ...

Maps SmileBASICFileTypes to different SmileBASIC file subtypes.

Used by ToActualType()

internal

Accessors

Type

Methods

AsDataFile

AsJpegFile

AsMetaFile

AsProject3File

AsProject4File

AsTextFile

CalculateFooter

  • CalculateFooter(): Promise<void>

GetCompressedContent

  • GetCompressedContent(): Promise<Buffer>

ToActualType

ToBuffer

  • ToBuffer(): Promise<Buffer>

Static FromBuffer

  • Creates a SmileBASICTextFile instance from the provided SmileBASIC format file (as a Buffer). Optionally, also verify the footer and throw an error if it is incorrect.

    Parameters

    • input: Buffer

      A Buffer storing a raw SmileBASIC file

    • verifyFooter: boolean = false

      Set to true to throw an error if the file has an invalid footer.

    Returns Promise<SmileBASICTextFile>

    A Promise resolving to a SmileBASICTextFile instance.

Static FromFile

Static VerifyFooter

  • VerifyFooter(input: Buffer): boolean
  • Verifies the footer of a (presumed) SmileBASIC file in a Buffer.

    Parameters

    • input: Buffer

      A Buffer storing a raw SmileBASIC file

    Returns boolean

    true if the footer is correct, false otherwise.

Generated using TypeDoc