Script
|
The SCR_FileWrapper class is used to represent an actual image file on disk. Files can be instantiated in the scripting environment or retrieved in an SM_InputPortWrapper object. More...
#include <fileinterface.h>
Public Slots | |
SCR_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 () |
Retrieve file path. More... | |
SCR_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 disk. More... | |
bool | remove () |
Stream Manipulation | |
bool | isOpen () |
Check if file is opened. More... | |
bool | isClose () |
Check if file is closed. More... | |
bool | open (int m=int(SCR_FileIOTypeWrapper::WRITE_ONLY)) |
Open file stream for read/write. More... | |
bool | close () |
Close 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 (SCR_FileWrapper *file) |
Write entire content of parameter file in current stream. More... | |
String | read () |
Read entire content of stream. More... | |
String | readLine () |
Read single line of stream. More... | |
File management | |
bool | move (SCR_FileWrapper *dest) |
bool | copy (SCR_FileWrapper *dest) |
Public Member Functions | |
SCR_FileWrapper () | |
Create a new SCR_FileWrapper. More... | |
SCR_FileWrapper (String path) | |
Create a new SCR_FileWrapper. More... | |
The SCR_FileWrapper class is used to represent an actual image file on disk. Files can be instantiated in the scripting environment or retrieved in an SM_InputPortWrapper object.
You can use it in both the Script Editor and scriptModule.
In a script, there are two possible ructor: the PermanentFile or TemporaryFile. The PermanentFile takes the name of a file as an argument. Example:
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. Example:
SCR_FileWrapper::SCR_FileWrapper | ( | ) |
Create a new SCR_FileWrapper.
SCR_FileWrapper::SCR_FileWrapper | ( | String | path | ) |
Create a new SCR_FileWrapper.
path | Path to physic SCR_FileWrapper |
|
slot |
Close file stream.
|
slot |
Copy current SCR_FileWrapper to new SCR_FileWrapper destination
dest | Destination |
|
slot |
Verify if file exists on disk.
|
slot |
Retrieve file extension.
|
slot |
Check if file is closed.
|
slot |
Check if file is opened.
|
slot |
Move current SCR_FileWrapper to new SCR_FileWrapper destination
dest | Destination |
|
slot |
Open file stream for read/write.
m | IO stream descriptor |
|
slot |
Retrieve 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 content of parameter file in current stream.
file | SCR_FileWrapper object |
|
slot |
Write string line in current stream.
text | Text to write |