Script Node |
The PermanentFile and TemporaryFile JavaScript classes. Used to represent an actual image file on disk. More...
Public Slots | |
File & | setPath (const String &path) |
Specify absolute path of this image file. Name of file can not be changed if there is an open stream. More... | |
String | path () const |
Retrieves the full file path. More... | |
File & | setExtension (const String &ext) |
Change extension for file name. Extension won't change if there is an open stream. More... | |
String | extension () const |
Retrieve file extension. More... | |
bool | exists () const |
Verify if file exists on the disk. More... | |
bool | remove () |
Remove physical file manually. Cannot remove file if there is an open stream. More... | |
Stream Manipulation | |
bool | isOpen () const |
Check if file is opened. More... | |
bool | isClose () const |
Checks if the file is closed. More... | |
bool | open (int m=int(IO::WRITE_ONLY)) |
Opens the file stream for read/write. More... | |
bool | close () |
Closes the file stream. More... | |
void | write (const String &text) |
Write string in current stream. More... | |
void | writeLine (const String &text) |
Write string line in current stream. More... | |
void | writeFile (File file) |
Write entire contents of the parameter file in the current stream. More... | |
String | read () |
Read entire content of stream. More... | |
String | readLine () |
Read single line of stream. More... | |
File management | |
bool | move (File dest) |
Moves the current File to a new File destination. More... | |
bool | copy (File dest) |
Copy current File to new File destination. More... | |
Public Member Functions | |
File () | |
Create a new File. More... | |
File (String path) | |
Create a new File. More... | |
The PermanentFile and TemporaryFile JavaScript classes. Used to represent an actual image file on disk.
Files can be instantiated in the scripting environment or retrieved in an InputPort object.
There are two possible constructors: the PermanentFile or TemporaryFile. The PermanentFile takes the name of a file as an argument.
The TemporaryFile takes an extension as an argument, an returns a temporary file with that extension. The temporary file and its containing directory will be deleted on exit.
File::File | ( | ) |
Create a new File.
|
slot |
Closes the file stream.
|
slot |
|
slot |
Verify if file exists on the disk.
|
slot |
Retrieve file extension.
|
slot |
Checks if the file is closed.
|
slot |
Check if file is opened.
|
slot |
|
slot |
Opens the file stream for read/write.
m | : IO stream descriptor. |
|
slot |
Retrieves the full file path.
|
slot |
Read entire content of stream.
|
slot |
Read single line of stream.
|
slot |
Remove physical file manually. Cannot remove file if there is an open stream.
|
slot |
Change extension for file name. Extension won't change if there is an open stream.
ext | : Extension String of image file. |
|
slot |
Specify absolute path of this image file. Name of file can not be changed if there is an open stream.
path | : Absolute path String of image file. |
|
slot |
Write string in current stream.
text | : Text to write. |
|
slot |
Write entire contents of the parameter file in the current stream.
file | : File object. |
|
slot |
Write string line in current stream.
text | : Text to write. |