summaryrefslogtreecommitdiff
path: root/boost/beast/core/file_posix.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'boost/beast/core/file_posix.hpp')
-rw-r--r--boost/beast/core/file_posix.hpp24
1 files changed, 21 insertions, 3 deletions
diff --git a/boost/beast/core/file_posix.hpp b/boost/beast/core/file_posix.hpp
index 65bac2065d..b7a70a54ae 100644
--- a/boost/beast/core/file_posix.hpp
+++ b/boost/beast/core/file_posix.hpp
@@ -1,5 +1,5 @@
//
-// Copyright (c) 2015-2016 Vinnie Falco (vinnie dot falco at gmail dot com)
+// Copyright (c) 2015-2019 Vinnie Falco (vinnie dot falco at gmail dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -10,7 +10,7 @@
#ifndef BOOST_BEAST_CORE_FILE_POSIX_HPP
#define BOOST_BEAST_CORE_FILE_POSIX_HPP
-#include <boost/config.hpp>
+#include <boost/beast/core/detail/config.hpp>
#if ! defined(BOOST_BEAST_NO_POSIX_FILE)
# if ! defined(__APPLE__) && ! defined(__linux__)
@@ -37,12 +37,17 @@ namespace beast {
/** An implementation of File for POSIX systems.
- This class implements a @b File using POSIX interfaces.
+ This class implements a <em>File</em> using POSIX interfaces.
*/
class file_posix
{
int fd_ = -1;
+ BOOST_BEAST_DECL
+ static
+ int
+ native_close(int& fd);
+
public:
/** The type of the underlying file handle.
@@ -54,6 +59,7 @@ public:
If the file is open it is first closed.
*/
+ BOOST_BEAST_DECL
~file_posix();
/** Constructor
@@ -66,12 +72,14 @@ public:
The moved-from object behaves as if default constructed.
*/
+ BOOST_BEAST_DECL
file_posix(file_posix&& other);
/** Assignment
The moved-from object behaves as if default constructed.
*/
+ BOOST_BEAST_DECL
file_posix& operator=(file_posix&& other);
/// Returns the native handle associated with the file.
@@ -87,6 +95,7 @@ public:
@param fd The native file handle to assign.
*/
+ BOOST_BEAST_DECL
void
native_handle(native_handle_type fd);
@@ -101,6 +110,7 @@ public:
@param ec Set to the error, if any occurred.
*/
+ BOOST_BEAST_DECL
void
close(error_code& ec);
@@ -112,6 +122,7 @@ public:
@param ec Set to the error, if any occurred
*/
+ BOOST_BEAST_DECL
void
open(char const* path, file_mode mode, error_code& ec);
@@ -121,6 +132,7 @@ public:
@return The size in bytes
*/
+ BOOST_BEAST_DECL
std::uint64_t
size(error_code& ec) const;
@@ -130,6 +142,7 @@ public:
@return The offset in bytes from the beginning of the file
*/
+ BOOST_BEAST_DECL
std::uint64_t
pos(error_code& ec) const;
@@ -139,6 +152,7 @@ public:
@param ec Set to the error, if any occurred
*/
+ BOOST_BEAST_DECL
void
seek(std::uint64_t offset, error_code& ec);
@@ -150,6 +164,7 @@ public:
@param ec Set to the error, if any occurred
*/
+ BOOST_BEAST_DECL
std::size_t
read(void* buffer, std::size_t n, error_code& ec) const;
@@ -161,6 +176,7 @@ public:
@param ec Set to the error, if any occurred
*/
+ BOOST_BEAST_DECL
std::size_t
write(void const* buffer, std::size_t n, error_code& ec);
};
@@ -168,7 +184,9 @@ public:
} // beast
} // boost
+#ifdef BOOST_BEAST_HEADER_ONLY
#include <boost/beast/core/impl/file_posix.ipp>
+#endif
#endif