Qore FileLocationHandler Module Reference
1.0
|
The main class. More...
Static Public Member Methods | |
static binary | getBinaryFileFromLocation (string location) |
Returns binary data for the given file location. More... | |
static data | getFileFromLocation (bool text, string location) |
Returns the file data from 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 bool | isSchemeSupported (string scheme) |
Returns True if the scheme is supported. More... | |
static | registerHandler (string scheme, code handler) |
Register a new location handler. More... | |
Static Private Member Methods | |
static string | forceEncoding (string str, *string encoding) |
Returns a string tagged with the given encoding, if any. | |
static *hash< auto > | getOptions (reference< string > location) |
Returns a hash option options from the location string. | |
static data | getTextOrBin (data d, bool text, *string encoding) |
Helper method to eturn data in the expected format. More... | |
static Mutex | handler_lock () |
The location handler lock to ensure atomic operations. | |
Static Private Attributes | |
static hash< string, code > | cache |
The location handler cache; scheme -> handler;. More... | |
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 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 |
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 |
|
staticprivate |
Helper method to eturn data in the expected format.
d | the file data |
text | a flag if the data should be returned as a string or not |
encoding | any encoding for string data |
|
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 |