X-Git-Url: http://git.vrable.net/?p=cumulus.git;a=blobdiff_plain;f=tarstore.h;h=6acee7fb4b0fce8707eb3aa02a095a0cfabe9ead;hp=a657ec9463d28bee9a1c94088fe788eb5fabfbca;hb=13431fb44e1be1bdb3397685970011404fa49be8;hpb=d60ac6ffaac11851042a5978ac10f52293a50b50 diff --git a/tarstore.h b/tarstore.h index a657ec9..6acee7f 100644 --- a/tarstore.h +++ b/tarstore.h @@ -13,12 +13,30 @@ #include #include +#include #include #include #include #include -#include "store.h" +#include "sha1.h" + +/* In memory datatype to represent key/value pairs of information, such as file + * metadata. Currently implemented as map. */ +typedef std::map dictionary; + +/* IOException will be thrown if an error occurs while reading or writing in + * one of the I/O wrappers. Depending upon the context; this may be fatal or + * not--typically, errors reading/writing the store will be serious, but errors + * reading an individual file are less so. */ +class IOException : public std::exception { +private: + std::string error; +public: + explicit IOException(const std::string &err) { error = err; } + virtual ~IOException() throw () { } + std::string getError() const { return error; } +}; /* A simple wrapper around a single TAR file to represent a segment. Objects * may only be written out all at once, since the tar header must be written