LeechCraft
0.6.70-16373-g319c272718
Modular cross-platform feature rich live environment.
Loading...
Searching...
No Matches
dumper.h
Go to the documentation of this file.
1
/**********************************************************************
2
* LeechCraft - modular cross-platform feature rich internet client.
3
* Copyright (C) 2006-2014 Georg Rudoy
4
*
5
* Distributed under the Boost Software License, Version 1.0.
6
* (See accompanying file LICENSE or copy at https://www.boost.org/LICENSE_1_0.txt)
7
**********************************************************************/
8
9
#pragma once
10
11
#include <variant>
12
#include <QProcess>
13
#include <QFuture>
14
#include "
dbconfig.h
"
15
16
namespace
LC::Util
17
{
18
class
UTIL_DB_API
Dumper
:
public
QObject
19
{
20
QProcess *
const
Dumper_;
21
QProcess *
const
Restorer_;
22
23
bool
HadError_ =
false
;
24
25
int
FinishedCount_ = 0;
26
public
:
27
struct
Finished
{};
28
struct
Error
29
{
30
QString
What_
;
31
32
explicit
Error
(QString str)
33
: What_ {
std
::move (str) }
34
{
35
}
36
};
37
using
Result_t
= std::variant<Finished, Error>;
38
private
:
39
QFutureInterface<Result_t>
Iface_;
40
public
:
41
Dumper
(
const
QString& from,
const
QString& to, QObject* =
nullptr
);
42
43
QFuture<Result_t>
GetFuture ();
44
private
:
45
void
HandleProcessFinished (QProcess*);
46
void
HandleProcessError (
const
QProcess*);
47
void
ReportResult (
const
Result_t
&);
48
};
49
}
LC::Util::Dumper
Definition
dumper.h:19
LC::Util::Dumper::Result_t
std::variant< Finished, Error > Result_t
Definition
dumper.h:37
QFuture
Definition
idownload.h:17
QFutureInterface
Definition
consistencychecker.h:20
dbconfig.h
UTIL_DB_API
#define UTIL_DB_API
Definition
dbconfig.h:16
LC::Util
Definition
icoreproxy.h:34
std
STL namespace.
LC::Util::Dumper::Error
Definition
dumper.h:29
LC::Util::Dumper::Error::What_
QString What_
Definition
dumper.h:30
LC::Util::Dumper::Error::Error
Error(QString str)
Definition
dumper.h:32
LC::Util::Dumper::Finished
Definition
dumper.h:27
src
util
db
dumper.h
Generated by
1.12.0