VRS
A file format for sensor data.
Loading...
Searching...
No Matches
FileDelegator.h
1/*
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#pragma once
18
19#include <memory>
20
21#include <vrs/ErrorCode.h>
22#include <vrs/FileSpec.h>
23#include <vrs/os/CompilerAttributes.h>
24
25namespace vrs {
26
27using std::unique_ptr;
28
29class FileHandler;
30
33 public:
34 FileDelegator() = default;
35
36 virtual ~FileDelegator() = default;
37
45 virtual int delegateOpen(const FileSpec& fileSpec, unique_ptr<FileHandler>& outNewDelegate) = 0;
46
54 virtual int parseUri(FileSpec& inOutFileSpec, MAYBE_UNUSED size_t colonIndex) const {
55 return inOutFileSpec.parseUri();
56 }
57};
58
59} // namespace vrs
Class to abstract the delegate file open operation for VRS file.
Definition FileDelegator.h:32
virtual int delegateOpen(const FileSpec &fileSpec, unique_ptr< FileHandler > &outNewDelegate)=0
virtual int parseUri(FileSpec &inOutFileSpec, MAYBE_UNUSED size_t colonIndex) const
Definition FileDelegator.h:54
Definition AsyncDiskFileChunk.hpp:49
Generalized file descriptor class, allowing the efficient representation of complex file objects,...
Definition FileSpec.h:37