diff options
author | Perttu Ahola <celeron55@gmail.com> | 2012-03-25 14:47:51 +0300 |
---|---|---|
committer | Perttu Ahola <celeron55@gmail.com> | 2012-03-25 14:48:22 +0300 |
commit | 1cac1de3b27c5c6a511bf86bd9cb1d763c5c7d5d (patch) | |
tree | db4e9d92380de549834efc6b50603ac933127c7a /src/filecache.h | |
parent | 524c78a8d696e2ff980db7c60272032b4028864b (diff) | |
download | minetest-1cac1de3b27c5c6a511bf86bd9cb1d763c5c7d5d.tar.gz minetest-1cac1de3b27c5c6a511bf86bd9cb1d763c5c7d5d.tar.bz2 minetest-1cac1de3b27c5c6a511bf86bd9cb1d763c5c7d5d.zip |
Almost support loading sounds from server
Diffstat (limited to 'src/filecache.h')
-rw-r--r-- | src/filecache.h | 33 |
1 files changed, 5 insertions, 28 deletions
diff --git a/src/filecache.h b/src/filecache.h index ae3fbc602..97203e635 100644 --- a/src/filecache.h +++ b/src/filecache.h @@ -34,39 +34,16 @@ public: m_dir(dir) { } - - /* - Searches the cache for a file with a given name. - If the file is found, lookup copies it into 'os' and - returns true. Otherwise false is returned. - */ - bool loadByName(const std::string &name, std::ostream &os); - - /* - Stores a file in the cache based on its name. - Returns true on success, false otherwise. - */ - bool updateByName(const std::string &name, const std::string &data); - - /* - Loads a file based on a check sum, which may be any kind of - rather unique byte sequence. Returns true, if the file could - be written into os, false otherwise. - */ - bool loadByChecksum(const std::string &checksum, std::ostream &os); - - /* - Stores a file in the cache based on its checksum. - Returns true on success, false otherwise. - */ - bool updateByChecksum(const std::string &checksum, const std::string &data); - + + bool update(const std::string &name, const std::string &data); + bool update_sha1(const std::string &data); + bool load(const std::string &name, std::ostream &os); + bool load_sha1(const std::string &sha1_raw, std::ostream &os); private: std::string m_dir; bool loadByPath(const std::string &path, std::ostream &os); bool updateByPath(const std::string &path, const std::string &data); - std::string getPathFromChecksum(const std::string &checksum); }; #endif |