feature(FileStream): Allow using Poco::FileStream to wrap arbitrary file handles/descriptors as C++ streams (#4424)

* Allow using Poco::FileStream to wrap arbitrary file handles/descriptors as C++ streams (#3444).

* Allow opening a file descriptor/HANDLE as C++ stream.

* FileStream: treat read from closed pipe as EOF.

* chore(Filestream): conde style (naming)

Co-Authored-By: Alex Fabijanic <alex@pocoproject.org>
Co-Authored-By: Matej Kenda <matejken@gmail.com>

* enh(FileStream): make FileIOS::open a virtual function. (#3444)

* test(FileStream): unit test for FileStream::openHandle (#3444)

* Update CONTRIBUTORS.

* test(FileStream): Win32 unit test fix.

* build(CMake): Require policy minimum version 3.15.

---------

Co-authored-by: Daniel Grunwald <grunwald@axivion.com>
Co-authored-by: Alex Fabijanic <alex@pocoproject.org>
This commit is contained in:
Matej Kenda
2024-05-08 11:53:43 +02:00
committed by GitHub
parent 1a0355f1b7
commit 065f9a0ff9
10 changed files with 131 additions and 13 deletions

View File

@@ -42,6 +42,9 @@ public:
void open(const std::string& path, std::ios::openmode mode);
/// Opens the given file in the given mode.
void openHandle(NativeHandle fd, std::ios::openmode mode);
/// Take ownership of the given file descriptor.
bool close();
/// Closes the File stream buffer. Returns true if successful,
/// false otherwise.