From a6155ae9bfd0f990175012f74357d89f793e73bc Mon Sep 17 00:00:00 2001 From: Mika Fischer Date: Tue, 21 Jan 2020 10:00:49 +0100 Subject: [PATCH] Add accessor function to File member of basic_file_body: fix #1260 close #1814 --- CHANGELOG.md | 1 + include/boost/beast/http/basic_file_body.hpp | 6 ++++++ include/boost/beast/http/impl/file_body_win32.hpp | 5 +++++ 3 files changed, 12 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7e416758..f34026af 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ Version 283: * ostream_buffer satisfies preconditions of DynamicBuffer_v1::commit +* Add accessor function to File member of basic_file_body Version 282: diff --git a/include/boost/beast/http/basic_file_body.hpp b/include/boost/beast/http/basic_file_body.hpp index 9d42c9cc..01eae3c1 100644 --- a/include/boost/beast/http/basic_file_body.hpp +++ b/include/boost/beast/http/basic_file_body.hpp @@ -111,6 +111,12 @@ public: /// Move assignment value_type& operator=(value_type&& other) = default; + /// Return the file + File& file() + { + return file_; + } + /// Returns `true` if the file is open bool is_open() const diff --git a/include/boost/beast/http/impl/file_body_win32.hpp b/include/boost/beast/http/impl/file_body_win32.hpp index e42be7f0..a2cc661f 100644 --- a/include/boost/beast/http/impl/file_body_win32.hpp +++ b/include/boost/beast/http/impl/file_body_win32.hpp @@ -78,6 +78,11 @@ struct basic_file_body value_type(value_type&& other) = default; value_type& operator=(value_type&& other) = default; + file_win32& file() + { + return file_; + } + bool is_open() const {