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/FileSpec.h>
22#include <vrs/os/CompilerAttributes.h>
23
24namespace vrs {
25
26using std::unique_ptr;
27
28class FileHandler;
29
32 public:
33 FileDelegator() = default;
34
35 virtual ~FileDelegator() = default;
36
44 virtual int delegateOpen(const FileSpec& fileSpec, unique_ptr<FileHandler>& outNewDelegate) = 0;
45
53 virtual int parseUri(FileSpec& inOutFileSpec, MAYBE_UNUSED size_t colonIndex) const {
54 return inOutFileSpec.parseUri();
55 }
56};
57
58} // namespace vrs
Class to abstract the delegate file open operation for VRS file.
Definition FileDelegator.h:31
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:53
Definition Compressor.cpp:112
Generalized file descriptor class, allowing the efficient representation of complex file objects,...
Definition FileSpec.h:37