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
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')
-rw-r--r--include/llfio/v2.0/detail/impl/posix/symlink_handle.ipp2
-rw-r--r--include/llfio/v2.0/file_handle.hpp21
-rw-r--r--include/llfio/v2.0/fs_handle.hpp2
-rw-r--r--include/llfio/v2.0/io_handle.hpp19
-rw-r--r--include/llfio/v2.0/symlink_handle.hpp2
5 files changed, 24 insertions, 22 deletions
diff --git a/include/llfio/v2.0/detail/impl/posix/symlink_handle.ipp b/include/llfio/v2.0/detail/impl/posix/symlink_handle.ipp
index 2233ec33..fba2832e 100644
--- a/include/llfio/v2.0/detail/impl/posix/symlink_handle.ipp
+++ b/include/llfio/v2.0/detail/impl/posix/symlink_handle.ipp
@@ -47,7 +47,7 @@ namespace detail
}
}
-result<void> symlink_handle::_create_symlink(const path_handle &dirh, const handle::path_type &filename, path_view target, deadline d, bool atomic_replace) noexcept
+LLFIO_HEADERS_ONLY_MEMFUNC_SPEC result<void> symlink_handle::_create_symlink(const path_handle &dirh, const handle::path_type &filename, path_view target, deadline d, bool atomic_replace) noexcept
{
std::chrono::steady_clock::time_point began_steady;
std::chrono::system_clock::time_point end_utc;
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.
diff --git a/include/llfio/v2.0/fs_handle.hpp b/include/llfio/v2.0/fs_handle.hpp
index ed4ef1f2..f3b816b6 100644
--- a/include/llfio/v2.0/fs_handle.hpp
+++ b/include/llfio/v2.0/fs_handle.hpp
@@ -197,7 +197,7 @@ public:
namespace detail
{
- extern LLFIO_DECL result<path_handle> containing_directory(optional<std::reference_wrapper<filesystem::path>> out_filename, const handle &h, const fs_handle &fsh, deadline d) noexcept;
+ LLFIO_HEADERS_ONLY_FUNC_SPEC result<path_handle> containing_directory(optional<std::reference_wrapper<filesystem::path>> out_filename, const handle &h, const fs_handle &fsh, deadline d) noexcept;
}
// BEGIN make_free_functions.py
diff --git a/include/llfio/v2.0/io_handle.hpp b/include/llfio/v2.0/io_handle.hpp
index ce17e4df..bd9d857a 100644
--- a/include/llfio/v2.0/io_handle.hpp
+++ b/include/llfio/v2.0/io_handle.hpp
@@ -305,20 +305,6 @@ public:
*/
LLFIO_MAKE_FREE_FUNCTION
LLFIO_HEADERS_ONLY_VIRTUAL_SPEC io_result<buffers_type> read(io_request<buffers_type> reqs, deadline d = deadline()) noexcept;
- //! \overload
- 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();
- }
/*! \brief Write data to the open handle.
@@ -569,11 +555,6 @@ inline io_handle::io_result<io_handle::buffers_type> read(io_handle &self, io_ha
{
return self.read(std::forward<decltype(reqs)>(reqs), std::forward<decltype(d)>(d));
}
-//! \overload
-inline io_handle::io_result<io_handle::size_type> read(io_handle &self, io_handle::extent_type offset, std::initializer_list<io_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));
-}
/*! \brief Write data to the open handle.
\warning Depending on the implementation backend, not all of the buffers input may be written and
diff --git a/include/llfio/v2.0/symlink_handle.hpp b/include/llfio/v2.0/symlink_handle.hpp
index 8b0f15ce..54543d89 100644
--- a/include/llfio/v2.0/symlink_handle.hpp
+++ b/include/llfio/v2.0/symlink_handle.hpp
@@ -85,7 +85,7 @@ class LLFIO_DECL symlink_handle : public handle, public fs_handle
#ifndef _WIN32
friend result<void> detail::stat_from_symlink(struct stat &s, const handle &h) noexcept;
- result<void> _create_symlink(const path_handle &dirh, const handle::path_type &filename, path_view target, deadline d, bool atomic_replace) noexcept;
+ LLFIO_HEADERS_ONLY_MEMFUNC_SPEC result<void> _create_symlink(const path_handle &dirh, const handle::path_type &filename, path_view target, deadline d, bool atomic_replace) noexcept;
#endif
public: