X-Git-Url: http://git.vrable.net/?a=blobdiff_plain;f=statcache.h;h=6186f8885fd3251d172cc62e07225428aa2c0fe0;hb=bf947741ac8f65e74d594a1e14e94d90320b403e;hp=10c0397ed3dbf45213ca42dbcd00bcaee851b87a;hpb=e053c8481ac962711348e466496e8a0c5a53f100;p=cumulus.git diff --git a/statcache.h b/statcache.h index 10c0397..6186f88 100644 --- a/statcache.h +++ b/statcache.h @@ -31,18 +31,34 @@ #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; + bool old_is_validated; + int64_t old_mtime, old_ctime, old_inode, old_size; + std::string old_name, old_checksum; + std::list old_contents; }; #endif // _LBS_STATCACHE_H