mirror of
https://github.com/usatiuk/backup.git
synced 2025-10-27 01:37:49 +01:00
speedup tests, fix includes
This commit is contained in:
@@ -2,16 +2,16 @@
|
||||
// Created by Stepan Usatiuk on 14.04.2023.
|
||||
//
|
||||
|
||||
#include "../includes/FileRepository.h"
|
||||
#include "FileRepository.h"
|
||||
|
||||
#include <exception>
|
||||
#include <iterator>
|
||||
#include <mutex>
|
||||
|
||||
#include "../../filters/includes/CheckFilter.h"
|
||||
#include "../../filters/includes/FilterFactory.h"
|
||||
#include "../includes/Object.h"
|
||||
#include "../includes/Serialize.h"
|
||||
#include "CheckFilter.h"
|
||||
#include "FilterFactory.h"
|
||||
#include "Object.h"
|
||||
#include "Serialize.h"
|
||||
|
||||
FileRepository::FileRepository(Config config) : Repository(std::move(config)), root(std::filesystem::path(this->config.getStr("repo"))), writeCacheMax(config.getInt("repo-target") * 1024 * 1024) {}
|
||||
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
// Created by Stepan Usatiuk on 14.04.2023.
|
||||
//
|
||||
|
||||
#include "../includes/Object.h"
|
||||
#include "Object.h"
|
||||
|
||||
#include "../includes/Serialize.h"
|
||||
#include "Serialize.h"
|
||||
|
||||
Object::Object(idType id, ObjectType type) : id(id), type(type) {}
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// Created by Stepan Usatiuk on 14.04.2023.
|
||||
//
|
||||
|
||||
#include "../includes/Repository.h"
|
||||
#include "Repository.h"
|
||||
Repository::~Repository() = default;
|
||||
|
||||
Repository::Repository(Config config) : config(std::move(config)) {}
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
// Created by Stepan Usatiuk on 14.04.2023.
|
||||
//
|
||||
|
||||
#include "../../includes/objects/Archive.h"
|
||||
#include "objects/Archive.h"
|
||||
|
||||
#include "../../../utils/includes/Exception.h"
|
||||
#include "../../includes/Serialize.h"
|
||||
#include "Exception.h"
|
||||
#include "Serialize.h"
|
||||
|
||||
Archive::Archive(Object::idType id, std::string name, unsigned long long mtime, std::vector<idType> files)
|
||||
: Object(id, ObjectType::Archive), name(name), mtime(mtime), files(files) {}
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
// Created by Stepan Usatiuk on 14.04.2023.
|
||||
//
|
||||
|
||||
#include "../../includes/objects/Chunk.h"
|
||||
#include "objects/Chunk.h"
|
||||
|
||||
#include "../../../utils/includes/Exception.h"
|
||||
#include "../../includes/Serialize.h"
|
||||
#include "Exception.h"
|
||||
#include "Serialize.h"
|
||||
|
||||
Chunk::Chunk(idType id, std::string SHA, std::vector<char> data) : Object(id, ObjectType::Chunk), data(std::move(data)), SHA(std::move(SHA)), length(this->data.size()) {}
|
||||
|
||||
|
||||
@@ -2,14 +2,14 @@
|
||||
// Created by Stepan Usatiuk on 14.04.2023.
|
||||
//
|
||||
|
||||
#include "../../includes/objects/File.h"
|
||||
#include "objects/File.h"
|
||||
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "../../../utils/includes/Exception.h"
|
||||
#include "../../includes/Serialize.h"
|
||||
#include "Exception.h"
|
||||
#include "Serialize.h"
|
||||
|
||||
File::File(Object::idType id, std::string name, unsigned long long bytes, unsigned long long mtime, std::string SHA, std::map<size_t, idType> chunks, Type fileType)
|
||||
: Object(id, ObjectType::File), name(name), bytes(bytes), mtime(mtime), SHA(SHA), fileType(fileType), chunks(std::move(chunks)) {}
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
// Created by Stepan Usatiuk on 23.04.2023.
|
||||
//
|
||||
|
||||
#include "../../includes/objects/FileBuffer.h"
|
||||
#include "objects/FileBuffer.h"
|
||||
|
||||
#include "../../includes/Serialize.h"
|
||||
#include "Serialize.h"
|
||||
|
||||
FileBuffer::FileBuffer(const Repository *repo, Object::idType fileId) : repo(repo), file(Serialize::deserialize<File>(repo->getObject(fileId))), chunksQueue() {
|
||||
for (auto const &id: file.chunks) chunksQueue.emplace(id.second);
|
||||
|
||||
Reference in New Issue
Block a user