mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 00:07:43 +00:00
Everywhere: Use AK_MAKE_DEFAULT_MOVABLE to avoid mistakes
This commit is contained in:
parent
2ebd79bc76
commit
0184fc5e43
4 changed files with 14 additions and 22 deletions
|
@ -612,14 +612,7 @@ enum class CycleDecision {
|
|||
// In most cases, just an input to sed. However, files are also written to when the -i option is used.
|
||||
class File {
|
||||
AK_MAKE_NONCOPYABLE(File);
|
||||
|
||||
File(LexicalPath input_file_path, NonnullOwnPtr<Core::InputBufferedFile>&& file, OwnPtr<Core::File>&& output, OwnPtr<FileSystem::TempFile>&& temp_file)
|
||||
: m_input_file_path(move(input_file_path))
|
||||
, m_file(move(file))
|
||||
, m_output(move(output))
|
||||
, m_output_temp_file(move(temp_file))
|
||||
{
|
||||
}
|
||||
AK_MAKE_DEFAULT_MOVABLE(File);
|
||||
|
||||
public:
|
||||
// Used for -i mode.
|
||||
|
@ -656,9 +649,6 @@ public:
|
|||
};
|
||||
}
|
||||
|
||||
File(File&&) = default;
|
||||
File& operator=(File&&) = default;
|
||||
|
||||
ErrorOr<bool> has_next() const
|
||||
{
|
||||
return m_file->can_read_line();
|
||||
|
@ -696,6 +686,14 @@ public:
|
|||
}
|
||||
|
||||
private:
|
||||
File(LexicalPath input_file_path, NonnullOwnPtr<Core::InputBufferedFile>&& file, OwnPtr<Core::File>&& output, OwnPtr<FileSystem::TempFile>&& temp_file)
|
||||
: m_input_file_path(move(input_file_path))
|
||||
, m_file(move(file))
|
||||
, m_output(move(output))
|
||||
, m_output_temp_file(move(temp_file))
|
||||
{
|
||||
}
|
||||
|
||||
LexicalPath m_input_file_path;
|
||||
NonnullOwnPtr<Core::InputBufferedFile> m_file;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue