Extract wxPipeInputStream and wxPipeOutputStream in a header.
No real changes, just put these classes in a private header. They're still not part of the public API but at least it will be easier to reuse them inside the library itself in the upcoming commits. See #10258. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74336 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
38
include/wx/unix/private/pipestream.h
Normal file
38
include/wx/unix/private/pipestream.h
Normal file
@@ -0,0 +1,38 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/unix/private/pipestream.h
|
||||
// Purpose: Unix wxPipeInputStream and wxPipeOutputStream declarations
|
||||
// Author: Vadim Zeitlin
|
||||
// Created: 2013-06-08 (extracted from wx/unix/pipe.h)
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) 2013 Vadim Zeitlin <vadim@wxwidgets.org>
|
||||
// Licence: wxWindows licence
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_UNIX_PRIVATE_PIPESTREAM_H_
|
||||
#define _WX_UNIX_PRIVATE_PIPESTREAM_H_
|
||||
|
||||
#include "wx/wfstream.h"
|
||||
|
||||
class wxPipeInputStream : public wxFileInputStream
|
||||
{
|
||||
public:
|
||||
wxEXPLICIT wxPipeInputStream(int fd) : wxFileInputStream(fd) { }
|
||||
|
||||
// return true if the pipe is still opened
|
||||
bool IsOpened() const { return !Eof(); }
|
||||
|
||||
// return true if we have anything to read, don't block
|
||||
virtual bool CanRead() const;
|
||||
};
|
||||
|
||||
class wxPipeOutputStream : public wxFileOutputStream
|
||||
{
|
||||
public:
|
||||
wxPipeOutputStream(int fd) : wxFileOutputStream(fd) { }
|
||||
|
||||
// Override the base class version to ignore "pipe full" errors: this is
|
||||
// not an error for this class.
|
||||
size_t OnSysWrite(const void *buffer, size_t size);
|
||||
};
|
||||
|
||||
#endif // _WX_UNIX_PRIVATE_PIPESTREAM_H_
|
Reference in New Issue
Block a user