Files
dragonpilot/tools/replay/filereader.cc
Vehicle Researcher 6fe5d4054d openpilot v0.11.0 release
date: 2026-03-13T21:04:16
master commit: 41994b1d27423e8a10008019a962417bf0f5f974
2026-03-13 21:04:16 -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);
}