1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 00:17:46 +00:00

Shell: Add create() factory function for PathRedirection

This commit is contained in:
Andreas Kling 2020-08-12 12:15:30 +02:00
parent e8d665337a
commit 85b02d887b
2 changed files with 11 additions and 5 deletions

View file

@ -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; }
};