mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-05-21 11:31:15 -03:00
Make io_data_t::io_mode const
A protected constructor is needed in io_pipe_t to let io_buffer_t override its io_mode.
This commit is contained in:
13
io.h
13
io.h
@@ -30,7 +30,7 @@ class io_data_t
|
||||
|
||||
public:
|
||||
/** Type of redirect */
|
||||
io_mode_t io_mode;
|
||||
const io_mode_t io_mode;
|
||||
/** FD to redirect */
|
||||
int fd;
|
||||
|
||||
@@ -99,6 +99,14 @@ class io_file_t : public io_data_t
|
||||
|
||||
class io_pipe_t : public io_data_t
|
||||
{
|
||||
protected:
|
||||
io_pipe_t(io_mode_t m, int f, bool i):
|
||||
io_data_t(m, f),
|
||||
pipe_fd(),
|
||||
is_input(i)
|
||||
{
|
||||
}
|
||||
|
||||
public:
|
||||
int pipe_fd[2];
|
||||
bool is_input;
|
||||
@@ -120,10 +128,9 @@ class io_buffer_t : public io_pipe_t
|
||||
std::vector<char> *out_buffer;
|
||||
|
||||
io_buffer_t(int f, bool i):
|
||||
io_pipe_t(f, i),
|
||||
io_pipe_t(IO_BUFFER, f, i),
|
||||
out_buffer(new std::vector<char>)
|
||||
{
|
||||
io_mode = IO_BUFFER;
|
||||
}
|
||||
|
||||
public:
|
||||
|
||||
Reference in New Issue
Block a user