forked from awwit/httpserver
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFileIncoming.h
More file actions
40 lines (32 loc) · 1018 Bytes
/
FileIncoming.h
File metadata and controls
40 lines (32 loc) · 1018 Bytes
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
#pragma once
#include <string>
#include <vector>
#include <unordered_map>
namespace Transfer
{
class FileIncoming
{
protected:
std::string file_tmp_name;
std::string file_name;
std::string file_type;
size_t file_size;
private:
FileIncoming() = delete;
public:
FileIncoming(std::string &&fileTmpName, std::string &&fileName, std::string &&fileType, const size_t fileSize) noexcept;
FileIncoming(const FileIncoming &obj);
FileIncoming(FileIncoming &&obj) noexcept;
~FileIncoming() noexcept = default;
const std::string &getTmpName() const noexcept;
const std::string &getName() const noexcept;
const std::string &getType() const noexcept;
size_t getSize() const noexcept;
bool isExists() const noexcept;
};
}
namespace Utils
{
void packFilesIncoming(std::vector<char> &buf, const std::unordered_multimap<std::string, Transfer::FileIncoming> &map);
const uint8_t *unpackFilesIncoming(std::unordered_multimap<std::string, Transfer::FileIncoming> &map, const uint8_t *src);
}