mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-08 02:31:18 -03:00
Make io_data_t pure virtual, its constructor protected
This commit is contained in:
2
io.cpp
2
io.cpp
@@ -51,7 +51,7 @@ Utilities for io redirection.
|
||||
#include "io.h"
|
||||
|
||||
|
||||
void io_data_t::print() const
|
||||
io_data_t::~io_data_t()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
31
io.h
31
io.h
@@ -10,7 +10,7 @@ using std::tr1::shared_ptr;
|
||||
*/
|
||||
enum io_mode_t
|
||||
{
|
||||
IO_INVALID, IO_FILE, IO_PIPE, IO_FD, IO_BUFFER, IO_CLOSE
|
||||
IO_FILE, IO_PIPE, IO_FD, IO_BUFFER, IO_CLOSE
|
||||
};
|
||||
|
||||
/** Represents an FD redirection */
|
||||
@@ -21,27 +21,26 @@ class io_data_t
|
||||
io_data_t(const io_data_t &rhs);
|
||||
void operator=(const io_data_t &rhs);
|
||||
|
||||
public:
|
||||
/** Type of redirect */
|
||||
io_mode_t io_mode;
|
||||
/** FD to redirect */
|
||||
int fd;
|
||||
|
||||
virtual void print() const;
|
||||
|
||||
/** Set to true if this is an input io redirection */
|
||||
bool is_input;
|
||||
|
||||
io_data_t(io_mode_t m = IO_INVALID, int f=0) :
|
||||
protected:
|
||||
io_data_t(io_mode_t m, int f) :
|
||||
io_mode(m),
|
||||
fd(f),
|
||||
is_input(0)
|
||||
{
|
||||
}
|
||||
|
||||
virtual ~io_data_t()
|
||||
{
|
||||
}
|
||||
public:
|
||||
/** Type of redirect */
|
||||
io_mode_t io_mode;
|
||||
/** FD to redirect */
|
||||
int fd;
|
||||
|
||||
virtual void print() const = 0;
|
||||
|
||||
/** Set to true if this is an input io redirection */
|
||||
bool is_input;
|
||||
|
||||
virtual ~io_data_t() = 0;
|
||||
};
|
||||
|
||||
class io_close_t : public io_data_t
|
||||
|
||||
Reference in New Issue
Block a user