Added CreateDirectory function to service/fs.cpp, and in Archive.

This commit is contained in:
archshift 2014-10-28 22:52:56 -07:00
parent 2ca12e7f38
commit 04c90c395d
8 changed files with 103 additions and 4 deletions

View file

@ -56,6 +56,13 @@ public:
*/
virtual std::unique_ptr<File> OpenFile(const std::string& path, const Mode mode) const = 0;
/**
* Create a directory specified by its path
* @param path Path relative to the archive
* @return Whether the directory could be created
*/
virtual bool CreateDirectory(const std::string& path) const = 0;
/**
* Open a directory specified by its path
* @param path Path relative to the archive

View file

@ -33,6 +33,16 @@ std::unique_ptr<File> Archive_RomFS::OpenFile(const std::string& path, const Mod
return std::unique_ptr<File>(new File_RomFS);
}
/**
* Create a directory specified by its path
* @param path Path relative to the archive
* @return Whether the directory could be created
*/
bool Archive_RomFS::CreateDirectory(const std::string& path) const {
ERROR_LOG(FILESYS, "Attempted to create a directory in ROMFS.");
return false;
};
/**
* Open a directory specified by its path
* @param path Path relative to the archive

View file

@ -36,6 +36,13 @@ public:
*/
std::unique_ptr<File> OpenFile(const std::string& path, const Mode mode) const override;
/**
* Create a directory specified by its path
* @param path Path relative to the archive
* @return Whether the directory could be created
*/
bool CreateDirectory(const std::string& path) const override;
/**
* Open a directory specified by its path
* @param path Path relative to the archive

View file

@ -57,6 +57,15 @@ std::unique_ptr<File> Archive_SDMC::OpenFile(const std::string& path, const Mode
return std::unique_ptr<File>(file);
}
/**
* Create a directory specified by its path
* @param path Path relative to the archive
* @return Whether the directory could be created
*/
bool Archive_SDMC::CreateDirectory(const std::string& path) const {
return FileUtil::CreateDir(GetMountPoint() + path);
}
/**
* Open a directory specified by its path
* @param path Path relative to the archive

View file

@ -40,6 +40,13 @@ public:
*/
std::unique_ptr<File> OpenFile(const std::string& path, const Mode mode) const override;
/**
* Create a directory specified by its path
* @param path Path relative to the archive
* @return Whether the directory could be created
*/
bool CreateDirectory(const std::string& path) const override;
/**
* Open a directory specified by its path
* @param path Path relative to the archive