summaryrefslogtreecommitdiff
path: root/src/blob.h
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2019-07-20 10:53:14 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2019-07-20 10:53:14 +0100
commit4c25da8a7ba7437657c3e2da592145113d3532f4 (patch)
tree40f0468135089ff4f9e967bf8ee74b020bee67f7 /src/blob.h
downloadnetfs-gitfs-4c25da8a7ba7437657c3e2da592145113d3532f4.tar.bz2
netfs-gitfs-4c25da8a7ba7437657c3e2da592145113d3532f4.tar.xz
netfs-gitfs-4c25da8a7ba7437657c3e2da592145113d3532f4.zip
Initial commit
Not a lot of stuff, hard coded paths, tests against /usr/portage
Diffstat (limited to 'src/blob.h')
-rw-r--r--src/blob.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/blob.h b/src/blob.h
new file mode 100644
index 0000000..0a2a77d
--- /dev/null
+++ b/src/blob.h
@@ -0,0 +1,27 @@
+#ifndef GITFS_BLOB_H
+#define GITFS_BLOB_H
+
+#include <file.h>
+#include "git.h"
+
+namespace GitFS {
+ using namespace NetFS;
+ class Blob : public File {
+ public:
+ Blob(const GitFS::Git::RepositoryPtr & r, const Git::TreeEntryPtr &);
+
+ void close(const ::Ice::Current& current) override;
+ Attr fgetattr(ReqEnv env, const ::Ice::Current& current) override;
+ Buffer read(long long int offset, long long int size, const ::Ice::Current& current) override;
+ void ftruncate(ReqEnv env, long long int size, const ::Ice::Current& current) override;
+ void write(long long int offset, long long int size, Buffer data, const ::Ice::Current& current) override;
+
+ private:
+ Git::BlobPtr blob;
+ const decltype(git_blob_rawsize({})) blobSize;
+ const char * const blobContent;
+ };
+}
+
+#endif
+