Class Index | File Index

Classes


Namespace sandboxe.trunk


Defined in: docbase.js.

Namespace Summary
Constructor Attributes Constructor Name and Description
 
Functions to work with the trunk, allowing for packing assets into binaries.
Method Summary
Method Attributes Method Name and Description
<static>  
sandboxe.trunk.clear()
Removes all stages file names for commit.
<static>  
sandboxe.trunk.commit()
Creates a new binary that is a copy of this one, except its trunk consists of the files added with sandboxe.trunk.stage().
<static>  
sandboxe.trunk.getItemNames()
Returns an array of all files added to the trunk from the commit() call that created this binary.
<static>  
sandboxe.trunk.inherit()
Stages all trunk items that existed at the creation of this binary.
<static>  
sandboxe.trunk.query()
Returns a list of the currently stages files.
<static>  
sandboxe.trunk.remove(path)
Removes the given path from the stages files within the trunk.
<static>  
sandboxe.trunk.stage(path)
Adds the specified file to list of files to add to the trunk.
Namespace Detail
sandboxe.trunk
Functions to work with the trunk, allowing for packing assets into binaries.
The trunk is a conceptual means by which you can store assets for your project to be bundled with an executable. Using the trunk, you can create copies of the sandboxe binary with files packed into the binary. When trunk assets are added they are automatically looked for when doing an action that would normally check the disk.

It's important to note that this process doesn't actually modify the currently running executable, but instead allows to create a new executable with the parameters you set.

The usual process of using the trunk is like so:
1. stage() the files to be included
2. commit() the files to produce a new binary 
Then when running the new binary, there's no need to change any code. The normal routines that look for disk objects (i.e. sandboxe.assets) will automatically search objects in the trunk for a match based on its original path before defaulting to the disk. The new binary's trunk can always be checked using sandboxe.trunk.getItemNames(). For example:
// Stages the image for a new binary.
sandboxe.trunk.stage('/path/to/myImage.png');
// create new binary.
sandboxe.trunk.commit('/path/to/new/binary');
Method Detail
<static> sandboxe.trunk.clear()
Removes all stages file names for commit. Note that this doesnt actually touch any files, just removes the effects of staging it

<static> {String} sandboxe.trunk.commit()
Creates a new binary that is a copy of this one, except its trunk consists of the files added with sandboxe.trunk.stage(). If any file is not found, the export fails.
Returns:
{String} A status message is returned giving info if unsuccessful. If successful, the string is returned is empty.

<static> {Array} sandboxe.trunk.getItemNames()
Returns an array of all files added to the trunk from the commit() call that created this binary. For any file action whose path equals a name on this list, the internal binary data packed in the trunk will be used instead of looking for an on-disk file.
Returns:
{Array} List of files in the trunk

<static> sandboxe.trunk.inherit()
Stages all trunk items that existed at the creation of this binary.

<static> {Array} sandboxe.trunk.query()
Returns a list of the currently stages files.
Returns:
{Array} Array of strings with the names given for each staging call.

<static> sandboxe.trunk.remove(path)
Removes the given path from the stages files within the trunk. Note that this does not remove files from this binary's trun; only the stages file reference is removed.
Parameters:
{String} path
The path to remove from the staged file list.

<static> sandboxe.trunk.stage(path)
Adds the specified file to list of files to add to the trunk.
Parameters:
{String} path
The path to the file you wish to commit to the trunk.

Documentation generated by JsDoc Toolkit 2.4.0 on Sun Feb 03 2019 18:30:57 GMT-0500 (EST)