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
54 lines (43 loc) · 1.08 KB
/
FileIncoming.h
File metadata and controls
54 lines (43 loc) · 1.08 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
54
#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;
public:
FileIncoming() = default;
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;
FileIncoming &operator =(const FileIncoming &) = 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
);
}