mirror of
				https://github.com/PabloMK7/citra.git
				synced 2025-11-04 07:38:47 +00:00 
			
		
		
		
	Archives: Reduced duplicate code in RomFS and SaveCheck.
Fixed a few warnings and cleaned up the code
This commit is contained in:
		
							parent
							
								
									13efbdc201
								
							
						
					
					
						commit
						aade417b14
					
				
					 17 changed files with 242 additions and 341 deletions
				
			
		| 
						 | 
				
			
			@ -14,6 +14,7 @@
 | 
			
		|||
#include "core/file_sys/archive_extsavedata.h"
 | 
			
		||||
#include "core/file_sys/archive_romfs.h"
 | 
			
		||||
#include "core/file_sys/archive_savedata.h"
 | 
			
		||||
#include "core/file_sys/archive_savedatacheck.h"
 | 
			
		||||
#include "core/file_sys/archive_sdmc.h"
 | 
			
		||||
#include "core/file_sys/directory_backend.h"
 | 
			
		||||
#include "core/hle/service/fs/archive.h"
 | 
			
		||||
| 
						 | 
				
			
			@ -353,7 +354,7 @@ ResultCode DeleteDirectoryFromArchive(ArchiveHandle archive_handle, const FileSy
 | 
			
		|||
                      ErrorSummary::Canceled, ErrorLevel::Status);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
ResultCode CreateFileInArchive(Handle archive_handle, const FileSys::Path& path, u32 file_size) {
 | 
			
		||||
ResultCode CreateFileInArchive(ArchiveHandle archive_handle, const FileSys::Path& path, u32 file_size) {
 | 
			
		||||
    Archive* archive = GetArchive(archive_handle);
 | 
			
		||||
    if (archive == nullptr)
 | 
			
		||||
        return InvalidHandle(ErrorModule::FS);
 | 
			
		||||
| 
						 | 
				
			
			@ -463,8 +464,8 @@ void ArchiveInit() {
 | 
			
		|||
                  sharedextsavedata_directory.c_str());
 | 
			
		||||
 | 
			
		||||
    // Create the SaveDataCheck archive, basically a small variation of the RomFS archive
 | 
			
		||||
    std::string savedatacheck_directory = FileUtil::GetUserPath(D_SAVEDATA_IDX) + "../savedatacheck/";
 | 
			
		||||
    auto savedatacheck_archive = Common::make_unique<FileSys::Archive_RomFS>(savedatacheck_directory);
 | 
			
		||||
    std::string savedatacheck_directory = FileUtil::GetUserPath(D_SAVEDATACHECK_IDX);
 | 
			
		||||
    auto savedatacheck_archive = Common::make_unique<FileSys::Archive_SaveDataCheck>(savedatacheck_directory);
 | 
			
		||||
    CreateArchive(std::move(savedatacheck_archive), ArchiveIdCode::SaveDataCheck);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -91,7 +91,7 @@ ResultCode DeleteDirectoryFromArchive(ArchiveHandle archive_handle, const FileSy
 | 
			
		|||
 * @param file_size The size of the new file, filled with zeroes
 | 
			
		||||
 * @return File creation result code
 | 
			
		||||
 */
 | 
			
		||||
ResultCode CreateFileInArchive(Handle archive_handle, const FileSys::Path& path, u32 file_size);
 | 
			
		||||
ResultCode CreateFileInArchive(ArchiveHandle archive_handle, const FileSys::Path& path, u32 file_size);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Create a Directory from an Archive
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue