-
Notifications
You must be signed in to change notification settings - Fork 1
File
Jump To | Go Back |
Arguments | Methods | Variables |
---|
Implements: GenericOutput
A generic file handling interface, should be inherited by new file types to ensure compatibility with FAST file handling functions.
var _file = new File();
_file.write( "Hello World!" );
Name | Type | Purpose |
---|---|---|
read_only | bool |
optional: whether or not this file should be written to, default: false |
Jump To | top |
reset | size | exists | read | peek | poke | write | remaining | eof |
---|---|---|---|---|---|---|---|---|---|---|
save | close | discard | clear | is | toArray | toString |
Returns: N/A undefined
Name | Type | Purpose |
---|---|---|
None |
Resets the read position of the file back to the start.
Returns: inp
Name | Type | Purpose |
---|---|---|
None |
Returns the "size" of the file. Context relies on the type of file.
Returns: boolean (true
or false
)
Name | Type | Purpose |
---|---|---|
None |
Returns true
if the source file exists.
Returns: mixed, or undefined
Name | Type | Purpose |
---|---|---|
None |
Advances the position in the file and returns the next piece of it, or undefined
if the end of file has been reached.
Returns: mixed, or undefined
Name | Type | Purpose |
---|---|---|
_index | undef |
none provided |
Returns the data located in the file a the given index, or undefined
if it doesn't exist.
Returns: N/A undefined
Name | Type | Purpose |
---|---|---|
_index | undef |
none provided |
_value | undef |
none provided |
Inserts the given value into the file at the given index.
Returns: mixed
Name | Type | Purpose |
---|---|---|
_value | undef |
none provided |
Writes the given value to the end of the file.
Returns: inp
Name | Type | Purpose |
---|---|---|
None |
Returns how many more reads() until the end of file.
Returns: boolean (true
or false
)
Name | Type | Purpose |
---|---|---|
None |
Returns whether or not the end of the file has been reached.
Returns: boolean (true
or false
)
Name | Type | Purpose |
---|---|---|
None |
Returns true
if file is writable, otherwise logs a file handling error. Inheritable by child structs to check if the file is wirtable.
Returns: N/A undefined
Name | Type | Purpose |
---|---|---|
None |
Saves and cleans up the internal structures so the File can be garbage-collected safely.
Returns: N/A undefined
Name | Type | Purpose |
---|---|---|
None |
Cleans up the internal structures so the File can be garbage-collected safely.
Returns: N/A undefined
Name | Type | Purpose |
---|---|---|
None |
Clears the file, thus making it "empty".
Returns: boolean (true
or false
)
Name | Type | Purpose |
---|---|---|
type | Constructor |
The Constructor to compare this against. |
Returns true
if the provided type is File.
Returns: array ([values...]
)
Name | Type | Purpose |
---|---|---|
None |
Returns the structure as a array.
Returns: string ("string"
)
Name | Type | Purpose |
---|---|---|
None |
Returns the structure as a string.
Jump To | top |
---|
- writable - none provided
- contents - none provided
- next - none provided
- saveIndex - none provided
Devon Mullane 2020