cppcoro/include/cppcoro/file_buffering_mode.hpp
Lewis Baker 8cf10ce184 Add async file I/O support for Win32 platform.
- 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.
2017-05-27 21:26:59 +09:30

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