mirror of
https://github.com/usatiuk/backup.git
synced 2025-10-27 01:37:49 +01:00
getObject => getObjectRaw
This commit is contained in:
@@ -82,7 +82,7 @@ FileRepository::~FileRepository() {
|
||||
}
|
||||
}
|
||||
|
||||
std::vector<char> FileRepository::getObject(Object::idType id) const {
|
||||
std::vector<char> FileRepository::getObjectRaw(Object::idType id) const {
|
||||
if (!ready) throw Exception("Tried working with uninitialized repo!");
|
||||
|
||||
std::unique_lock lock(repoLock);
|
||||
@@ -188,8 +188,8 @@ bool FileRepository::writeFile(const std::filesystem::path &file, const std::vec
|
||||
return true;
|
||||
}
|
||||
|
||||
std::vector<char> FileRepository::getObject(Object::ObjectType type, const std::string &key) const {
|
||||
return getObject(getObjectId(type, key));
|
||||
std::vector<char> FileRepository::getObjectRaw(Object::ObjectType type, const std::string &key) const {
|
||||
return getObjectRaw(getObjectId(type, key));
|
||||
}
|
||||
|
||||
Object::idType FileRepository::getObjectId(Object::ObjectType type, const std::string &key) const {
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
#include "Serialize.h"
|
||||
|
||||
FileBuffer::FileBuffer(const Repository *repo, Object::idType fileId)
|
||||
: repo(repo), file(Serialize::deserialize<File>(repo->getObject(fileId))), chunksQueue() {
|
||||
: repo(repo), file(Serialize::deserialize<File>(repo->getObjectRaw(fileId))), chunksQueue() {
|
||||
for (auto const &id: file.chunks) chunksQueue.emplace(id.second);
|
||||
};
|
||||
|
||||
@@ -35,7 +35,7 @@ int FileBuffer::underflow() {
|
||||
if (getBuf.empty() || curGetBufPos == getBuf.size()) {
|
||||
if (chunksQueue.empty()) return traits_type::eof();
|
||||
else {
|
||||
auto chunk = Serialize::deserialize<Chunk>(repo->getObject(chunksQueue.front()));
|
||||
auto chunk = Serialize::deserialize<Chunk>(repo->getObjectRaw(chunksQueue.front()));
|
||||
getBuf = chunk.data;
|
||||
chunksQueue.pop();
|
||||
curGetBufPos = 0;
|
||||
|
||||
Reference in New Issue
Block a user