Files
onepilot/tools/replay/filereader.cc
T
Vehicle Researcher 6adb63b915 openpilot v0.11.1 release
date: 2026-06-04T09:49:56
master commit: c0ab3550eca2e9daf197c46b7e4b24aa9637cf2e
2026-06-04 09:50:05 -07:00

15 lines
491 B
C++

#include "tools/replay/filereader.h"
#include "common/util.h"
#include "tools/replay/py_downloader.h"
std::string FileReader::read(const std::string &file, std::atomic<bool> *abort) {
const bool is_remote = (file.find("https://") == 0) || (file.find("http://") == 0);
if (is_remote) {
std::string local_path = PyDownloader::download(file, cache_to_local_, abort);
if (local_path.empty()) return {};
return util::read_file(local_path);
}
return util::read_file(file);
}