The PermanentFile and TemporaryFile JavaScript classes. Used to represent an actual image file on disk. More...
Public Slots | |
FileWrapper & | setPath (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 () |
Retrieves the full file path. More... | |
FileWrapper & | setExtension (String &ext) |
Change extension for file name. Extension won't change if there is an open stream. More... | |
String | extension () |
Retrieve file extension. More... | |
bool | exists () |
Verify if file exists on the disk. More... | |
bool | remove () |
Remove physical file manually. Cannot remove file if there is an open stream. More... | |
void | setTextCodec (String &codecName) |
Sets the codec for this file wrapper for the encoding specified by codecName. Common values for codecName include "ISO 8859-1", "UTF-8", and "UTF-16". More... | |
Stream Manipulation | |
bool | isOpen () |
Check if file is opened. More... | |
bool | isClose () |
Checks if the file is closed. More... | |
bool | open (int m=int(FileIOType::WRITE_ONLY)) |
Opens the file stream for read/write. More... | |
bool | close () |
Closes the file stream. More... | |
void | write (String &text) |
Write string in current stream. More... | |
void | writeLine (String &text) |
Write string line in current stream. More... | |
void | writeFile (FileWrapper 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 (FileWrapper dest) |
Moves the current FileWrapper to a new FileWrapper destination. More... | |
bool | copy (FileWrapper dest) |
Copy current FileWrapper to new FileWrapper destination. More... | |
Public Member Functions | |
FileWrapper () | |
Create a new FileWrapper. More... | |
FileWrapper (String path) | |
Create a new FileWrapper. 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 SM_InputPortWrapper 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.
FileWrapper::FileWrapper | ( | ) |
Create a new FileWrapper.
FileWrapper::FileWrapper | ( | String | path | ) |
Create a new FileWrapper.
path | Path to physical FileWrapper |
|
slot |
Closes the file stream.
|
slot |
Copy current FileWrapper to new FileWrapper destination.
dest | : The desired destination of the FileWrapper. |
|
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 |
Moves the current FileWrapper to a new FileWrapper destination.
dest | : The desired destination of the FileWrapper. |
|
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 |
Sets the codec for this file wrapper for the encoding specified by codecName. Common values for codecName include "ISO 8859-1", "UTF-8", and "UTF-16".
codecName | : the codec name |
|
slot |
Write string in current stream.
text | : Text to write. |
|
slot |
Write entire contents of the parameter file in the current stream.
file | : FileWrapper object. |
|
slot |
Write string line in current stream.
text | : Text to write. |