Qore FileLocationHandler Module Reference 2.3
|
The main class. More...
#include <FileLocationHandler.qc.dox.h>
Static Public Member Methods | |
static binary | getBinaryFileFromLocation (string location) |
Returns binary data for the given file location. More... | |
static Qore::InputStream | getBinaryStreamFromLocation (string location) |
Returns an input stream for file data at the given location. More... | |
static data | getFileFromLocation (bool text, string location) |
Returns the file data from the given location. More... | |
static hash< FileHandlerInfo > | getHandlerInfo (string scheme) |
Returns info about the location handler for he given scheme. More... | |
static list< string > | getHandlerNames () |
Returns a list of all handler names. More... | |
static hash< string, hash< FileHandlerInfo > > | getHandlers (*bool write) |
Returns info about all cached handlers. More... | |
static Qore::AbstractPollOperation | getIoPollerForLocation (string location) |
Returns a non-blocking I/O poller object to retrieve a binary file from the given location. More... | |
static OutputStreamWrapper | getOutputStreamForLocation (string location) |
Returns an output stream for writing data to the given location. More... | |
static Qore::StreamReader | getStreamReaderFromLocation (string location) |
Returns a string stream for the file's data at the given location. More... | |
static list< string > | getSupportedSchemes () |
Retuns a list of supported schemes. More... | |
static string | getTextFileFromLocation (string location) |
Returns string data for the given file location. More... | |
static | init () |
Initializes default handlers. | |
static bool | isSchemeSupported (string scheme) |
Returns True if the scheme is supported. More... | |
static | registerHandler (string scheme, AbstractFileLocationHandler handler) |
Register a new location handler. More... | |
static bool | tryRegisterHandler (string scheme, AbstractFileLocationHandler handler) |
Tries to register a new location handler; if the scheme is already registered, the method returns False. More... | |
static | writeFileToLocation (string location, data contents) |
Writes data to a file at the given location. More... | |
Static Private Member Methods | |
static | checkDynamicInit () |
Checks for dynamic initialization. | |
static hash< InternallLocationInfo > | getInfo (string location, bool read) |
Returns info about the requested location. More... | |
static *hash< auto > | getOptions (reference< string > location) |
Returns a hash of options from the location string. | |
static Mutex | handler_lock () |
The location handler lock to ensure atomic operations. | |
Static Private Attributes | |
static hash< string, AbstractFileLocationHandler > | cache |
The location handler cache; scheme -> handler;. | |
static bool | dynamic_init |
Flag for dynamic initialization. | |
The main class.
|
static |
Returns binary data for the given file location.
location | the location of the file data |
LOCATION-ERROR | the location string cannotbe parsed; unknown location scheme; invalid location option |
|
static |
Returns an input stream for file data at the given location.
location | the location of the file data |
|
static |
Returns the file data from the given location.
text | a flag if the data should be returned as text or not |
location | the location string |
LOCATION-ERROR | invalid location or empty location string |
|
static |
Returns info about the location handler for he given scheme.
scheme | the scheme to provide info for |
SCHEME-ERROR | unsupported or invalid scheme |
|
static |
Returns a list of all handler names.
|
static |
Returns info about all cached handlers.
write | if information for write handler options should be returned (default: return read handler options) |
|
staticprivate |
Returns info about the requested location.
location | the location string |
read | if the location is meant for reading |
LOCATION-ERROR | unsupported or invalid location |
|
static |
Returns a non-blocking I/O poller object to retrieve a binary file from the given location.
location | the location string |
LOCATION-ERROR | invalid location or empty location string |
|
static |
Returns an output stream for writing data to the given location.
location | the location of the file data |
|
static |
Returns a string stream for the file's data at the given location.
location | the location of the file data |
|
static |
Retuns a list of supported schemes.
|
static |
Returns string data for the given file location.
location | the location of the file data |
LOCATION-ERROR | the location string cannotbe parsed; unknown location scheme; invalid location option |
|
static |
Returns True if the scheme is supported.
scheme | the scheme to check |
|
static |
Register a new location handler.
scheme | the scheme for the location |
handler | the handler for the location, must have the signature: data sub (string scheme, bool text, string location) {}
|
LOCATION-HANDLER-ERROR | the given location handler scheme has already been registered |
|
static |
Tries to register a new location handler; if the scheme is already registered, the method returns False.
scheme | the scheme for the location |
handler | the handler for the location, must have the signature: |
|
static |
Writes data to a file at the given location.
location | the location of the file data |
contents | the file contents to write to the location |