#include <iohandler.h>
The IoHandler class offers some I/O functionality for filenames. This handler needs to be implemented for each scheme.
Public Member Functions | |
MAXON_METHOD const Id & | GetUrlScheme () const |
MAXON_METHOD Result< void > | SetSystemPath (UrlInterface &url, const String &systemPath) const |
MAXON_METHOD Result< String > | GetSystemPath (const UrlInterface &url) const |
MAXON_METHOD Result< void > | AppendUrl (UrlInterface &url, const String &name) const |
MAXON_METHOD Result< void > | AppendUrl (UrlInterface &url, const Url &relativeUrl) const |
MAXON_METHOD Result< void > | RemoveUrl (UrlInterface &url) const |
MAXON_METHOD Result< IoConnectionRef > | OpenConnection (const Url &name) const |
MAXON_METHOD Result< Url > | Normalize (const Url &url, NORMALIZEFLAGS flags) const |
MAXON_METHOD Result< Url > | IoNormalize (const Url &url, NORMALIZEFLAGS flags) const |
MAXON_METHOD Result< String > | ConvertToUiName (const UrlInterface &url, CONVERTTOUINAMEFLAGS flags, const AssetRepositoryRef &lookupRepository) const |
Static Public Member Functions | |
static MAXON_METHOD IoHandler | GetHandlerForScheme (const UrlScheme &scheme) |
Private Member Functions | |
MAXON_INTERFACE (IoHandlerInterface, MAXON_REFERENCE_CONST, "net.maxon.interface.iohandler", MAXON_IMPLEMENTATION_MODULE("net.maxon.kernel")) | |
|
private |
MAXON_METHOD const Id& GetUrlScheme | ( | ) | const |
Returns the url scheme to use in Urls for this handler (such as "file" if this is the IoHandler for the file system).
MAXON_METHOD Result<void> SetSystemPath | ( | UrlInterface & | url, |
const String & | systemPath | ||
) | const |
Converts an OS- or handler-specific system path to a Url.
[out] | url | The url that will be filled. |
[in] | systemPath | The path. |
MAXON_METHOD Result<String> GetSystemPath | ( | const UrlInterface & | url | ) | const |
MAXON_METHOD Result<void> AppendUrl | ( | UrlInterface & | url, |
const String & | name | ||
) | const |
Appends the given file name to the url.
[in,out] | url | The Url. |
[in] | name | A file name to add. |
MAXON_METHOD Result<void> AppendUrl | ( | UrlInterface & | url, |
const Url & | relativeUrl | ||
) | const |
MAXON_METHOD Result<void> RemoveUrl | ( | UrlInterface & | url | ) | const |
Removes the last part of the given url and returns the parent url.
[in,out] | url | The Url. |
MAXON_METHOD Result<IoConnectionRef> OpenConnection | ( | const Url & | name | ) | const |
Opens a connection and returns the specified IoConnectionRef handler for this type of protocol.
[in] | name | Url of the connection to open. |
MAXON_METHOD Result<Url> Normalize | ( | const Url & | url, |
NORMALIZEFLAGS | flags | ||
) | const |
Return a normalized a url. Does not involve any Io operation and is just syntax based. If nothing needs to be normalized the same path is returned.
[in] | flags | Flags to define type of normalization. |
MAXON_METHOD Result<Url> IoNormalize | ( | const Url & | url, |
NORMALIZEFLAGS | flags | ||
) | const |
Return a normalized a url. If the normalized url is a link, the IoHandler can resolve it (if supported). E.g. the file:/// handler resolves symbolic links, where the http:// handler does not resolve llinks.
[in] | flags | Flags to define type of normalization. |
|
static |
Returns the IoHandler which is responsible for the given scheme. The IoHandler is searched for at the IoHandlers registry.
[in] | scheme | The Url scheme for which the matching IoHandler shall be found. |
MAXON_METHOD Result<String> ConvertToUiName | ( | const UrlInterface & | url, |
CONVERTTOUINAMEFLAGS | flags, | ||
const AssetRepositoryRef & | lookupRepository | ||
) | const |
ConvertToUiName converts the url into a humans readable string. Implementations can use this function to convert string. e.g. Assets can build a nice human readable url string.
[in] | url | Url to convert. |
[in] | flags | See CONVERTTOUINAMEFLAGS. |
[in] | lookupRepository | AssetRespoitory to search in. |