20 #include "Directory.h" 21 #include "Filesystem.h" 22 #include "pedigree/kernel/utilities/Iterator.h" 23 #include "pedigree/kernel/utilities/Pair.h" 24 #include "pedigree/kernel/utilities/Result.h" 25 #include "pedigree/kernel/utilities/StringView.h" 26 #include "pedigree/kernel/utilities/Vector.h" 35 const String &name, Time::Timestamp accessedTime,
36 Time::Timestamp modifiedTime, Time::Timestamp creationTime, uintptr_t inode,
39 name, accessedTime, modifiedTime, creationTime, inode, pFs, size,
64 if (result.hasError())
70 return result.value().second()->get();
94 if (result.hasValue())
96 return result.value()->get();
105 if (result.hasValue())
121 "can't add directory entry for '" << name
122 <<
"' as it already exists.");
139 "can't add directory entry for '" << name
140 <<
"' as it already exists.");
190 for (
auto it : entries)
192 if (!getFilesystem()->
remove(
this, it))
207 if (!meta.pDirectory)
232 Directory::DirectoryEntryMetadata::DirectoryEntryMetadata()
233 : pDirectory(
nullptr), filename(), opaque()
236 Directory::DirectoryEntryMetadata::DirectoryEntryMetadata(
238 : pDirectory(pedigree_std::move(other.pDirectory)),
239 filename(pedigree_std::move(other.filename)),
240 opaque(pedigree_std::move(other.opaque))
242 other.pDirectory =
nullptr;
245 Directory::DirectoryEntryMetadata::~DirectoryEntryMetadata()
void pushBack(const T &value)
A vector / dynamic array.
void preallocateDirectoryEntries(size_t count)
void setReparsePoint(Directory *pTarget)
virtual File * convertToFile(const DirectoryEntryMetadata &meta)
bool remove(const StringView &path, File *pStartNode=0)
void addDirectoryEntry(const String &name, File *pTarget)
void reserve(size_t numItems)
bool insert(const K &k, const V &v)
Directory * m_ReparseTarget
LookupResult lookup(const K &k) const
void remove(const HashedStringView &s)
PairLookupResult getNth(size_t n) const
bool addEphemeralFile(File *pFile)
Add an ephemeral file to the directory.
File * getChild(size_t n)
File * lookup(const HashedStringView &s) const
Directory * getReparsePoint() const
Get the reparse point attached to this directory. Reparse points allow locations on the filesystem to...
virtual void cacheDirectoryContents()
DirectoryEntryCache m_Cache
static void destroyEntry(File *file)