mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-14 05:53:59 +00: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:
parent
57ef5289fe
commit
a3b15b995e
1 changed files with 10 additions and 3 deletions
13
io.h
13
io.h
|
@ -30,7 +30,7 @@ protected:
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/** Type of redirect */
|
/** Type of redirect */
|
||||||
io_mode_t io_mode;
|
const io_mode_t io_mode;
|
||||||
/** FD to redirect */
|
/** FD to redirect */
|
||||||
int fd;
|
int fd;
|
||||||
|
|
||||||
|
@ -99,6 +99,14 @@ public:
|
||||||
|
|
||||||
class io_pipe_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:
|
public:
|
||||||
int pipe_fd[2];
|
int pipe_fd[2];
|
||||||
bool is_input;
|
bool is_input;
|
||||||
|
@ -120,10 +128,9 @@ private:
|
||||||
std::vector<char> *out_buffer;
|
std::vector<char> *out_buffer;
|
||||||
|
|
||||||
io_buffer_t(int f, bool i):
|
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>)
|
out_buffer(new std::vector<char>)
|
||||||
{
|
{
|
||||||
io_mode = IO_BUFFER;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
Loading…
Reference in a new issue