diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-08-18 12:55:56 +0200 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-08-18 12:55:56 +0200 |
commit | 8aa3b74f80fd321539e828cd106efba44926e5f6 (patch) | |
tree | b841ef60783c0925f38c0dfec2c9b98776d4a148 /Libraries | |
parent | dc572e31fa7f44319f01fc35f35df508e03beaba (diff) | |
download | serenity-8aa3b74f80fd321539e828cd106efba44926e5f6.zip |
LibCore: Make it possible to pass a parent to CFile constructors
Diffstat (limited to 'Libraries')
-rw-r--r-- | Libraries/LibCore/CFile.cpp | 5 | ||||
-rw-r--r-- | Libraries/LibCore/CFile.h | 7 |
2 files changed, 8 insertions, 4 deletions
diff --git a/Libraries/LibCore/CFile.cpp b/Libraries/LibCore/CFile.cpp index 09d209d4b4..38b5b75a0c 100644 --- a/Libraries/LibCore/CFile.cpp +++ b/Libraries/LibCore/CFile.cpp @@ -4,8 +4,9 @@ #include <stdio.h> #include <unistd.h> -CFile::CFile(const StringView& filename) - : m_filename(filename) +CFile::CFile(const StringView& filename, CObject* parent) + : CIODevice(parent) + , m_filename(filename) { } diff --git a/Libraries/LibCore/CFile.h b/Libraries/LibCore/CFile.h index cabf7abb14..491aa16c94 100644 --- a/Libraries/LibCore/CFile.h +++ b/Libraries/LibCore/CFile.h @@ -6,8 +6,11 @@ class CFile final : public CIODevice { C_OBJECT(CFile) public: - CFile() {} - explicit CFile(const StringView&); + CFile(CObject* parent = nullptr) + : CIODevice(parent) + { + } + explicit CFile(const StringView&, CObject* parent = nullptr); virtual ~CFile() override; String filename() const { return m_filename; } |