forked from JanuszBedkowski/mandeye_controller
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFileSystemClient.h
More file actions
53 lines (39 loc) · 1.17 KB
/
FileSystemClient.h
File metadata and controls
53 lines (39 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#pragma once
#include <deque>
#include <json.hpp>
#include <mutex>
#include <string>
namespace mandeye
{
class FileSystemClient
{
constexpr static char manifestFilename[]{"mandala_manifest.txt"};
constexpr static char config[]{"mandeye_config.json"};
constexpr static char versionFilename[]{"version.txt"};
public:
FileSystemClient(const std::string& repository);
nlohmann::json produceStatus();
//! Test is writable
float CheckAvailableSpace();
//! Create Counter file
int32_t GetIdFromManifest();
//! Create Counter file
int32_t GetNextIdFromManifest();
//! Get is writable
bool GetIsWritable();
std::vector<std::string> GetDirectories();
bool CreateDirectoryForContinousScanning(std::string &, const int &);
bool CreateDirectoryForStopScans(std::string &, int &id_manifest);
double BenchmarkWriteSpeed(const std::string& filename, size_t fileSizeMB);
nlohmann::json GetConfig();
private:
int32_t m_nextId{0};
std::string ConvertToText(float mb);
std::string m_repository;
std::string m_currentContinousScanDirectory;
std::string m_currentStopScanDirectory;
std::string m_error;
std::mutex m_mutex;
double m_benchmarkWriteSpeed{-1.f};
};
} // namespace mandeye