mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 09:57:35 +00:00
Shell: Add create() factory function for PathRedirection
This commit is contained in:
parent
e8d665337a
commit
85b02d887b
2 changed files with 11 additions and 5 deletions
|
@ -109,8 +109,15 @@ struct PathRedirection : public Redirection {
|
|||
ReadWrite,
|
||||
} direction { Read };
|
||||
|
||||
static NonnullRefPtr<PathRedirection> create(String path, int fd, decltype(direction) direction)
|
||||
{
|
||||
return adopt(*new PathRedirection(move(path), fd, direction));
|
||||
}
|
||||
|
||||
virtual Result<NonnullRefPtr<Rewiring>, String> apply() const override;
|
||||
virtual ~PathRedirection();
|
||||
|
||||
private:
|
||||
PathRedirection(String path, int fd, decltype(direction) direction)
|
||||
: path(move(path))
|
||||
, fd(fd)
|
||||
|
@ -118,7 +125,6 @@ struct PathRedirection : public Redirection {
|
|||
{
|
||||
}
|
||||
|
||||
private:
|
||||
virtual bool is_path_redirection() const override { return true; }
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue