zbackup/zbackup.hh

79 lines
1.8 KiB
C++
Raw Normal View History

2014-12-11 10:50:15 +03:00
// Copyright (c) 2012-2014 Konstantin Isakov <ikm@zbackup.org> and ZBackup contributors, see CONTRIBUTORS
// Part of ZBackup. Licensed under GNU GPLv2 or later + OpenSSL, see LICENSE
2013-07-18 21:33:25 +04:00
#ifndef ZBACKUP_HH_INCLUDED__
#define ZBACKUP_HH_INCLUDED__
#include <stddef.h>
#include <exception>
#include <string>
#include <vector>
#include <bitset>
2013-07-18 21:33:25 +04:00
#include "chunk_id.hh"
#include "chunk_index.hh"
#include "chunk_storage.hh"
#include "encryption_key.hh"
#include "ex.hh"
#include "tmp_mgr.hh"
#include "zbackup.pb.h"
#include "zbackup_base.hh"
#include "backup_exchanger.hh"
2013-07-18 21:33:25 +04:00
using std::string;
using std::vector;
using std::bitset;
2013-07-18 21:33:25 +04:00
class ZBackup: public ZBackupBase
{
ChunkStorage::Writer chunkStorageWriter;
public:
ZBackup( string const & storageDir, string const & password,
size_t threads );
/// Backs up the data from stdin
void backupFromStdin( string const & outputFileName );
};
class ZRestore: public ZBackupBase
{
ChunkStorage::Reader chunkStorageReader;
public:
ZRestore( string const & storageDir, string const & password,
size_t cacheSize );
2013-07-18 21:33:25 +04:00
/// Restores the data to stdin
void restoreToStdin( string const & inputFileName );
};
class ZCollect: public ZBackupBase
{
ChunkStorage::Reader chunkStorageReader;
size_t threads;
public:
ZCollect( string const & storageDir, string const & password,
size_t threads, size_t cacheSize );
2014-07-14 00:11:01 +04:00
void gc();
2013-07-18 21:33:25 +04:00
};
class ZExchange
{
ZBackupBase srcZBackupBase;
ZBackupBase dstZBackupBase;
public:
ZExchange( string const & srcStorageDir, string const & srcPassword,
string const & dstStorageDir, string const & dstPassword,
bool prohibitChunkIndexLoading );
/// Exchanges the data between storages
void exchange( string const & srcFileName, string const & dstFileName,
bitset< BackupExchanger::Flags > const & exchange );
};
2013-07-18 21:33:25 +04:00
#endif