#include <ioconnection.h>
The connection interface a given Url. This connection needs to be implemented for each protocol.
Private Member Functions | |
MAXON_INTERFACE (IoConnectionInterface, MAXON_REFERENCE_NORMAL, "net.maxon.interface.ioconnection", MAXON_IMPLEMENTATION_MODULE("net.maxon.kernel")) | |
|
private |
MAXON_METHOD const Url& GetUrl | ( | ) | const |
Returns the corresponding Url connected to the IoConnectionRef.
MAXON_METHOD Result<IoBrowseRef> GetBrowseIterator | ( | GETBROWSEITERATORFLAGS | flags | ) |
Returns a IoBrowseInterface class to browse through all children of an Url. The return value needs to be checked against nullptr.
[in] | flags | See GETBROWSEITERATORFLAGS. |
MAXON_METHOD Result<InputStreamRef> OpenInputStream | ( | OPENSTREAMFLAGS | flags = OPENSTREAMFLAGS::NONE | ) |
Opens an InputStreamRef for the given connection. With this kind of streams it's only possible to read from it.
[in] | flags | See OPENSTREAMFLAGS for details. |
MAXON_METHOD Result<OutputStreamRef> OpenOutputStream | ( | OPENSTREAMFLAGS | flags = OPENSTREAMFLAGS::NONE | ) |
Opens an OutputStreamRef for the given connection. With this kind of streams it's only possible to write to it.
[in] | flags | See OPENSTREAMFLAGS for details. |
MAXON_METHOD Result<InOutputStreamRef> OpenInOutputStream | ( | OPENSTREAMFLAGS | flags = OPENSTREAMFLAGS::NONE | ) |
Opens an InOutputStreamRef which can read/write for the given connection.
[in] | flags | See OPENSTREAMFLAGS for details. |
MAXON_METHOD Result<Int64> GetContentLength | ( | ) |
Returns length of the content.
MAXON_METHOD IODETECT IoDetect | ( | ) | const |
Detects the type of the Url. This allows to check if a file or directory exists.
MAXON_METHOD Result<IOATTRIBUTES> IoGetAttributes | ( | ) | const |
Returns the file attributes.
MAXON_METHOD Result<void> IoSetAttributes | ( | IOATTRIBUTES | flags, |
IOATTRIBUTES | mask | ||
) |
Modify the file attributes.
[in] | flags | Flags to set/clear. |
[in] | mask | Mask with all flags to be changed. |
MAXON_METHOD Result<UniversalDateTime> IoGetTime | ( | IOTIMEMODE | mode | ) | const |
MAXON_METHOD Result<void> IoSetTime | ( | IOTIMEMODE | mode, |
const UniversalDateTime & | dateTime | ||
) |
Modifies the DateTime of the current file. the time is in local time.
[in] | mode | IOTIMEMODE of the requested time. |
[in] | dateTime | New datetime for the file. |
MAXON_METHOD Result<void> IoDelete | ( | Bool | force | ) |
Deletes the file physically on the medium.
[in] | force | True tries to deletes the file/directory even if the file/directory has read only flags set. |
MAXON_METHOD Result<void> IoCreateDirectory | ( | Bool | createParents, |
BaseArray< Url > * | createdDirs = nullptr |
||
) |
Creates a new directory. The function returns false if the directory already exists.
[in] | createParents | Check if parent directory exists and if not create them recursively. |
[out] | createdDirs | An array that will contain all newly created subdirectories in the order in which they were created. If this parameter is nullptr it will be ignored. |
MAXON_METHOD Result<void> IoCopyFile | ( | const Url & | destName, |
Bool | overwrite, | ||
Bool | removeReadOnly | ||
) |
Copies a file to a different location, the path must exist otherwise the function returns an error.
[in] | destName | Destination name for the copy operation. |
[in] | overwrite | True to allow overwriting destName file if it was already there. |
[in] | removeReadOnly | True to remove the read only flag on the newly created copy. |
MAXON_METHOD Result<void> IoCopyFileProgress | ( | const Url & | destName, |
Bool | overwrite, | ||
Bool | removeReadOnly, | ||
const IoProgressDelegate & | progress | ||
) |
Copies a file to a different location, the path must exist otherwise the function returns an error.
[in] | destName | Destination name for the copy operation. |
[in] | overwrite | True to allow overwriting destName file if it was already there. |
[in] | removeReadOnly | True to remove the read only flag on the newly created copy. |
[in] | progress | Delegate to follow the progress of the copy operation. see @IoProgressDelegate for details. |
MAXON_METHOD Result<void> IoMove | ( | const Url & | destName | ) |
Moves a file or directory (including hierarchy) to a different location, the path must exist otherwise the function returns an error. If the destName file or directory does already exist the function returns with an error. Moving a file or directory on the same partition will perform without a temporary copy.
[in] | destName | Destination name for the move operation. |
MAXON_METHOD Result<void> IoRename | ( | const Url & | newName | ) |
Renames a file or directory. The newName must not be the name of an existing file or directory.
[in] | newName | Destination name for the move operation. |
MAXON_METHOD Result<void> IoGetFreeVolumeSpace | ( | Int64 & | availableBytes, |
Int64 & | totalBytes | ||
) | const |
Calculates the free space on a volume. The Url can point to a volume or directory.
[out] | availableBytes | The number of available bytes on the volume. |
[out] | totalBytes | The total size of the volume in bytes. |
MAXON_METHOD Result<void> IoShowInOS | ( | IOSHOWINOSFLAGS | flags | ) | const |
Opens or shows the file in the systems explorer (desktop/finder). Under windows that would be on the desktop/explorer. Under OSX this would be the Finder. Depending on the url scheme this could also open another browser.
[in] | flags | Flags to define how to show/open that file. |
MAXON_OBSERVABLE_STATIC | ( | Bool | , |
ObservableErrorOpenFile | , | ||
(const Url &url, OPENSTREAMFLAGS flags) | , | ||
ObservableCombinerRunAllBoolUntilFalse | |||
) |
Invokes the observer(s) with the url and open flags if writing a file failed to call open. return true to continue calling handlers, false to stop.