Fix building NativeFileStream with libc++

Note: std::iostream has no default c'tor according to
the standard (although a protected default c'tor is
provided by libstdc++).
sendfile
Martchus 4 years ago
parent 8e32fc0229
commit 7b04bd8ef5
  1. 8
      io/nativefilestream.cpp
  2. 2
      io/nativefilestream.h

@ -132,19 +132,19 @@ struct NativeFileParams {
* \brief Constructs a new NativeFileStream which is initially closed.
*/
NativeFileStream::NativeFileStream()
: m_filebuf(make_unique<StreamBuffer>())
: iostream(new StreamBuffer)
, m_filebuf(rdbuf())
{
init(m_filebuf.get());
}
/*!
* \brief Moves the NativeFileStream.
*/
NativeFileStream::NativeFileStream(NativeFileStream &&other)
: m_filebuf(std::move(other.m_filebuf))
: iostream(other.m_filebuf.release())
, m_filebuf(rdbuf())
, m_fileHandle(other.m_fileHandle)
{
init(m_filebuf.get());
}
/*!

@ -44,11 +44,13 @@ private:
};
inline NativeFileStream::NativeFileStream(const std::string &path, ios_base::openmode openMode)
: NativeFileStream()
{
open(path, openMode);
}
inline NativeFileStream::NativeFileStream(int fileDescriptor, ios_base::openmode openMode)
: NativeFileStream()
{
openFromFileDescriptor(fileDescriptor, openMode);
}

Loading…
Cancel
Save