summaryrefslogtreecommitdiff
path: root/Libraries
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-08-18 12:55:56 +0200
committerAndreas Kling <awesomekling@gmail.com>2019-08-18 12:55:56 +0200
commit8aa3b74f80fd321539e828cd106efba44926e5f6 (patch)
treeb841ef60783c0925f38c0dfec2c9b98776d4a148 /Libraries
parentdc572e31fa7f44319f01fc35f35df508e03beaba (diff)
downloadserenity-8aa3b74f80fd321539e828cd106efba44926e5f6.zip
LibCore: Make it possible to pass a parent to CFile constructors
Diffstat (limited to 'Libraries')
-rw-r--r--Libraries/LibCore/CFile.cpp5
-rw-r--r--Libraries/LibCore/CFile.h7
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; }