25#ifndef MYSQL_HARNESS_STDX_FILE_HANDLE_INCLUDED
26#define MYSQL_HARNESS_STDX_FILE_HANDLE_INCLUDED
29#include <system_error>
86 return value() & other;
105 using dev_t = ::_dev_t;
106 using ino_t = ::_ino_t;
126 : handle_{
std::exchange(rhs.handle_, invalid_handle)},
127 devid_{
std::move(rhs.devid_)},
128 inode_{
std::move(rhs.inode_)},
129 caching_{
std::move(rhs.caching_)},
130 flags_{
std::move(rhs.flags_)} {}
133 if (handle_ != invalid_handle) {
155 return std::exchange(handle_, invalid_handle);
Definition: expected.h:944
Definition: filesystem.h:38
a type-safe flags type.
Definition: flags.h:115
Definition: file_handle.h:98
native_handle_type native_handle() const noexcept
Definition: file_handle.h:161
file_handle(const file_handle &)=delete
int native_handle_type
Definition: file_handle.h:103
::ino_t ino_t
Definition: file_handle.h:109
file_handle(file_handle &&rhs)
Definition: file_handle.h:125
caching caching_
Definition: file_handle.h:174
::dev_t dev_t
Definition: file_handle.h:108
ino_t st_ino() const noexcept
Definition: file_handle.h:164
dev_t devid_
Definition: file_handle.h:172
caching kernel_caching() const noexcept
Definition: file_handle.h:158
dev_t st_dev() const noexcept
Definition: file_handle.h:163
file_handle & operator=(const file_handle &)=delete
file_handle(native_handle_type h, dev_t devid, ino_t inode, caching caching=caching::none, flag flags=flag::none) noexcept
Definition: file_handle.h:114
flag flags() const noexcept
Definition: file_handle.h:159
~file_handle()
Definition: file_handle.h:132
flag flags_
Definition: file_handle.h:175
ino_t inode_
Definition: file_handle.h:173
Definition: file_handle.h:74
value_type value_
Definition: file_handle.h:90
constexpr flag(value_type v)
Definition: file_handle.h:81
constexpr value_type operator&(const value_type &other)
Definition: file_handle.h:85
uint64_t value_type
Definition: file_handle.h:76
static constexpr value_type none
Definition: file_handle.h:78
static constexpr value_type unlink_on_first_close
Definition: file_handle.h:79
constexpr value_type value() const noexcept
Definition: file_handle.h:83
Definition: file_handle.h:93
static int flags[50]
Definition: hp_test1.cc:40
static char * path
Definition: mysqldump.cc:137
stdx::expected< void, std::error_code > close(file_handle_type native_handle)
close file handle.
Definition: file.h:239
Definition: gcs_xcom_synode.h:64
stdx::expected< void, std::error_code > unlink(const char *path_name)
Definition: filesystem.cc:62
HARNESS_STDX_EXPORT path current_path()
get current path.
Definition: filesystem.cc:139
creation
Definition: file_handle.h:52
mode
Definition: file_handle.h:60
caching
Definition: file_handle.h:67
#define HARNESS_STDX_EXPORT
Definition: stdx_export.h:15