Tune caves
[oweals/minetest.git] / src / filecache.h
index 35ae9aa7d5774bfe8f40fa4e47581549ca664a1a..97203e635592353170a2f19fe466b03ff5323d1d 100644 (file)
@@ -34,46 +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.
-               A file name is required to give the disk file a name that
-               has the right file name extension (e.g. ".png").
-       */
-       bool loadByChecksum(const std::string &name, std::ostream &os,
-                       const std::string &checksum);
-
-       /*
-               Stores a file in the cache based on its checksum.
-               Returns true on success, false otherwise.
-       */
-       bool updateByChecksum(const std::string &name, const std::string &data,
-                       const std::string &checksum);
-
+       
+       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 &name, std::ostream &os,
-                       const std::string &path);
-       bool updateByPath(const std::string &name, const std::string &data,
-                       const std::string &path);
-       std::string getPathFromChecksum(const std::string &name,
-                       const std::string &checksum);
+       bool loadByPath(const std::string &path, std::ostream &os);
+       bool updateByPath(const std::string &path, const std::string &data);
 };
 
 #endif