summaryrefslogtreecommitdiff
path: root/Source/Core/Common/NandPaths.cpp
AgeCommit message (Collapse)Author
2025-07-04WiiSaveBanner: fall back to $userdir/Load/WiiBannersTillmann Karras
Unlike custom banners which work as an override, this mechanism works as a fallback. The use case is if you have games you don't really play but want to keep around for testing purposes without filling up your NAND with lots of saves. For ease of use, the directory structure is the same but only title/$title_hi/$title_lo/data/banner.bin files are relevant.
2025-01-01Simplify `std::find` with `Common::Contains`mitaclaw
In NandPaths.cpp, the `std::initializer_list<char>` of illegal characters has been turned into a `char[]` (similar to the one in GameList.cpp). The reverse iteration in ResourcePack.cpp seemed to provide no benefits, and doing without it it seemed to have no ill effects.
2024-12-15Modernize `std::none_of` with rangesmitaclaw
In JitRegCache.cpp, the lambda predicate were replaced by a pointer to member function because ranges algorithms are able to invoke those. In ConvertDialog.cpp, the `std::mem_fn` helper was removed because ranges algorithms are able to handle pointers to member functions as predicates. In BoundingBox.cpp, the lambda predicate was returning the bool element unchanged, so `std::identity` was a better fit.
2024-12-15Modernize `std::all_of` with rangesmitaclaw
In DITSpecification.cpp, MaterialAsset.cpp, and ShaderAsset.cpp, lambda predicates were replaced by pointers to member functions because ranges algorithms are able invoke those. In NetPlayClient.cpp, the non-trivial `NetPlay::Player` elements were being passed by value in `NetPlayClient::DoAllPlayersHaveGame()`. This has been fixed. In WIABlob.cpp, the second example's predicate was returning the `std::optional` by value instead of implicitly converting it to a bool. This has been fixed.
2024-09-22StringUtil: Remove `JoinStrings`mitaclaw
With 12 uses of `JoinStrings` in the codebase vs 36 uses of `fmt::join`, fmtlib's range adapter for string concatenation with delimiters is clearly the preferred option.
2023-08-12NandPaths: Use initializer_list instead of unordered_setDentomologist
2023-08-12NandPaths: Resolve Android tautological comparison warningDentomologist
Android interprets char as unsigned char, so comparing with 0 triggers a tautological-unsigned-char-zero-compare warning. Casting c to an unsigned char and removing the comparison with 0 resolves the warning while needing one less comparison on all platforms.
2023-06-22Kill AsciiToHexget
Now superseded by Common::FromChars
2023-06-13Common: Convert FromWhichRoot to enum classDentomologist
2023-01-24Common: Replace StringBeginsWith/StringEndsWith with std equivalentsLioncash
Obsoletes these functions in favor of the standard member functions added in C++20.
2022-11-17IOS/ES: Add support for V1TicketSketch
2021-12-25Core: Make format of D_WIIROOT_IDX consistent with the rest of the user ↵Admiral H. Curtiss
directories.
2021-07-05treewide: convert GPLv2+ license info to SPDX tagsPierre Bourdon
SPDX standardizes how source code conveys its copyright and licensing information. See https://spdx.github.io/spdx-spec/1-rationale/ . SPDX tags are adopted in many large projects, including things like the Linux kernel.
2021-05-29NetPlay: Check file names when receiving GCI folderTechjar
2019-06-14Common: Use fmt where applicableLioncash
Begins the transition to using fmt for string formatting where applicable. Given fmt supports formatting std::string instances out of the box, we can remove now-unnecessary calls to .c_str() and .data(). Note that this change does not touch the actual logging subsystem aside from converting the final StringFromFormat call in the process over to fmt::format. Given our logging system is heavily used throughout the entire codebase, and converting that over will be quite a large change by itself, this will be tackled near the end of the conversion process.
2019-04-08NetPlay: Synchronize Mii dataTechjar
It's bundled with the Wii saves for simplicity, since it's quite small.
2018-05-04NandPaths: Return paths that are relative to Wii NANDLéo Lam
Since all FS access will go through the new FS interface (PR #6421) in order to keep track of metadata properly, there is no need to return absolute paths anymore. In fact, returning host paths is a roadblock to using the FS interface. This starts the migration work by adding a way to get paths that are relative to the Wii NAND instead of always getting absolute paths on the host FS. To prepare for future changes, this commit also makes returned paths canonical by removing the trailing slash when it's unneeded. Eventually, once everything has been migrated to the new interface, we can remove the "from" parameter.
2018-04-22NandPaths: Make function parameters consistentLioncash
Also drops trailing underscores from said parameter names.
2018-04-22NandPaths: Remove unused header inclusionsLioncash
2017-08-15WFS/NAND: Better handle GID.Pierre Bourdon
2017-06-15Move IOFile to a separate fileJosJuice
Reduces the number of files that need to be recompiled when making changes to FileUtil.h.
2017-06-11StringUtil: Make SplitString return by valueLéo Lam
Simpler usage.
2017-05-06NandPaths: Make .h function order match .cppJosJuice
2017-05-06Don't duplicate code for getting paths based on title IDsJosJuice
I've seen the expression (u32)(title_id >> 32), (u32)title_id a few more times in my life than I would've liked to...
2017-03-30Common: Remove dead code in NandPathsLéo Lam
2017-03-10IOS/ES: Write import files to /import firstLéo Lam
This is slightly safer than writing contents to /title directly. We still cannot rename everything in one go atomically, but this allows implementing AddTitleCancel very easily. Also, this ensures that when a title import fails, no incomplete files will be left in the title directory, which can mess up the system menu.
2017-03-03Common: Move byte swapping utilities into their own headerLioncash
This moves all the byte swapping utilities into a header named Swap.h. A dedicated header is much more preferable here due to the size of the code itself. In general usage throughout the codebase, CommonFuncs.h was generally only included for these functions anyway. These being in their own header avoids dumping the lesser used utilities into scope. As well as providing a localized area for more utilities related to byte swapping in the future (should they be needed). This also makes it nicer to identify which files depend on the byte swapping utilities in particular. Since this is a completely new header, moving the code uncovered a few indirect includes, as well as making some other inclusions unnecessary.
2017-01-12Remove pre-generated SYSCONFLéo Lam
Dolphin is able to generate one with all correct default settings, so we don't need to ship with a pre-generated SYSCONF and worry about syncing default settings. Additionally, this commit changes SysConf to work with session SYSCONFs so that Dolphin is able to generate a default one even for Movie/TAS. Which SYSCONF needs to be touched is explicitly specified to avoid confusion about which file SysConf is managing. (Another notable change is that the Wii root functions are moved into Core to prevent Common from depending on Core.)
2016-11-26IOS HLE: More robust escaping of NAND pathsJosJuice
Prevents path traversal without needing an absolute path function, and also improves accuracy (character sequences like ../ appear to have no special meaning in IOS). This removes the creation and usage of /sys/replace, because the new escapes are too complicated to all be representable in its format and because no other NAND handling software seems to use /sys/replace.
2016-06-24Reformat all the things. Have fun with merge conflicts.Pierre Bourdon
2016-01-21Correct ampersands as wellmathieui
2015-12-22Including missing headers required for non-pch builds and other architecturesRyan Houdek
2015-10-16Mark which Wii root to use in the NAND path code.comex
It's used by both the GUI to do things like install WADs and check up on the system menu, in which case the global root should be used, and by /dev/es, in which case the local one should. The latter isn't *terribly* useful today, since no contents will ever be installed in temporary roots (although it's still relevant for data directories), but converting the whole thing makes sense because then it will Just Work once the entire NAND is synced. Because it would have been a bit of work to split it up (but I can if desired), this commit also contains some basic cleanup of NANDContentLoader: (1) The useless interface class INANDContentLoader is removed and the methods are changed to just return CNANDContentLoader (the only implementation); (2) CNANDContentManager is changed to use unique_ptr and cleaned up a bit.
2015-09-26Common: Remove other Common prefixed headers from Common.hLioncash
2015-05-28Add a mode to use a dummy Wii NAND.comex
Eventually, netplay will be able to use the host's NAND, but this could still be useful in some cases; for TAS it definitely makes sense to have a way to avoid using any preexisting NAND. In terms of implementation: remove D_WIIUSER_IDX, which was just WIIROOT + "/", as well as some other indices which are pointless to have as separate variables rather than just using the actual path (fixed, since they're actual Wii NAND paths) at the call site. Then split off D_SESSION_WIIROOT_IDX, which can point to the dummy NAND directory, from D_WIIROOT_IDX, which always points to the "real" one the user configured.
2015-05-25Set copyright year to when a file was createdTillmann Karras
2015-05-25Update license headers to GPLv2+Tillmann Karras
2015-02-04Use emplace_* functions where in-place construction is preferableLioncash
2014-09-11Remove some unnecessary semicolonsLioncash
2014-09-08Include CommonTypes.h instead of Common.h.Rohit Nirmal
2014-03-29Remove all trailing whitespaces from our codebase.Pierre Bourdon
2014-02-22Make Common/ mostly IWYU clean (and fix errors in rest of the project ↵Pierre Bourdon
detected by this change).
2014-02-18Convert all includes to relative paths.Lioncash
2014-02-10Some tidy up of sprintf to StringFromFormatMatthew Parlane
Includes a small fix to SetupWiiMemory
2014-02-09Revert "Merge pull request #49 from Parlane/sprintf_tidy"Pierre Bourdon
Change broke the build on Debian stable. This reverts commit 28755439b36ac8e875d764da5db31ad693459ace, reversing changes made to 64e01ec763d21915e7166e625f8a3e85b46fbcbb.
2014-02-08Some tidy up of sprintf to StringFromFormatMatthew Parlane
2013-12-31Remove unnecessary Src/ foldersJasper St. Pierre