libstore: make BinaryCacheStore::getFile abstract

all extant derived classes implement this method, making the default
implementation not very useful. should it ever be needed again it'll
be easy enough for derived classes to return an owning StringSource.

Change-Id: I65e041e7a4e7b161f0f404f4287cea5440b5a749
This commit is contained in:
eldritch horrors
2025-01-19 16:40:26 +01:00
parent 4c2ec80fcb
commit 2678836e4a
2 changed files with 1 additions and 8 deletions
-7
View File
@@ -65,13 +65,6 @@ void BinaryCacheStore::upsertFile(const std::string & path,
upsertFile(path, std::make_shared<std::stringstream>(std::move(data)), mimeType);
}
box_ptr<Source> BinaryCacheStore::getFile(const std::string & path)
{
return make_box_ptr<GeneratorSource>([](std::string data) -> Generator<Bytes> {
co_yield std::span{data.data(), data.size()};
}(std::move(*getFileContents(path))));
}
std::optional<std::string> BinaryCacheStore::getFileContents(const std::string & path)
{
StringSink sink;
+1 -1
View File
@@ -85,7 +85,7 @@ public:
/**
* Dump the contents of the specified file to a sink.
*/
virtual box_ptr<Source> getFile(const std::string & path);
virtual box_ptr<Source> getFile(const std::string & path) = 0;
virtual std::optional<std::string> getFileContents(const std::string & path);