X-Git-Url: http://git.vrable.net/?a=blobdiff_plain;f=statcache.h;h=8b13b7ece5ba2cff7be78467989a2b91dc07bf85;hb=4b89157cdec2da9a016a7ea0f511a0f3ff43f6dc;hp=10c0397ed3dbf45213ca42dbcd00bcaee851b87a;hpb=e053c8481ac962711348e466496e8a0c5a53f100;p=cumulus.git diff --git a/statcache.h b/statcache.h index 10c0397..8b13b7e 100644 --- a/statcache.h +++ b/statcache.h @@ -31,18 +31,33 @@ #include #include +#include "ref.h" + class StatCache { public: void Open(const char *path, const char *snapshot_name); void Close(); + bool Find(const std::string &path, const struct stat *stat_buf); void Save(const std::string &path, struct stat *stat_buf, const std::string &checksum, const std::list &blocks); + std::string get_checksum() const { return old_checksum; } + const std::list &get_blocks() const + { return old_contents; } + private: + void ReadNext(); + std::string oldpath, newpath; std::ifstream *oldcache; std::ofstream *newcache; + + /* Information about one file read from the old cache. */ + bool end_of_cache; + int64_t old_mtime, old_ctime, old_inode; + std::string old_name, old_checksum; + std::list old_contents; }; #endif // _LBS_STATCACHE_H