Begin work on an alternate object store mechanism using the TAR format.
[cumulus.git] / tarstore.h
1 /* LBS: An LFS-inspired filesystem backup system
2  * Copyright (C) 2006  Michael Vrable
3  *
4  * Backup data is stored in a collection of objects, which are grouped together
5  * into segments for storage purposes.  This implementation of the object store
6  * is built on top of libtar, and represents segments as TAR files and objects
7  * as files within them. */
8
9 #ifndef _LBS_TARSTORE_H
10 #define _LBS_TARSTORE_H
11
12 #include <stdint.h>
13 #include <libtar.h>
14
15 #include <string>
16
17 #include "store.h"
18
19 class Tarfile {
20 public:
21     Tarfile(const std::string &path, const std::string &segment);
22     virtual ~Tarfile();
23
24     void write_object(int id, const char *data, size_t len);
25
26 private:
27     std::string segment_name;
28     TAR *t;
29 };
30
31 #endif // _LBS_TARSTORE_H