summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/filesystem/filesystem.cpp (follow)
Commit message (Collapse)AuthorAgeFilesLines
* core: Replace all instances of ResultCode with Resultgerman772022-06-271-15/+14
|
* general: Convert source file copyright comments over to SPDXMorph2022-04-231-3/+2
| | | | | This formats all copyright comments according to SPDX formatting guidelines. Additionally, this resolves the remaining GPLv2 only licensed files by relicensing them to GPLv2.0-or-later.
* fix: typosAndrea Pappacoda2022-04-021-1/+1
|
* general: Get the current process program id directly from the systemMorph2021-11-041-3/+2
| | | | This allows us to avoid including KProcess' header file in files that only need to get the current process' program id.
* general: Rename GetTitleID to GetProgramIDMorph2021-11-041-2/+2
|
* core: Remove unused includesameerj2021-11-041-1/+0
|
* general: Remove MakeResult helpersMorph2021-11-021-11/+10
| | | | This is made obsolete by the presence of implicit constructors.
* vfs: Partially implement GetFileTimeStampRawMorph2021-09-141-0/+12
| | | | Gets rid of homebrew warnings using this func
* FS: Mark recursive CreateDirectory as inaccurate and temporaryMorph2021-09-121-0/+5
|
* Addressed issuesChloe2021-09-081-1/+1
| | | Co-authored-by: Mai M. <mathew1800@gmail.com>
* FS: Recursively create directories for CreateDirectoryChloe Marcec2021-09-061-8/+13
| | | | | | Originally we only created the parent directory, this caused issues for creating directories which also contained subdirectories, eg `/Folder1/Folder2` This allows the ultimate mod manager homebrew to at least boot
* filesystem: Open a read-only directory for SDMC modsMorph2021-06-281-5/+9
| | | | This prevents mod files from being locked due to the read-only share flag in Windows.
* core: Simplify SDMC mod loadinglat9nq2021-06-281-1/+2
| | | | | | | | | | If someone else wants to support other mod formats in the SDMC directory, that can be added later. For now, just allow RomFS modding here and force people to do other types of mods the old way. Addresses review comments. Co-authored-by: LC <mathew1800@gmail.com>
* core: Support LayeredFS mod from SDMC directorylat9nq2021-06-281-0/+9
| | | | | | Enables loading a mod directly from `[yuzu data directory]/sdmc/atmosphere/contents/[title_id]`. For use with some homebrew mod managers.
* fspsrv: Implement DisableAutoSaveDataCreation (#6355)Chloe2021-06-031-0/+4
| | | - Used by Mii Edit
* general: Replace RESULT_UNKNOWN with ResultUnknownMorph2021-06-021-15/+15
| | | | Transition to PascalCase for result names.
* general: Replace RESULT_SUCCESS with ResultSuccessMorph2021-06-021-16/+16
| | | | Transition to PascalCase for result names.
* common: fs: Rework the Common Filesystem interface to make use of std::filesystem (#6270)Morph2021-05-261-9/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * common: fs: fs_types: Create filesystem types Contains various filesystem types used by the Common::FS library * common: fs: fs_util: Add std::string to std::u8string conversion utility * common: fs: path_util: Add utlity functions for paths Contains various utility functions for getting or manipulating filesystem paths used by the Common::FS library * common: fs: file: Rewrite the IOFile implementation * common: fs: Reimplement Common::FS library using std::filesystem * common: fs: fs_paths: Add fs_paths to replace common_paths * common: fs: path_util: Add the rest of the path functions * common: Remove the previous Common::FS implementation * general: Remove unused fs includes * string_util: Remove unused function and include * nvidia_flags: Migrate to the new Common::FS library * settings: Migrate to the new Common::FS library * logging: backend: Migrate to the new Common::FS library * core: Migrate to the new Common::FS library * perf_stats: Migrate to the new Common::FS library * reporter: Migrate to the new Common::FS library * telemetry_session: Migrate to the new Common::FS library * key_manager: Migrate to the new Common::FS library * bis_factory: Migrate to the new Common::FS library * registered_cache: Migrate to the new Common::FS library * xts_archive: Migrate to the new Common::FS library * service: acc: Migrate to the new Common::FS library * applets/profile: Migrate to the new Common::FS library * applets/web: Migrate to the new Common::FS library * service: filesystem: Migrate to the new Common::FS library * loader: Migrate to the new Common::FS library * gl_shader_disk_cache: Migrate to the new Common::FS library * nsight_aftermath_tracker: Migrate to the new Common::FS library * vulkan_library: Migrate to the new Common::FS library * configure_debug: Migrate to the new Common::FS library * game_list_worker: Migrate to the new Common::FS library * config: Migrate to the new Common::FS library * configure_filesystem: Migrate to the new Common::FS library * configure_per_game_addons: Migrate to the new Common::FS library * configure_profile_manager: Migrate to the new Common::FS library * configure_ui: Migrate to the new Common::FS library * input_profiles: Migrate to the new Common::FS library * yuzu_cmd: config: Migrate to the new Common::FS library * yuzu_cmd: Migrate to the new Common::FS library * vfs_real: Migrate to the new Common::FS library * vfs: Migrate to the new Common::FS library * vfs_libzip: Migrate to the new Common::FS library * service: bcat: Migrate to the new Common::FS library * yuzu: main: Migrate to the new Common::FS library * vfs_real: Delete the contents of an existing file in CreateFile Current usages of CreateFile expect to delete the contents of an existing file, retain this behavior for now. * input_profiles: Don't iterate the input profile dir if it does not exist Silences an error produced in the log if the directory does not exist. * game_list_worker: Skip parsing file if the returned VfsFile is nullptr Prevents crashes in GetLoader when the virtual file is nullptr * common: fs: Validate paths for path length * service: filesystem: Open the mod load directory as read only
* hle: kernel: Rename Process to KProcess.bunnei2021-05-061-1/+1
|
* service: filesystem: Return proper error codes for CreateFileMorph2021-05-011-2/+7
| | | | | | This improves the accuracy of CreateFile by returning the correct error codes on certain conditions (parent directory does not exist, path already exists). This fixes saving and the loading of existing saves in New Pokemon Snap
* common: Move settings to common from core.bunnei2021-04-151-1/+1
| | | | - Removes a dependency on core and input_common from common.
* Merge pull request #5119 from Morph1984/fs-opendatastoragewithprogramindexbunnei2020-12-151-0/+25
|\ | | | | fsp_srv: Implement OpenDataStorageWithProgramIndex
| * fsp_srv: Implement OpenDataStorageWithProgramIndexMorph2020-12-081-0/+25
| | | | | | | | - Used by RollerCoaster Tycoon 3: Complete Edition
* | core: Remove unnecessary enum casts in log callsLioncash2020-12-081-8/+8
|/ | | | | Follows the video core PR. fmt doesn't require casts for enum classes anymore, so we can remove quite a few casts.
* savedata_factory: Eliminate usage of the global system instanceLioncash2020-11-271-1/+2
| | | | Now there's only two meaningful instances left in core.
* service: Eliminate usages of the global system instanceLioncash2020-11-271-5/+3
| | | | | Completely removes all usages of the global system instance within the services code by passing in the using system instance to the services.
* patch_manager: Remove usages of the global system instanceLioncash2020-11-181-2/+5
| | | | | | | With this, only 19 usages of the global system instance remain within the core library. We're almost there.
* filesystem: Fix CreateDirectory and DeleteFileMorph2020-10-131-2/+3
| | | | | | Add a check if dir is nullptr (does not exist) Fixes save game creation in Hades
* file_sys/bis_factory: Eliminate usage of the global system accessorLioncash2020-09-171-1/+1
|
* common/fileutil: Convert namespace to Common::FSLioncash2020-08-161-40/+40
| | | | | | | | | | | | Migrates a remaining common file over to the Common namespace, making it consistent with the rest of common files. This also allows for high-traffic FS related code to alias the filesystem function namespace as namespace FS = Common::FS; for more concise typing.
* fs: Rename SaveDataDescriptor to SaveDataAttributeMorph2020-07-301-4/+4
|
* Add comment to clarify the nullptr checkMorph2020-07-161-0/+1
|
* filesystem: Create subdirectories prior to creating a fileMorph2020-07-161-0/+3
| | | | | If subdirectories exist in the given path parameter and don't exist in the real filesystem create them prior to creating the files within. This fixes the softlocks upon save creation in The Legend of Zelda: Breath of the Wild
* CMakeLists: Specify -Wextra on linux buildsLioncash2020-04-161-1/+2
| | | | | | | | | | | Allows reporting more cases where logic errors may exist, such as implicit fallthrough cases, etc. We currently ignore unused parameters, since we currently have many cases where this is intentional (virtual interfaces). While we're at it, we can also tidy up any existing code that causes warnings. This also uncovered a few bugs as well.
* service: Resolve sign conversion errorsLioncash2019-11-121-13/+13
| | | | | These are fairly trivial to resolve and most of the changes entail using RESULT_UNKNOWN over ResultCode(-1).
* hle/service: Replace global system instance calls with instance-based onesLioncash2019-10-061-10/+10
| | | | | | | | | | Migrates the HLE service code off the use of directly accessing the global system instance where trivially able to do so. This removes all usages of Core::CurrentProcess from the service code, only 8 occurrences of this function exist elsewhere. There's still quite a bit of "System::GetInstance()" being used, however this was able to replace a few instances.
* bcat: Add FSC accessors for BCAT dataZach Hilman2019-10-011-1/+1
| | | Ports BCAT to use FSC interface
* filesystem: Add getter for BCAT temporary directoryZach Hilman2019-09-301-0/+9
|
* configure_debug: Move reporting option to loggingZach Hilman2019-09-221-3/+2
|
* filesystem: Add const qualification to various accessorsZach Hilman2019-09-211-32/+36
|
* yuzu: Port old usages of Filesystem namespace to FilesystemControllerZach Hilman2019-09-211-0/+1
|
* filesystem: Pass Size Getter functions to IFileSystem for sizesZach Hilman2019-09-211-12/+0
|
* filesystem: Add FileSystemController to deglobalize FS servicesZach Hilman2019-09-211-32/+277
|
* fsp-srv: Implement OutputAccessLogToSdCardZach Hilman2019-06-291-5/+5
| | | | Allows games to log data to the SD.
* Merge pull request #1957 from DarkLordZach/title-providerbunnei2019-04-101-5/+6
|\ | | | | file_sys: Provide generic interface for accessing game data
| * core: Port current uses of RegisteredCache to ContentProviderZach Hilman2019-03-271-5/+6
| |
* | Merge pull request #2339 from lioncash/rankbunnei2019-04-061-3/+3
|\ \ | | | | | | service/fsp_srv: Update SaveDataInfo and SaveDataDescriptor structs
| * | service/fsp_srv: Don't pass SaveDataDescriptor instances by value.Lioncash2019-04-051-3/+3
| |/ | | | | | | | | Passing around a 64 byte data struct by value is kind of wasteful, instead pass a reference to the struct.
* / filesystem: Use a std::string_view in OpenFile()Lioncash2019-04-051-5/+8
|/ | | | | | Rather than make a full copy of the path, we can just use a string view and truncate the viewed portion of the string instead of creating a totally new truncated string.
* filesystem: Populate save data sizes from control dataZach Hilman2018-12-271-0/+47
|
* Merge pull request #1835 from lioncash/cache-globalbunnei2018-12-031-15/+3
|\ | | | | filesystem: De-globalize registered_cache_union
| * filesystem: De-globalize registered_cache_unionLioncash2018-12-021-15/+3
| | | | | | | | | | | | | | | | | | We can just return a new instance of this when it's requested. This only ever holds pointers to the existing registed caches, so it's not a large object. Plus, this also gets rid of the need to keep around a separate member function just to properly clear out the union. Gets rid of one of five globals in the filesystem code.
* | service/fsp_srv: Implement CleanDirectoryRecursivelyLioncash2018-12-011-0/+12
|/ | | | | | | | | | | | | | | This is the same behavior-wise as DeleteDirectoryRecursively, with the only difference being that it doesn't delete the top level directory in the hierarchy, so given: root_dir/ - some_dir/ - File.txt - OtherFile.txt The end result is just: root_dir/
* filesystem: Clear registered union paths on factory creationZach Hilman2018-11-191-0/+5
|
* Merge pull request #1632 from DarkLordZach/keys-manager-optimizationsbunnei2018-11-161-3/+10
|\ | | | | game_list: Optimize game list refresh
| * filesystem: Cache RegisteredCacheUnion instead of constructing on demandZach Hilman2018-11-021-3/+10
| | | | | | | | Prevents unnecessary re-reads of the metadata and unnecessary temporary objects.
* | file_sys/errors: Extract FS-related error codes to file_sys/errors.hLioncash2018-11-161-3/+3
| | | | | | | | Keeps filesystem-related error codes in one spot.
* | Merge pull request #1618 from DarkLordZach/dump-nsobunnei2018-11-151-4/+21
|\ \ | | | | | | patch_manager: Add support for dumping uncompressed NSOs
| * | bis_factory: Add getter for mod dump root for a title IDZach Hilman2018-10-291-4/+21
| |/ | | | | | | Equates to yuzu_dir/dump/<title id>/
* / savedata_factory: Expose accessors for SaveDataSpaceZach Hilman2018-10-291-0/+10
|/
* file_sys/registered_cache: Use unique_ptr and regular pointers instead of shared_ptrs where applicableLioncash2018-10-161-7/+6
| | | | | | | | | | | | | | | The data retrieved in these cases are ultimately chiefly owned by either the RegisteredCache instance itself, or the filesystem factories. Both these should live throughout the use of their contained data. If they don't, it should be considered an interface/design issue, and using shared_ptr instances here would mask that, as the data would always be prolonged after the main owner's lifetime ended. This makes the lifetime of the data explicit and makes it harder to accidentally create cyclic references. It also makes the interface slightly more flexible than the previous API, as a shared_ptr can be created from a unique_ptr, but not the other way around, so this allows for that use-case if it ever becomes necessary in some form.
* filesystem: Make CreateFactories() and InstallInterface() take a VfsFilesystem instance by referenceLioncash2018-10-131-8/+8
| | | | | | | Neither of these functions alter the ownership of the provided pointer, so we can simply make the parameters a reference rather than a direct shared pointer alias. This way we also disallow passing incorrect memory values like nullptr.
* romfs_factory: Extract packed update setter to new functionZach Hilman2018-10-051-0/+9
|
* filesystem: Add LayeredFS VFS directory getterZach Hilman2018-09-221-1/+12
|
* Fixed GetAccountId stub, Added error code for OpenDirectory and added ActivateNpadWithRevisionDavid Marcec2018-09-191-1/+1
| | | | With these, `Nintendo Entertainment System - Nintendo Switch Online` loads
* hle/service: Default constructors and destructors in the cpp file where applicableLioncash2018-09-111-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a destructor isn't defaulted into a cpp file, it can cause the use of forward declarations to seemingly fail to compile for non-obvious reasons. It also allows inlining of the construction/destruction logic all over the place where a constructor or destructor is invoked, which can lead to code bloat. This isn't so much a worry here, given the services won't be created and destroyed frequently. The cause of the above mentioned non-obvious errors can be demonstrated as follows: ------- Demonstrative example, if you know how the described error happens, skip forwards ------- Assume we have the following in the header, which we'll call "thing.h": \#include <memory> // Forward declaration. For example purposes, assume the definition // of Object is in some header named "object.h" class Object; class Thing { public: // assume no constructors or destructors are specified here, // or the constructors/destructors are defined as: // // Thing() = default; // ~Thing() = default; // // ... Some interface member functions would be defined here private: std::shared_ptr<Object> obj; }; If this header is included in a cpp file, (which we'll call "main.cpp"), this will result in a compilation error, because even though no destructor is specified, the destructor will still need to be generated by the compiler because std::shared_ptr's destructor is *not* trivial (in other words, it does something other than nothing), as std::shared_ptr's destructor needs to do two things: 1. Decrement the shared reference count of the object being pointed to, and if the reference count decrements to zero, 2. Free the Object instance's memory (aka deallocate the memory it's pointing to). And so the compiler generates the code for the destructor doing this inside main.cpp. Now, keep in mind, the Object forward declaration is not a complete type. All it does is tell the compiler "a type named Object exists" and allows us to use the name in certain situations to avoid a header dependency. So the compiler needs to generate destruction code for Object, but the compiler doesn't know *how* to destruct it. A forward declaration doesn't tell the compiler anything about Object's constructor or destructor. So, the compiler will issue an error in this case because it's undefined behavior to try and deallocate (or construct) an incomplete type and std::shared_ptr and std::unique_ptr make sure this isn't the case internally. Now, if we had defaulted the destructor in "thing.cpp", where we also include "object.h", this would never be an issue, as the destructor would only have its code generated in one place, and it would be in a place where the full class definition of Object would be visible to the compiler. ---------------------- End example ---------------------------- Given these service classes are more than certainly going to change in the future, this defaults the constructors and destructors into the relevant cpp files to make the construction and destruction of all of the services consistent and unlikely to run into cases where forward declarations are indirectly causing compilation errors. It also has the plus of avoiding the need to rebuild several services if destruction logic changes, since it would only be necessary to recompile the single cpp file.
* bktr: Fix bucket overlap errorZach Hilman2018-09-041-1/+1
|
* registration: Add RegisteredCacheUnionZach Hilman2018-09-041-0/+7
| | | | Aggregates multiple caches into one interface
* filesystem: Move dir retrieval after path checking in DeleteFile()Lioncash2018-09-021-2/+5
| | | | | We don't need to do the lookup if the path is considered empty currently.
* Merge pull request #1166 from lioncash/typoSebastian Valle2018-08-251-1/+1
|\ | | | | filesystem: Fix typo in log message
| * filesystem: Fix typo in log messageLioncash2018-08-241-1/+1
| |
* | filesystem: Add CreateFactories methods to fsZach Hilman2018-08-231-7/+6
| | | | | | | | Allows frontend to create registration caches for use before a game has booted.
* | filesystem: Add logging to registration gettersZach Hilman2018-08-231-4/+25
|/
* vfs: Replace mode.h include with forward declarations where applicableLioncash2018-08-211-1/+1
| | | | | Avoids the need to rebuild these source files if the mode header changes.
* service/filesystem: Use forward declarations where applicableLioncash2018-08-211-0/+2
| | | | | | | | Avoids the need to rebuild multiple source files if the filesystem code headers change. This also gets rid of a few instances of indirect inclusions being relied upon
* filesystem: Add support for loading of system archivesZach Hilman2018-08-191-3/+16
|
* filesystem: Add Open and Register functions for BISFactoryZach Hilman2018-08-121-0/+19
|
* core: Port core to VfsFilesystem for file accessZach Hilman2018-08-091-7/+7
|
* filesystem: Remove unnecessary if conditionsZach Hilman2018-08-091-1/+1
|
* service/filesystem: Add fsp:ldr and fsp:pr servicesLioncash2018-08-011-0/+4
| | | | | Adds the basic skeleton for the remaining fsp services based off information provided by Switch Brew.
* VFS Regression and Accuracy Fixes (#776)Zach Hilman2018-07-241-16/+29
| | | | | | | | | | | | | | | | * Regression and Mode Fixes * Review Fixes * string_view correction * Add operator& for FileSys::Mode * Return std::string from SanitizePath * Farming Simulator Fix * Use != With mode operator&
* file_util, vfs: Use std::string_view where applicableLioncash2018-07-221-1/+1
| | | | | Avoids unnecessary construction of std::string instances where applicable.
* file_util: Use an enum class for GetUserPath()Lioncash2018-07-211-2/+2
| | | | | | | | | | | | | Instead of using an unsigned int as a parameter and expecting a user to always pass in the correct values, we can just convert the enum into an enum class and use that type as the parameter type instead, which makes the interface more type safe. We also get rid of the bookkeeping "NUM_" element in the enum by just using an unordered map. This function is generally low-frequency in terms of calls (and I'd hope so, considering otherwise would mean we're slamming the disk with IO all the time) so I'd consider this acceptable in this case.
* Merge pull request #720 from Subv/getentrytype_rootSebastian Valle2018-07-191-0/+4
|\ | | | | Filesystem: Return EntryType::Directory for the root directory.
| * Filesystem: Return EntryType::Directory for the root directory.Subv2018-07-191-0/+4
| | | | | | | | It is unknown if this is correct behavior, but it makes sense and fixes a regression with Stardew Valley.
* | filesystem: std::move VirtualDir instance in VfsDirectoryServiceWrapper's constructorLioncash2018-07-191-1/+3
| | | | | | | | Avoids unnecessary atomic reference count incrementing and decrementing
* | filesystem: Use std::string's empty() function instead of comparing against a literalLioncash2018-07-191-1/+1
| | | | | | | | | | This is simply a basic value check as opposed to potentially doing string based operations (unlikely, but still, avoiding it is free).
* | filesystem: Remove pragma disabling global optimizationsLioncash2018-07-191-2/+0
|/ | | | This was just an artifact missed during PR review.
* Virtual Filesystem 2: Electric Boogaloo (#676)Zach Hilman2018-07-191-10/+199
| | | | | | | | | | * Virtual Filesystem * Fix delete bug and documentate * Review fixes + other stuff * Fix puyo regression
* General Filesystem and Save Data Fixes (#670)Zach Hilman2018-07-171-28/+49
|
* Revert "Virtual Filesystem (#597)"bunnei2018-07-081-208/+17
| | | | This reverts commit 77c684c1140f6bf3fb7d4560d06d2efb1a2ee5e2.
* Virtual Filesystem (#597)Zach Hilman2018-07-061-17/+208
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add VfsFile and VfsDirectory classes * Finish abstract Vfs classes * Implement RealVfsFile (computer fs backend) * Finish RealVfsFile and RealVfsDirectory * Finished OffsetVfsFile * More changes * Fix import paths * Major refactor * Remove double const * Use experimental/filesystem or filesystem depending on compiler * Port partition_filesystem * More changes * More Overhaul * FSP_SRV fixes * Fixes and testing * Try to get filesystem to compile * Filesystem on linux * Remove std::filesystem and document/test * Compile fixes * Missing include * Bug fixes * Fixes * Rename v_file and v_dir * clang-format fix * Rename NGLOG_* to LOG_* * Most review changes * Fix TODO * Guess 'main' to be Directory by filename
* Update clang formatJames Rowe2018-07-031-2/+2
|
* Rename logging macro back to LOG_*James Rowe2018-07-031-3/+3
|
* general: Make formatting of logged hex values more straightforwardLioncash2018-05-021-1/+1
| | | | | | This makes the formatting expectations more obvious (e.g. any zero padding specified is padding that's entirely dedicated to the value being printed, not any pretty-printing that also gets tacked on).
* filesystem: Move logging macros over to new fmt-compatible onesLioncash2018-04-241-4/+4
|
* service: Use nested namespace specifiers where applicableLioncash2018-04-201-4/+2
| | | | Tidies up namespace declarations
* FS: Added an SDMC archive factory and registered it to the SDMC archive on startup.Subv2018-03-201-0/+5
|
* FS: Make EnsureSaveData create the savedata folder when called for the first time.Subv2018-03-041-0/+13
|
* Filesystem: Added a SaveData Factory and associated Disk_FileSystem.Subv2018-03-021-2/+9
|
* filesystem: Implement basic IStorage functionality.David Marcec2018-01-211-0/+54