15 |
|
|
16 |
|
#include <menes-api/console.hpp> |
17 |
|
#include <menes-api/files.hpp> |
18 |
+ |
#include <menes-api/locks.hpp> |
19 |
|
#include <menes-api/path.hpp> |
20 |
+ |
#include <menes-api/threads.hpp> |
21 |
+ |
#include <menes-etl/fnbind.hpp> |
22 |
+ |
#include <menes-ext/scopes.hpp> |
23 |
+ |
#include <menes-ext/stack.hpp> |
24 |
|
#include <menes-ext/string.hpp> |
25 |
+ |
#include <menes-ext/threadset.hpp> |
26 |
|
#include <menes-ios/helpers.hpp> |
27 |
|
|
28 |
+ |
#include <queue> |
29 |
+ |
#include <utility> |
30 |
+ |
|
31 |
|
#include "Matcher/Matcher.hpp" |
32 |
|
|
33 |
|
#include "Error.hpp" |
36 |
|
{ |
37 |
|
Syncify(const ext::String& local, const ext::String& remote, const ext::String& pattern); |
38 |
|
~Syncify(); |
39 |
+ |
struct Transfer |
40 |
+ |
{ |
41 |
+ |
ext::String local, remote; |
42 |
+ |
Transfer() {} |
43 |
+ |
Transfer(const ext::String& local, const ext::String& remote) : local(local), remote(remote) {} |
44 |
+ |
}; |
45 |
|
static ext::String program; |
46 |
|
static bool debug; |
47 |
|
Matcher pattern; |
48 |
+ |
std::queue<Transfer> transfers; |
49 |
+ |
api::ThreadMutex transfersLock; |
50 |
+ |
bool transfering; |
51 |
+ |
ext::ThreadPool<> transferers; |
52 |
|
void syncify(const api::Path& local, const ext::String& remote); |
53 |
+ |
int transfer(); |
54 |
|
}; |
55 |
|
|
56 |
|
#endif//_Syncify_hpp_ |