Qore FileLocationHandler Module Reference  1.0
FileLocationHandler::FileLocationHandlerFile Class Reference

The class for handling file locations. More...

Inheritance diagram for FileLocationHandler::FileLocationHandlerFile:

Static Public Member Methods

static data handler (string scheme, bool text, string location)
 Returns the file data from the given file location. More...
 
- Static Public Member Methods inherited from FileLocationHandler::FileLocationHandler
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< stringgetSupportedSchemes ()
 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...
 

Public Attributes

const FileLocationOpts = ("encoding", "max_file_len")
 Valid file location options. More...
 
const MaxFileLen = 10 * 1024 * 1024
 Default maximum file length to read (10 MB)
 

Additional Inherited Members

- Static Private Member Methods inherited from FileLocationHandler::FileLocationHandler
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 inherited from FileLocationHandler::FileLocationHandler
static hash< string, code > cache
 The location handler cache; scheme -> handler;. More...
 

Detailed Description

The class for handling file locations.

Member Function Documentation

◆ handler()

static data FileLocationHandler::FileLocationHandlerFile::handler ( string  scheme,
bool  text,
string  location 
)
static

Returns the file data from the given file location.

Parameters
schemethe original scheme string in the location
texta flag if the data should be returned as text or not
locationthe location string
Exceptions
LOCATION-ERRORinvalid file location options

Member Data Documentation

◆ FileLocationOpts

const FileLocationHandler::FileLocationHandlerFile::FileLocationOpts = ("encoding", "max_file_len")

Valid file location options.

supported options:

  • encoding: the output string encoding for text files
  • max_file_len: the maximum number of bytes to read in the file (default: 10 MB)