From d1b0909894a302540f979d904dd378af1cad620c Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 15 Apr 2016 15:11:34 +0200 Subject: BinaryCacheStore::readFile(): Return a shared_ptr to a string This allows readFile() to indicate that a file doesn't exist, and might eliminate some large string copying. --- src/libstore/binary-cache-store.hh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/libstore/binary-cache-store.hh') diff --git a/src/libstore/binary-cache-store.hh b/src/libstore/binary-cache-store.hh index 9e7b0ad9a..55bba6278 100644 --- a/src/libstore/binary-cache-store.hh +++ b/src/libstore/binary-cache-store.hh @@ -39,7 +39,9 @@ protected: virtual void upsertFile(const std::string & path, const std::string & data) = 0; - virtual std::string getFile(const std::string & path) = 0; + /* Return the contents of the specified file, or null if it + doesn't exist. */ + virtual std::shared_ptr getFile(const std::string & path) = 0; public: -- cgit v1.2.3