Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/windirstat/llfio.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNiall Douglas (s [underscore] sourceforge {at} nedprod [dot] com) <spamtrap@nedprod.com>2018-09-03 11:31:24 +0300
committerNiall Douglas (s [underscore] sourceforge {at} nedprod [dot] com) <spamtrap@nedprod.com>2018-09-03 11:31:24 +0300
commit13620554f4acb3cd939219d6fed6086877d1aaba (patch)
tree8512d5520b33798ac469ba1846a05c0c55483820 /include/llfio/v2.0/file_handle.hpp
parentc973446711c5005c5970ae3b51747a8d2c6aaf2f (diff)
Add a CI test checking for non-inline symbols in the header only build.
Relocate initialiser list io_handle read function into file_handle
Diffstat (limited to 'include/llfio/v2.0/file_handle.hpp')
-rw-r--r--include/llfio/v2.0/file_handle.hpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/include/llfio/v2.0/file_handle.hpp b/include/llfio/v2.0/file_handle.hpp
index de8386f0..87853483 100644
--- a/include/llfio/v2.0/file_handle.hpp
+++ b/include/llfio/v2.0/file_handle.hpp
@@ -237,6 +237,22 @@ public:
//! The i/o service this handle is attached to, if any
io_service *service() const noexcept { return _service; }
+ using io_handle::read;
+ //! Convenience initialiser list based overload for `read()`
+ LLFIO_MAKE_FREE_FUNCTION
+ io_result<size_type> read(extent_type offset, std::initializer_list<buffer_type> lst, deadline d = deadline()) noexcept
+ {
+ buffer_type *_reqs = reinterpret_cast<buffer_type *>(alloca(sizeof(buffer_type) * lst.size()));
+ memcpy(_reqs, lst.begin(), sizeof(buffer_type) * lst.size());
+ io_request<buffers_type> reqs(buffers_type(_reqs, lst.size()), offset);
+ auto ret = read(reqs, d);
+ if(ret)
+ {
+ return ret.bytes_transferred();
+ }
+ return ret.error();
+ }
+
/*! Return the current maximum permitted extent of the file.
\errors Any of the values POSIX fstat() or GetFileInformationByHandleEx() can return.
@@ -365,6 +381,11 @@ inline result<file_handle> temp_inode(const path_handle &dirh = path_discovery::
{
return file_handle::temp_inode(std::forward<decltype(dirh)>(dirh), std::forward<decltype(_mode)>(_mode), std::forward<decltype(flags)>(flags));
}
+//! \overload
+inline file_handle::io_result<file_handle::size_type> read(file_handle &self, file_handle::extent_type offset, std::initializer_list<file_handle::buffer_type> lst, deadline d = deadline()) noexcept
+{
+ return self.read(std::forward<decltype(offset)>(offset), std::forward<decltype(lst)>(lst), std::forward<decltype(d)>(d));
+}
/*! Return the current maximum permitted extent of the file.
\errors Any of the values POSIX fstat() or GetFileInformationByHandleEx() can return.