IoHandlerInterface Class Reference IO

#include <iohandler.h>

Inheritance diagram for IoHandlerInterface:

详细描述

The IoHandler class offers some I/O functionality for filenames. This handler needs to be implemented for each scheme.

公共成员函数

const MAXON_METHOD 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

静态公共成员函数

static MAXON_METHOD IoHandler  GetHandlerForScheme (const UrlScheme &scheme)

私有成员函数

  MAXON_INTERFACE ( IoHandlerInterface , MAXON_REFERENCE_CONST , "net.maxon.interface.iohandler")

成员函数文档编制

◆  MAXON_INTERFACE()

MAXON_INTERFACE ( IoHandlerInterface   ,
MAXON_REFERENCE_CONST   ,
"net.maxon.interface.iohandler"   
)
private

◆  GetUrlScheme()

const MAXON_METHOD 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).

返回
Url scheme of this handler.

◆  SetSystemPath()

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.
返回
OK on success.

◆  GetSystemPath()

MAXON_METHOD Result < String > GetSystemPath ( const UrlInterface url ) const

Translates a Url to a OS- or handler-specific system path.

参数
[in] url The Url .
返回
The generated path.

◆  AppendUrl() [1/2]

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.
返回
OK on success.

◆  AppendUrl() [2/2]

MAXON_METHOD Result <void> AppendUrl ( UrlInterface url ,
const Url relativeUrl  
) const

Appends the given relative url to the url.

参数
[in,out] url The Url .
[in] relativeUrl The Url to be added.
返回
OK on success.

◆  RemoveUrl()

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 .
返回
OK on success.

◆  OpenConnection()

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.
返回
Pointer to a specialized IoConnectionRef.

◆  Normalize()

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.
返回
The normalized url. In case of a normalization error *this is returned.

◆  IoNormalize()

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.
返回
The normalized and resolved url. In case of a normalization error *this is returned.

◆  GetHandlerForScheme()

static MAXON_METHOD IoHandler GetHandlerForScheme ( const UrlScheme scheme )
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.
返回
The matching IoHandler, or a null reference.