From d6111df5cbcd167b6849a99d7385746b7e3b17bf Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 25 Nov 2025 19:07:15 -0500 Subject: [PATCH] cmUVStream: Remove unused cmUVPipeIStream All clients have been ported to cmUVIStream. --- Source/cmUVStream.h | 44 ------------------------------ Tests/CMakeLib/testUVStreambuf.cxx | 11 +++++--- 2 files changed, 7 insertions(+), 48 deletions(-) diff --git a/Source/cmUVStream.h b/Source/cmUVStream.h index de1edf75eb..55b0ea38c5 100644 --- a/Source/cmUVStream.h +++ b/Source/cmUVStream.h @@ -63,50 +63,6 @@ void cmBasicUVIStream::close() using cmUVIStream = cmBasicUVIStream; -template > -class cmBasicUVPipeIStream : public cmBasicUVIStream -{ -public: - cmBasicUVPipeIStream(); - cmBasicUVPipeIStream(uv_loop_t& loop, int fd); - - using cmBasicUVIStream::is_open; - - void open(uv_loop_t& loop, int fd); - - void close(); - -private: - cm::uv_pipe_ptr Pipe; -}; - -template -cmBasicUVPipeIStream::cmBasicUVPipeIStream() = default; - -template -cmBasicUVPipeIStream::cmBasicUVPipeIStream(uv_loop_t& loop, - int fd) -{ - this->open(loop, fd); -} - -template -void cmBasicUVPipeIStream::open(uv_loop_t& loop, int fd) -{ - this->Pipe.init(loop, 0); - uv_pipe_open(this->Pipe, fd); - this->cmBasicUVIStream::open(this->Pipe); -} - -template -void cmBasicUVPipeIStream::close() -{ - this->cmBasicUVIStream::close(); - this->Pipe.reset(); -} - -using cmUVPipeIStream = cmBasicUVPipeIStream; - class cmUVStreamReadHandle { private: diff --git a/Tests/CMakeLib/testUVStreambuf.cxx b/Tests/CMakeLib/testUVStreambuf.cxx index d53eab34fe..a901ab2ad2 100644 --- a/Tests/CMakeLib/testUVStreambuf.cxx +++ b/Tests/CMakeLib/testUVStreambuf.cxx @@ -443,7 +443,7 @@ end: return success; } -bool testUVPipeIStream() +bool testUVIStream() { int pipe[] = { -1, -1 }; if (cmGetPipes(pipe) < 0) { @@ -464,8 +464,11 @@ bool testUVPipeIStream() buf.len = str.length(); uv_write(&writeReq, pipeSink, &buf, 1, nullptr); uv_run(loop, UV_RUN_DEFAULT); + cm::uv_pipe_ptr pipeSource; + pipeSource.init(*loop, 0); + uv_pipe_open(pipeSource, pipe[0]); - cmUVPipeIStream pin(*loop, pipe[0]); + cmUVIStream pin(pipeSource); std::string line; std::getline(pin, line); if (line != "Hello world!") { @@ -593,8 +596,8 @@ int testUVStreambuf(int argc, char** const argv) return -1; } - if (!testUVPipeIStream()) { - std::cout << "While executing testUVPipeIStream().\n"; + if (!testUVIStream()) { + std::cout << "While executing testUVIStream().\n"; return -1; }