LibCore: Make it possible to pass a parent to CFile constructors

This commit is contained in:
Andreas Kling 2019-08-18 12:55:56 +02:00
parent dc572e31fa
commit 8aa3b74f80
Notes: sideshowbarker 2024-07-19 12:36:49 +09:00
2 changed files with 8 additions and 4 deletions

View file

@ -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)
{
}

View file

@ -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; }