The main class.
More...
#include <FileLocationHandler.qc.dox.h>
|
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.
|
|
◆ getBinaryFileFromLocation()
static binary FileLocationHandler::FileLocationHandler::getBinaryFileFromLocation |
( |
string |
location | ) |
|
|
static |
Returns binary data for the given file location.
- Parameters
-
location | the location of the file data |
- Returns
- the resource data as a binary value
- Exceptions
-
LOCATION-ERROR | the location string cannotbe parsed; unknown location scheme; invalid location option |
◆ getBinaryStreamFromLocation()
static Qore::InputStream FileLocationHandler::FileLocationHandler::getBinaryStreamFromLocation |
( |
string |
location | ) |
|
|
static |
Returns an input stream for file data at the given location.
- Parameters
-
location | the location of the file data |
- Returns
- an input stream for the file's data
◆ getFileFromLocation()
static data FileLocationHandler::FileLocationHandler::getFileFromLocation |
( |
bool |
text, |
|
|
string |
location |
|
) |
| |
|
static |
Returns the file data from the given location.
- Parameters
-
text | a flag if the data should be returned as text or not |
location | the location string |
- Exceptions
-
LOCATION-ERROR | invalid location or empty location string |
◆ getInfo()
static hash< LocationInfo > FileLocationHandler::FileLocationHandler::getInfo |
( |
string |
location, |
|
|
bool |
read |
|
) |
| |
|
static |
Returns info about the requested location.
- Parameters
-
location | the location string |
read | if the location is meant for reading |
- Exceptions
-
LOCATION-ERROR | unsupported or invalid location |
◆ getOutputStreamForLocation()
static OutputStreamWrapper FileLocationHandler::FileLocationHandler::getOutputStreamForLocation |
( |
string |
location | ) |
|
|
static |
Returns an output stream for writing data to the given location.
- Parameters
-
location | the location of the file data |
- Returns
- an output stream for writing to the file
- Note
-
◆ getStreamReaderFromLocation()
static Qore::StreamReader FileLocationHandler::FileLocationHandler::getStreamReaderFromLocation |
( |
string |
location | ) |
|
|
static |
Returns a string stream for the file's data at the given location.
- Parameters
-
location | the location of the file data |
- Returns
- a stream reader for the file's data
◆ getSupportedSchemes()
static list< string > FileLocationHandler::FileLocationHandler::getSupportedSchemes |
( |
| ) |
|
|
static |
Retuns a list of supported schemes.
- Returns
- a list of supported schemes
◆ getTextFileFromLocation()
static string FileLocationHandler::FileLocationHandler::getTextFileFromLocation |
( |
string |
location | ) |
|
|
static |
Returns string data for the given file location.
- Parameters
-
location | the location of the file data |
- Returns
- the resource data as a string
- Exceptions
-
LOCATION-ERROR | the location string cannotbe parsed; unknown location scheme; invalid location option |
◆ isSchemeSupported()
static bool FileLocationHandler::FileLocationHandler::isSchemeSupported |
( |
string |
scheme | ) |
|
|
static |
Returns True if the scheme is supported.
- Parameters
-
scheme | the scheme to check |
- Returns
- True if the scheme is supported
◆ registerHandler()
Register a new location handler.
- Parameters
-
scheme | the scheme for the location |
handler | the handler for the location, must have the signature: data sub (string scheme, bool text, string location) {}
|
- Exceptions
-
LOCATION-HANDLER-ERROR | the given location handler scheme has already been registered |
◆ writeFileToLocation()
static FileLocationHandler::FileLocationHandler::writeFileToLocation |
( |
string |
location, |
|
|
data |
contents |
|
) |
| |
|
static |
Writes data to a file at the given location.
- Parameters
-
location | the location of the file data |
contents | the file contents to write to the location |