There was an error fetching the commit references. Please try again later.
file_util: Use an enum class for GetUserPath()
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.
Showing
- src/common/common_paths.h 3 additions, 3 deletionssrc/common/common_paths.h
- src/common/file_util.cpp 35 additions, 33 deletionssrc/common/file_util.cpp
- src/common/file_util.h 13 additions, 14 deletionssrc/common/file_util.h
- src/core/hle/service/filesystem/filesystem.cpp 2 additions, 2 deletionssrc/core/hle/service/filesystem/filesystem.cpp
- src/core/hle/service/ns/pl_u.cpp 1 addition, 1 deletionsrc/core/hle/service/ns/pl_u.cpp
- src/core/telemetry_session.cpp 4 additions, 2 deletionssrc/core/telemetry_session.cpp
- src/yuzu/configuration/config.cpp 1 addition, 1 deletionsrc/yuzu/configuration/config.cpp
- src/yuzu/configuration/configure_debug.cpp 1 addition, 1 deletionsrc/yuzu/configuration/configure_debug.cpp
- src/yuzu/main.cpp 11 additions, 7 deletionssrc/yuzu/main.cpp
- src/yuzu_cmd/config.cpp 1 addition, 1 deletionsrc/yuzu_cmd/config.cpp
- src/yuzu_cmd/yuzu.cpp 13 additions, 8 deletionssrc/yuzu_cmd/yuzu.cpp
Loading
Please register or sign in to comment