forked from andreasbuhr/cppcoro
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathfile.hpp
More file actions
50 lines (39 loc) · 1.25 KB
/
Copy pathfile.hpp
File metadata and controls
50 lines (39 loc) · 1.25 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
///////////////////////////////////////////////////////////////////////////////
// Copyright (c) Lewis Baker
// Licenced under MIT license. See LICENSE.txt for details.
///////////////////////////////////////////////////////////////////////////////
#ifndef CPPCORO_FILE_HPP_INCLUDED
#define CPPCORO_FILE_HPP_INCLUDED
#include <cppcoro/config.hpp>
#include <cppcoro/filesystem.hpp>
#include <cppcoro/file_open_mode.hpp>
#include <cppcoro/file_share_mode.hpp>
#include <cppcoro/file_buffering_mode.hpp>
#include <cppcoro/detail/platform.hpp>
namespace cppcoro
{
class io_service;
class file
{
public:
file(const file& other) noexcept = delete;
file& operator=(const file& other) noexcept = delete;
file(file&& other) noexcept = default;
file& operator=(file&& other) noexcept = default;
virtual ~file();
/// Get the size of the file in bytes.
std::uint64_t size() const;
protected:
static file open(
int fileAccess,
io_service& ioService,
const std::filesystem::path& path,
file_open_mode openMode,
file_share_mode shareMode,
file_buffering_mode bufferingMode);
file(detail::safe_file_handle_t fileHandle, io_service* ioService);
detail::safe_file_handle_t m_fileHandle;
io_service* m_ioService;
};
}
#endif