1 /**
2  * (c) 2019 by Mega Limited, Wellsford, New Zealand
3  *
4  * This file is part of the MEGA SDK - Client Access Engine.
5  *
6  * Applications using the MEGA API must present a valid application key
7  * and comply with the the rules set forth in the Terms of Service.
8  *
9  * The MEGA SDK is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12  *
13  * @copyright Simplified (2-clause) BSD License.
14  *
15  * You should have received a copy of the license along with this
16  * program.
17  */
18 
19 #pragma once
20 
21 #include <memory>
22 
23 #include <mega/megaclient.h>
24 #include <mega/node.h>
25 #include <mega/sync.h>
26 #include <mega/filefingerprint.h>
27 
28 namespace mt {
29 
30 class FsNode;
31 
32 mega::handle nextFsId();
33 
34 std::shared_ptr<mega::MegaClient> makeClient(mega::MegaApp& app, mega::FileSystemAccess& fsaccess);
35 
36 mega::Node& makeNode(mega::MegaClient& client, mega::nodetype_t type, mega::handle handle, mega::Node* parent = nullptr);
37 
38 #ifdef ENABLE_SYNC
39 std::unique_ptr<mega::Sync> makeSync(mega::MegaClient& client, const std::string& localname);
40 
41 std::unique_ptr<mega::LocalNode> makeLocalNode(mega::Sync& sync, mega::LocalNode& parent,
42                                                mega::nodetype_t type, const std::string& name,
43                                                const mega::FileFingerprint& ffp = {});
44 #endif
45 
46 void collectAllFsNodes(std::map<mega::LocalPath, const mt::FsNode*>& nodes, const mt::FsNode& node);
47 
48 std::uint16_t nextRandomInt();
49 
50 mega::byte nextRandomByte();
51 
52 } // mt
53