VRS
A file format for sensor data.
Loading...
Searching...
No Matches
Public Member Functions | List of all members
vrs::FileDelegator Class Referenceabstract

Class to abstract the delegate file open operation for VRS file. More...

#include <FileDelegator.h>

Inheritance diagram for vrs::FileDelegator:
vrs::FileHandler vrs::WriteFileHandler vrs::DiskFileT< FileChunk > vrs::AtomicDiskFile

Public Member Functions

virtual int delegateOpen (const FileSpec &fileSpec, unique_ptr< FileHandler > &outNewDelegate)=0
 
virtual int parseUri (FileSpec &inOutFileSpec, MAYBE_UNUSED size_t colonIndex) const
 

Detailed Description

Class to abstract the delegate file open operation for VRS file.

Member Function Documentation

◆ delegateOpen()

virtual int vrs::FileDelegator::delegateOpen ( const FileSpec fileSpec,
unique_ptr< FileHandler > &  outNewDelegate 
)
pure virtual

Delegate the file open operation to the correct FileHandler.

Parameters
fileSpecfile specification.
outNewDelegateIf provided, might be a fallback FileHandler to use. On exit, may be set to a different FileHandler than the provided one, if the provided FileHandler was not set or not the correct one to handle the provided file specification, or cleared if no appropriate FileHandler could be found.
Returns
A status code, 0 meaning success.

Implemented in vrs::FileHandler.

◆ parseUri()

virtual int vrs::FileDelegator::parseUri ( FileSpec inOutFileSpec,
MAYBE_UNUSED size_t  colonIndex 
) const
inlinevirtual

When converting a URI to a FileSpec, some custom parsing maybe required.

Parameters
inOutFileSpecon input, both the fileHandlerName & URI fields are set. All the other fields of the FileSpec object are cleared, and URI holds the full original URI.
colonIndexindex of the ':' character of the URI.
Returns
A status code, 0 on success, which doesn't necessarily mean that the file/object exists or can be opened, merely, that parsing the URI did not fail. On success, any of the fields may have been set or changed, including fileHandlerName and URI.

The documentation for this class was generated from the following file: