summaryrefslogtreecommitdiff
path: root/src/common/file_util.cpp
AgeCommit message (Collapse)Author
2018-08-24file_util: Correct return value in early exit of ReadFileToString()Lioncash
While still essentially being zero, we should be returning a numeric value here, not a boolean typed value.
2018-08-11file_util: Add getter for NAND registration directoryZach Hilman
2018-08-08file_util: Use enum instead of bool for specifing path behaviorZach Hilman
2018-08-08file_util: Add platform-specific slash option to SanitizePathZach Hilman
2018-08-01Allow key loading from %YUZU_DIR%/keys in addition to ~/.switchZach Hilman
2018-08-01Use SHGetKnownFolderPath instead of SHGetFolderPathAZach Hilman
2018-08-01Extract mbedtls to cpp fileZach Hilman
2018-08-01Remove files that are not usedZach Hilman
2018-07-23VFS Regression and Accuracy Fixes (#776)Zach Hilman
* 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&
2018-07-22Merge pull request #768 from lioncash/string-viewbunnei
file_util, vfs: Use std::string_view where applicable
2018-07-22file_util, vfs: Use std::string_view where applicableLioncash
Avoids unnecessary construction of std::string instances where applicable.
2018-07-22Merge pull request #765 from lioncash/filebunnei
file_util: Remove goto usages from Copy()
2018-07-21file_util: Remove goto usages from Copy()Lioncash
We can just leverage std::unique_ptr to automatically close these for us in error cases instead of jumping to the end of the function to call fclose on them.
2018-07-21file_util: Use a u64 to represent number of entriesLioncash
This avoids a truncating cast on size. I doubt we'd ever traverse a directory this large, however we also shouldn't truncate sizes away.
2018-07-21file_util: std::move FST entries in ScanDirectoryTree()Lioncash
Avoids unnecessary copies when building up the FST entries.
2018-07-21Merge pull request #759 from lioncash/redundantbunnei
file_util: Remove redundant duplicate return in GetPathWithoutTop()
2018-07-21file_util: Use an enum class for GetUserPath()Lioncash
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.
2018-07-21file_util: Remove explicit type from std::min() in GetPathWithoutTop()Lioncash
Given both operands are the same type, there won't be an issue with overload selection that requires making this explicit.
2018-07-21file_util: Remove redundant duplicate return in GetPathWithoutTop()Lioncash
2018-07-19file_util: return string by const reference for GetExeDirectory()Lioncash
This disallows modifying the internal string buffer (which shouldn't be modified anyhow).
2018-07-18Virtual Filesystem 2: Electric Boogaloo (#676)Zach Hilman
* Virtual Filesystem * Fix delete bug and documentate * Review fixes + other stuff * Fix puyo regression
2018-07-07Revert "Virtual Filesystem (#597)"bunnei
This reverts commit 77c684c1140f6bf3fb7d4560d06d2efb1a2ee5e2.
2018-07-06Merge pull request #630 from FearlessTobi/remove-citra-referencesbunnei
Remove some references to Citra
2018-07-06Virtual Filesystem (#597)Zach Hilman
* 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
2018-07-06Remove some references to CitrafearlessTobi
2018-07-02Add configurable logging backendsJames Rowe
2018-07-02Update clang formatJames Rowe
2018-07-02Rename logging macro back to LOG_*James Rowe
2018-04-29file_util: Make move constructor/assignment operator and related functions ↵Lioncash
noexcept Without this, it's possible to get compilation failures in the (rare) scenario where a container is used to store a bunch of live IOFile instances, as they may be using std::move_if_noexcept under the hood. Given these definitely don't throw exceptions this is also not incorrect to add either.
2018-04-27general: Convert assertion macros over to be fmt-compatibleLioncash
2018-04-26common: Move logging macros over to new fmt-capable macros where applicableLioncash
2018-01-20Format: Run the new clang format on everythingJames Rowe
2017-03-11file_util: Log when using local user directorywwylele
2017-03-08file_util: lower logging level for harmless caseswwylele
2017-01-30file_util: Fixed implicit type conversion warning (#2503)noah the goodra
2016-12-23file_util: fix missing sysdata pathwwylele
2016-12-21file_util: Remove unused paths.bunnei
2016-12-13Common: Fix gcc build on macOSJeffrey Pfau
2016-11-30WINVER definition moved to CMake and cleanupfreiro
2016-11-26Removed /user/ from pathfreiro
2016-11-24Switch to AppData/Roamingfreiro
2016-11-19Return by value and other fixesfreiro
2016-11-19Win32 move default user folder location to AppDatafreiro
2016-10-27common: convert to standard stat()/fstat() interfacesAnthony J. Bentley
Most modern Unix environments use 64-bit off_t by default: OpenBSD, FreeBSD, OS X, and Linux libc implementations such as Musl. glibc is the lone exception; it can default to 32 bits but this is configurable by setting _FILE_OFFSET_BITS. Avoiding the stat64()/fstat64() interfaces is desirable because they are nonstandard and not implemented on many systems (including OpenBSD and FreeBSD), and using 64 bits for stat()/fstat() is either the default or trivial to set up.
2016-10-27common: stat64 is non-standard, hide on a random UnixJan Beich
src/common/file_util.cpp:79:19: error: variable has incomplete type 'struct stat64' struct stat64 file_info; ^ src/common/file_util.cpp:79:12: note: forward declaration of 'stat64' struct stat64 file_info; ^ src/common/file_util.cpp:99:19: error: variable has incomplete type 'struct stat64' struct stat64 file_info; ^ src/common/file_util.cpp:99:12: note: forward declaration of 'stat64' struct stat64 file_info; ^ src/common/file_util.cpp:342:19: error: variable has incomplete type 'struct stat64' struct stat64 buf; ^ src/common/file_util.cpp:342:12: note: forward declaration of 'stat64' struct stat64 buf; ^ src/common/file_util.cpp:359:19: error: variable has incomplete type 'struct stat64' struct stat64 buf; ^ src/common/file_util.cpp:359:12: note: forward declaration of 'stat64' struct stat64 buf; ^ 4 errors generated.
2016-09-21Remove special rules for Windows.h and library includesYuri Kunde Schlesner
2016-09-21Use negative priorities to avoid special-casing the self-includeYuri Kunde Schlesner
2016-09-21Remove empty newlines in #include blocks.Emmanuel Gil Peyrot
This makes clang-format useful on those. Also add a bunch of forgotten transitive includes, which otherwise prevented compilation.
2016-09-18Manually tweak source formatting and then re-run clang-formatYuri Kunde Schlesner
2016-09-18Sources: Run clang-format on everything.Emmanuel Gil Peyrot