VRS
A file format for sensor data.
Loading...
Searching...
No Matches
FileCache.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#include <string>
21
22#include <vrs/VrsExport.h>
23
24namespace vrs {
25
26using std::string;
27
31class VRS_API FileCache {
32 public:
41 static int makeFileCache(const string& app, const string& parentFolder = {});
42
44 static void disableFileCache();
45
48 static FileCache* getFileCache();
49
58 int getFile(const string& filename, string& outFilePath);
59
71 int getFile(const string& domain, const string& filename, string& outFilePath);
72
73 protected:
74 explicit FileCache(string mainFolder) : mainFolder_{std::move(mainFolder)} {}
75
76 private:
77 string mainFolder_;
78
79 static std::unique_ptr<FileCache> sFileCache;
80};
81
82} // namespace vrs
Utility class to manage various forms of file caching. Disabled by default.
Definition FileCache.h:31
Definition Compressor.cpp:113