aboutsummaryrefslogtreecommitdiff
path: root/src/client/filecache.cpp
diff options
context:
space:
mode:
authorsfan5 <sfan5@live.de>2020-06-13 19:03:26 +0200
committerGitHub <noreply@github.com>2020-06-13 19:03:26 +0200
commit2424dfe007e451bb02f87884c2b272cf307d6e7c (patch)
treede43d4ab42126b0533bf5955de3ce68f97f53420 /src/client/filecache.cpp
parent982a030f330bd4f4953ed7d4a7f88286f6fd645d (diff)
downloadminetest-2424dfe007e451bb02f87884c2b272cf307d6e7c.tar.gz
minetest-2424dfe007e451bb02f87884c2b272cf307d6e7c.tar.bz2
minetest-2424dfe007e451bb02f87884c2b272cf307d6e7c.zip
Server pushing media at runtime (#9961)
Diffstat (limited to 'src/client/filecache.cpp')
-rw-r--r--src/client/filecache.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/client/filecache.cpp b/src/client/filecache.cpp
index 3d1b302a8..46bbe4059 100644
--- a/src/client/filecache.cpp
+++ b/src/client/filecache.cpp
@@ -82,8 +82,16 @@ bool FileCache::update(const std::string &name, const std::string &data)
std::string path = m_dir + DIR_DELIM + name;
return updateByPath(path, data);
}
+
bool FileCache::load(const std::string &name, std::ostream &os)
{
std::string path = m_dir + DIR_DELIM + name;
return loadByPath(path, os);
}
+
+bool FileCache::exists(const std::string &name)
+{
+ std::string path = m_dir + DIR_DELIM + name;
+ std::ifstream fis(path.c_str(), std::ios_base::binary);
+ return fis.good();
+}