ladybird/Userland/Shell/Execution.h
Lenny Maiorani dd05934539 Shell: Use default constructors/destructors
https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#cother-other-default-operation-rules

"The compiler is more likely to get the default semantics right and
you cannot implement these functions better than the compiler."
2022-03-24 20:09:26 -07:00

46 lines
842 B
C++

/*
* Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include "Forward.h"
#include <AK/Forward.h>
#include <AK/NonnullRefPtrVector.h>
#include <AK/String.h>
#include <AK/Vector.h>
#include <LibCore/ElapsedTimer.h>
namespace Shell {
class FileDescriptionCollector {
public:
FileDescriptionCollector() = default;
~FileDescriptionCollector();
void collect();
void add(int fd);
private:
Vector<int, 32> m_fds;
};
class SavedFileDescriptors {
public:
SavedFileDescriptors(const NonnullRefPtrVector<AST::Rewiring>&);
~SavedFileDescriptors();
private:
struct SavedFileDescriptor {
int original { -1 };
int saved { -1 };
};
Vector<SavedFileDescriptor> m_saves;
FileDescriptionCollector m_collector;
};
}