mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-02-26 17:47:19 +00:00
The current working directory is now stored as a custody. Likewise for a process executable file. This unbreaks /proc/PID/fd which has not been working since we made the filesystem bigger. This still needs a bunch of work, for instance when renaming or removing a file somewhere, we have to update the relevant custody links.
35 lines
776 B
C++
35 lines
776 B
C++
#pragma once
|
|
|
|
#include <AK/AKString.h>
|
|
#include <AK/RetainPtr.h>
|
|
#include <AK/Retainable.h>
|
|
|
|
class Inode;
|
|
|
|
class Custody : public Retainable<Custody> {
|
|
public:
|
|
static Retained<Custody> create(Custody* parent, const String& name, Inode& inode)
|
|
{
|
|
return adopt(*new Custody(parent, name, inode));
|
|
}
|
|
|
|
~Custody();
|
|
|
|
Custody* parent() { return m_parent.ptr(); }
|
|
const Custody* parent() const { return m_parent.ptr(); }
|
|
|
|
Inode& inode() { return *m_inode; }
|
|
const Inode& inode() const { return *m_inode; }
|
|
|
|
const String& name() const { return m_name; }
|
|
|
|
String absolute_path() const;
|
|
|
|
private:
|
|
Custody(Custody* parent, const String& name, Inode&);
|
|
|
|
RetainPtr<Custody> m_parent;
|
|
String m_name;
|
|
Retained<Inode> m_inode;
|
|
};
|