Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface WAKFileSystem

Hierarchy

Index

Properties

BinaryStream

BinaryStream: BinaryStream

Blob

Blob: Blob

File

File: File

Folder

Folder: Folder

TextStream

TextStream: TextStream

Methods

loadImage

  • Loads an image from its path.

    var myPict = loadImage( 'C:/images/tulips.jpg' );
    var newPict = new ds.Pict();
    newPict.name = 'Flower';
    newPict.photo = myPict;
    newPict.save();
    warning

    The Image API is partially supported on Linux platforms:

    • You can only load images of the PNG or JPG types
    • For more details, check doc center

    Parameters

    • file: String

      Image path to load (POSIX path). Supports PNG and JPG files.

    Returns Image

    Returns the image through Image object.

  • Loads an image from a File object.

    var myFile = new File( 'C:/images/tulips.jpg' );
    var myPict = loadImage(myFile);
    var newPict = new ds.Pict();
    newPict.name = 'Flower';
    newPict.photo = myPict;
    newPict.save();
    warning

    The Image API is partially supported on Linux platforms:

    • You can only load images of the PNG or JPG types
    • For more details, check doc center

    Parameters

    • file: WAKFileInstance

      File object that reference an image. Supports PNG and JPG files.

    Returns Image

    Returns the image through Image object.

loadText

  • loadText(file: String, charset?: Number): String
  • loadText(file: WAKFileInstance, charset?: Number): String
  • Loads the content of a text file from its path.

    var myText = loadText( 'PROJECT/bootstrap.js' );
    console.log(myText);

    Parameters

    • file: String

      File path to load (POSIX path).

    • Optional charset: Number

      (default: 7) Defines the charset to use to read the file. See charset values for more details.

    Returns String

    Returns a string with the full text file content.

  • Loads the content of a text file from a File object.

    var myFile = new File( 'PROJECT/bootstrap.js' );
    var myText = loadText( myFile );
    console.log( myText );

    Parameters

    • file: WAKFileInstance

      File object that reference a text file.

    • Optional charset: Number

      (default: 7) Defines the charset to use to read the file. See charset values for more details.

    Returns String

    Returns a string with the full text file content.

saveText

  • saveText(textToSave: String, file: String, charset?: Number): void
  • saveText(textToSave: String, file: WAKFileInstance, charset?: Number): void
  • Saves the text into a file.

    saveText( 'Hello World ! Here is my text saved.', 'C:/texts/chapter-1.txt' );

    Parameters

    • textToSave: String

      Text string to save.

    • file: String

      File path where to update (POSIX path).

    • Optional charset: Number

      (default: 7) Defines the charset of the text string. See charset values for more details.

    Returns void

  • Saves the text into a file.

    var myFile = new File( 'C:/texts/chapter-1.txt' );
    saveText( 'Hello World ! Here is my text saved.', myFile );

    Parameters

    • textToSave: String

      Text string to save.

    • file: WAKFileInstance

      File path where to update (POSIX path).

    • Optional charset: Number

      (default: 7) Defines the charset of the text string. See charset values for more details.

    Returns void