mirror of
https://github.com/Kitware/CMake.git
synced 2026-02-09 08:40:11 -06:00
cmUVStream: Remove unused cmUVPipeIStream
All clients have been ported to cmUVIStream.
This commit is contained in:
@@ -63,50 +63,6 @@ void cmBasicUVIStream<CharT, Traits>::close()
|
||||
|
||||
using cmUVIStream = cmBasicUVIStream<char>;
|
||||
|
||||
template <typename CharT, typename Traits = std::char_traits<CharT>>
|
||||
class cmBasicUVPipeIStream : public cmBasicUVIStream<CharT, Traits>
|
||||
{
|
||||
public:
|
||||
cmBasicUVPipeIStream();
|
||||
cmBasicUVPipeIStream(uv_loop_t& loop, int fd);
|
||||
|
||||
using cmBasicUVIStream<CharT, Traits>::is_open;
|
||||
|
||||
void open(uv_loop_t& loop, int fd);
|
||||
|
||||
void close();
|
||||
|
||||
private:
|
||||
cm::uv_pipe_ptr Pipe;
|
||||
};
|
||||
|
||||
template <typename CharT, typename Traits>
|
||||
cmBasicUVPipeIStream<CharT, Traits>::cmBasicUVPipeIStream() = default;
|
||||
|
||||
template <typename CharT, typename Traits>
|
||||
cmBasicUVPipeIStream<CharT, Traits>::cmBasicUVPipeIStream(uv_loop_t& loop,
|
||||
int fd)
|
||||
{
|
||||
this->open(loop, fd);
|
||||
}
|
||||
|
||||
template <typename CharT, typename Traits>
|
||||
void cmBasicUVPipeIStream<CharT, Traits>::open(uv_loop_t& loop, int fd)
|
||||
{
|
||||
this->Pipe.init(loop, 0);
|
||||
uv_pipe_open(this->Pipe, fd);
|
||||
this->cmBasicUVIStream<CharT, Traits>::open(this->Pipe);
|
||||
}
|
||||
|
||||
template <typename CharT, typename Traits>
|
||||
void cmBasicUVPipeIStream<CharT, Traits>::close()
|
||||
{
|
||||
this->cmBasicUVIStream<CharT, Traits>::close();
|
||||
this->Pipe.reset();
|
||||
}
|
||||
|
||||
using cmUVPipeIStream = cmBasicUVPipeIStream<char>;
|
||||
|
||||
class cmUVStreamReadHandle
|
||||
{
|
||||
private:
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user