8cf10ce184
- Adds file, readable_file, writable_file, read_only_file, write_only_file and read_write_file classes. - Adds file_share_mode, file_open_mode, file_buffering_mode enums. - Supports async read/write but only synchronous open for now. - Removes support for VS 2015 since implementation makes use of std::optional which is only available in VS 2017.
33 lines
892 B
C++
33 lines
892 B
C++
///////////////////////////////////////////////////////////////////////////////
|
|
// Copyright (c) Lewis Baker
|
|
// Licenced under MIT license. See LICENSE.txt for details.
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
#ifndef CPPCORO_FILE_BUFFERING_MODE_HPP_INCLUDED
|
|
#define CPPCORO_FILE_BUFFERING_MODE_HPP_INCLUDED
|
|
|
|
namespace cppcoro
|
|
{
|
|
enum class file_buffering_mode
|
|
{
|
|
default_ = 0,
|
|
sequential = 1,
|
|
random_access = 2,
|
|
unbuffered = 4,
|
|
write_through = 8,
|
|
temporary = 16
|
|
};
|
|
|
|
constexpr file_buffering_mode operator&(file_buffering_mode a, file_buffering_mode b)
|
|
{
|
|
return static_cast<file_buffering_mode>(
|
|
static_cast<int>(a) & static_cast<int>(b));
|
|
}
|
|
|
|
constexpr file_buffering_mode operator|(file_buffering_mode a, file_buffering_mode b)
|
|
{
|
|
return static_cast<file_buffering_mode>(static_cast<int>(a) | static_cast<int>(b));
|
|
}
|
|
}
|
|
|
|
#endif
|