forked from awwit/httpserver
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFileIncoming.cpp
More file actions
36 lines (26 loc) · 762 Bytes
/
FileIncoming.cpp
File metadata and controls
36 lines (26 loc) · 762 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
#include "FileIncoming.h"
#include <fstream>
namespace HttpServer
{
FileIncoming::FileIncoming(const std::string &fileName, const std::string &fileType, const size_t fileSize)
: file_name(fileName), file_type(fileType), file_size(fileSize)
{
}
FileIncoming::FileIncoming(const FileIncoming &obj)
: file_name(obj.file_name), file_type(obj.file_type), file_size(obj.file_size)
{
}
FileIncoming::FileIncoming(FileIncoming &&obj)
: file_name(std::move(obj.file_name) ), file_type(std::move(obj.file_type) ), file_size(obj.file_size)
{
obj.file_size = 0;
}
bool FileIncoming::isExists() const
{
std::ifstream file(file_name, std::ifstream::binary);
const bool is_exists = file.good();
file.close();
return is_exists;
}
};