mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 10:37:45 +00:00
HexEditor: Use the constructor pattern
This commit is contained in:
parent
a621b5f015
commit
b1d8404c92
3 changed files with 13 additions and 4 deletions
|
@ -70,10 +70,18 @@ bool HexDocumentMemory::write_to_file(NonnullRefPtr<Core::File> file)
|
|||
return true;
|
||||
}
|
||||
|
||||
ErrorOr<NonnullOwnPtr<HexDocumentFile>> HexDocumentFile::create(NonnullRefPtr<Core::File> file)
|
||||
{
|
||||
auto document = TRY(adopt_nonnull_own_or_enomem(new HexDocumentFile(move(file))));
|
||||
// FIXME: Remove this hackery
|
||||
document->set_file(move(document->m_file));
|
||||
|
||||
return document;
|
||||
}
|
||||
|
||||
HexDocumentFile::HexDocumentFile(NonnullRefPtr<Core::File> file)
|
||||
: m_file(file)
|
||||
{
|
||||
set_file(file);
|
||||
}
|
||||
|
||||
void HexDocumentFile::write_to_file()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue