25#ifndef MYSQL_HARNESS_STDX_FILE_HANDLE_INCLUDED
26#define MYSQL_HARNESS_STDX_FILE_HANDLE_INCLUDED
30#include <system_error>
87 return value() & other;
106 using dev_t = ::_dev_t;
107 using ino_t = ::_ino_t;
127 : handle_{
std::exchange(rhs.handle_, invalid_handle)},
128 devid_{
std::move(rhs.devid_)},
129 inode_{
std::move(rhs.inode_)},
130 caching_{
std::move(rhs.caching_)},
131 flags_{
std::move(rhs.flags_)} {}
134 if (handle_ != invalid_handle) {
156 return std::exchange(handle_, invalid_handle);
Definition: expected.h:284
Definition: filesystem.h:38
a type-safe flags type.
Definition: flags.h:115
Definition: file_handle.h:99
native_handle_type native_handle() const noexcept
Definition: file_handle.h:162
file_handle(const file_handle &)=delete
int native_handle_type
Definition: file_handle.h:104
::ino_t ino_t
Definition: file_handle.h:110
file_handle(file_handle &&rhs)
Definition: file_handle.h:126
caching caching_
Definition: file_handle.h:175
::dev_t dev_t
Definition: file_handle.h:109
ino_t st_ino() const noexcept
Definition: file_handle.h:165
dev_t devid_
Definition: file_handle.h:173
caching kernel_caching() const noexcept
Definition: file_handle.h:159
dev_t st_dev() const noexcept
Definition: file_handle.h:164
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:115
flag flags() const noexcept
Definition: file_handle.h:160
~file_handle()
Definition: file_handle.h:133
flag flags_
Definition: file_handle.h:176
ino_t inode_
Definition: file_handle.h:174
Definition: file_handle.h:75
value_type value_
Definition: file_handle.h:91
constexpr flag(value_type v)
Definition: file_handle.h:82
constexpr value_type operator&(const value_type &other)
Definition: file_handle.h:86
uint64_t value_type
Definition: file_handle.h:77
static constexpr value_type none
Definition: file_handle.h:79
static constexpr value_type unlink_on_first_close
Definition: file_handle.h:80
constexpr value_type value() const noexcept
Definition: file_handle.h:84
Definition: file_handle.h:94
static int flags[50]
Definition: hp_test1.cc:40
static char * path
Definition: mysqldump.cc:149
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:53
mode
Definition: file_handle.h:61
caching
Definition: file_handle.h:68
#define HARNESS_STDX_EXPORT
Definition: stdx_export.h:15