Filesystem metadata works on Brother 120.

This commit is contained in:
David Given
2022-08-31 21:33:51 +02:00
parent 34f034c6c4
commit a392b84d9b
2 changed files with 81 additions and 60 deletions

View File

@@ -39,10 +39,10 @@ public:
bool locked;
};
class Directory
class AcornDfsDirectory
{
public:
Directory(Filesystem* fs)
AcornDfsDirectory(Filesystem* fs)
{
auto sector0 = fs->getLogicalSector(0);
auto sector1 = fs->getLogicalSector(1);
@@ -89,7 +89,7 @@ public:
std::map<std::string, std::string> getMetadata()
{
Directory dir(this);
AcornDfsDirectory dir(this);
std::map<std::string, std::string> attributes;
attributes[VOLUME_NAME] = dir.volumeName;
@@ -108,7 +108,7 @@ public:
{
if (!path.empty())
throw FileNotFoundException();
Directory dir(this);
AcornDfsDirectory dir(this);
std::vector<std::unique_ptr<Dirent>> result;
for (auto& dirent : dir.dirents)
@@ -161,7 +161,7 @@ private:
if (path.size() != 1)
throw BadPathException();
Directory dir(this);
AcornDfsDirectory dir(this);
for (auto& dirent : dir.dirents)
{
if (dirent->filename == path[0])