summaryrefslogtreecommitdiff
path: root/src/blob.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/blob.cpp')
-rw-r--r--src/blob.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/blob.cpp b/src/blob.cpp
index e3483b8..a5482df 100644
--- a/src/blob.cpp
+++ b/src/blob.cpp
@@ -1,7 +1,14 @@
#include "blob.h"
#include "repo.h"
+#include <Ice/Current.h>
#include <Ice/ObjectAdapter.h>
+#include <algorithm>
+#include <cerrno>
+#include <exceptions.h>
+#include <file.h>
+#include <memory>
#include <sys/stat.h>
+#include <types.h>
GitFS::Blob::Blob(const Repo * const r, std::string && path) :
repo(r), entry(Git::TreeEntryByPath(repo->tree, path)), blob(getBlob()), blobSize(git_blob_rawsize(blob.get())),
@@ -43,13 +50,13 @@ GitFS::Blob::fgetattr(ReqEnv, const ::Ice::Current &)
NetFS::Buffer
GitFS::Blob::read(long long int o, long long int s, const ::Ice::Current &)
{
- const decltype(blobSize) offset(o);
- const decltype(blobSize) size(s);
+ const auto offset {static_cast<BlobSize>(o)};
+ const auto size {static_cast<BlobSize>(s)};
if (offset > blobSize) {
return {};
}
auto len = std::min(blobSize - offset, size);
- return NetFS::Buffer(blobContent + offset, blobContent + offset + len);
+ return {blobContent + offset, blobContent + offset + len};
}
void