mirror of
				https://github.com/PabloMK7/citra.git
				synced 2025-11-03 23:28:48 +00:00 
			
		
		
		
	Added CreateDirectory function to service/fs.cpp, and in Archive.
This commit is contained in:
		
							parent
							
								
									2ca12e7f38
								
							
						
					
					
						commit
						04c90c395d
					
				
					 8 changed files with 103 additions and 4 deletions
				
			
		| 
						 | 
				
			
			@ -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
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue