20 #ifndef ISO9660DIRECTORY_H 21 #define ISO9660DIRECTORY_H 23 #include "Iso9660File.h" 24 #include "Iso9660Filesystem.h" 26 #include "modules/system/vfs/Directory.h" 27 #include "pedigree/kernel/Log.h" 28 #include "pedigree/kernel/machine/Disk.h" 29 #include "pedigree/kernel/processor/types.h" 30 #include "pedigree/kernel/time/Time.h" 31 #include "pedigree/kernel/utilities/String.h" 32 #include "pedigree/kernel/utilities/utility.h" 48 Time::Timestamp modifiedTime = 0, Time::Timestamp creationTime = 0)
50 name, accessedTime, modifiedTime, creationTime, inode, pFs, 0,
52 m_pFs(pFs), m_Dir(dirRec)
61 ERROR(
"ISO9660: m_pFs is null!");
65 Disk *myDisk = m_pFs->getDisk();
74 String(
"."), m_Inode, m_pFs, m_pParent, m_Dir, m_AccessedTime,
75 m_ModifiedTime, m_CreationTime);
77 String(
".."), m_Inode, m_pFs, m_pParent, m_Dir, m_AccessedTime,
78 m_ModifiedTime, m_CreationTime);
86 String(
"."), m_Inode, m_pFs, m_pParent, m_Dir, m_AccessedTime,
87 m_ModifiedTime, m_CreationTime);
91 String(
".."), pParentDir->getInode(), pParentDir->m_pFs,
92 pParentDir->getParent(), pParentDir->getDirRecord(),
99 size_t dirSize = LITTLE_TO_HOST32(m_Dir.DataLen_LE);
100 size_t dirLoc = LITTLE_TO_HOST32(m_Dir.ExtentLocation_LE);
103 size_t numBlocks = (dirSize > 2048) ? dirSize / 2048 : 1;
105 for (i = 0; i < numBlocks; i++)
108 uintptr_t block = myDisk->
read((dirLoc + i) * 2048);
112 bool bLastHit =
false;
113 while (offset < 2048)
117 offset += record->RecLen;
118 uint8_t *fileIdent =
reinterpret_cast<uint8_t *
>(
119 adjust_pointer(record,
sizeof(*record)));
121 if (record->RecLen == 0)
126 else if (record->FileFlags & (1 << 0))
129 record->FileFlags & (1 << 1) && record->FileIdentLen == 1)
131 if (fileIdent[0] == 0 || fileIdent[0] == 1)
135 String fileName = m_pFs->parseName(*record);
138 Time::Timestamp unixTime = m_pFs->timeToUnix(record->Time);
139 if (record->FileFlags & (1 << 1))
142 fileName, 0, m_pFs,
this, *record, unixTime, unixTime,
149 fileName, unixTime, unixTime, unixTime, 0, m_pFs,
150 LITTLE_TO_HOST32(record->DataLen_LE), *record,
this);
156 if (bLastHit && ((i + 1) == numBlocks))
163 virtual bool addEntry(
String filename,
File *pFile,
size_t type)
168 virtual bool removeEntry(
File *pFile)
173 void fileAttributeChanged()
virtual void cacheDirectoryContents()
Iso9660File(const Iso9660File &)
Time::Timestamp getAccessedTime()
Time::Timestamp getCreationTime()
void addDirectoryEntry(const String &name, File *pTarget)
virtual uintptr_t read(uint64_t location)
Time::Timestamp getModifiedTime()
void markCachePopulated()