X-Git-Url: http://git.vrable.net/?a=blobdiff_plain;f=store.h;fp=store.h;h=580881cff4b1d77ea596a8b4330d54539796b745;hb=dfb3bcd8cbcc6aa8737deddd332884e23d0e4b22;hp=d44703140281ff6f5943ad916266f43bba48ecf1;hpb=a285d431d827a198c6eb45c44158048deca3d772;p=cumulus.git diff --git a/store.h b/store.h index d447031..580881c 100644 --- a/store.h +++ b/store.h @@ -18,6 +18,7 @@ #include #include "localdb.h" +#include "remote.h" #include "sha1.h" #include "ref.h" @@ -69,7 +70,7 @@ struct tar_header * first; incremental writing is not supported. */ class Tarfile { public: - Tarfile(const std::string &path, const std::string &segment); + Tarfile(RemoteFile *file, const std::string &segment); ~Tarfile(); void write_object(int id, const char *data, size_t len); @@ -81,6 +82,8 @@ private: size_t size; std::string segment_name; + RemoteFile *file; + /* Filter support. */ int real_fd, filter_fd; pid_t filter_pid; @@ -92,9 +95,9 @@ private: class TarSegmentStore { public: // New segments will be stored in the given directory. - TarSegmentStore(const std::string &path, + TarSegmentStore(RemoteStore *remote, LocalDb *db = NULL) - { this->path = path; this->db = db; } + { this->remote = remote; this->db = db; } ~TarSegmentStore() { sync(); } // Writes an object to segment in the store, and returns the name @@ -117,10 +120,10 @@ private: int count; // Objects written to this segment int size; // Combined size of objects written std::string basename; // Name of segment without directory - std::string fullname; // Full path to stored segment + RemoteFile *rf; }; - std::string path; + RemoteStore *remote; std::map segments; LocalDb *db;