aboutsummaryrefslogtreecommitdiff
path: root/src/common/file_util.cpp
Commit message (Collapse)AuthorAgeFilesLines
* only redefine 64 bit file operation for MSVCWeiyi Wang2018-10-231-5/+8
| | | | MinGW provides POSIX functions
* common_paths: Add Load and Dump dirsZach Hilman2018-09-211-0/+2
|
* Port #4182 from Citra: "Prefix all size_t with std::"fearlessTobi2018-09-151-8/+8
|
* file_util: Correct return value in early exit of ReadFileToString()Lioncash2018-08-241-1/+1
| | | | | While still essentially being zero, we should be returning a numeric value here, not a boolean typed value.
* file_util: Add getter for NAND registration directoryZach Hilman2018-08-111-0/+6
|
* file_util: Use enum instead of bool for specifing path behaviorZach Hilman2018-08-081-4/+4
|
* file_util: Add platform-specific slash option to SanitizePathZach Hilman2018-08-081-3/+13
|
* Allow key loading from %YUZU_DIR%/keys in addition to ~/.switchZach Hilman2018-08-011-0/+1
|
* Use SHGetKnownFolderPath instead of SHGetFolderPathAZach Hilman2018-08-011-3/+4
|
* Extract mbedtls to cpp fileZach Hilman2018-08-011-1/+1
|
* Remove files that are not usedZach Hilman2018-08-011-0/+12
|
* VFS Regression and Accuracy Fixes (#776)Zach Hilman2018-07-231-1/+10
| | | | | | | | | | | | | | | | * 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&
* Merge pull request #768 from lioncash/string-viewbunnei2018-07-221-34/+48
|\ | | | | file_util, vfs: Use std::string_view where applicable
| * file_util, vfs: Use std::string_view where applicableLioncash2018-07-221-34/+48
| | | | | | | | | | Avoids unnecessary construction of std::string instances where applicable.
* | Merge pull request #765 from lioncash/filebunnei2018-07-221-24/+14
|\ \ | |/ |/| file_util: Remove goto usages from Copy()
| * file_util: Remove goto usages from Copy()Lioncash2018-07-211-24/+14
| | | | | | | | | | | | 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.
* | file_util: Use a u64 to represent number of entriesLioncash2018-07-211-9/+9
| | | | | | | | | | 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.
* | file_util: std::move FST entries in ScanDirectoryTree()Lioncash2018-07-211-1/+1
|/ | | | Avoids unnecessary copies when building up the FST entries.
* Merge pull request #759 from lioncash/redundantbunnei2018-07-211-2/+1
|\ | | | | file_util: Remove redundant duplicate return in GetPathWithoutTop()
| * file_util: Remove explicit type from std::min() in GetPathWithoutTop()Lioncash2018-07-211-1/+1
| | | | | | | | | | Given both operands are the same type, there won't be an issue with overload selection that requires making this explicit.
| * file_util: Remove redundant duplicate return in GetPathWithoutTop()Lioncash2018-07-211-1/+0
| |
* | file_util: Use an enum class for GetUserPath()Lioncash2018-07-211-33/+35
|/ | | | | | | | | | | | | 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.
* file_util: return string by const reference for GetExeDirectory()Lioncash2018-07-191-1/+1
| | | | | This disallows modifying the internal string buffer (which shouldn't be modified anyhow).
* Virtual Filesystem 2: Electric Boogaloo (#676)Zach Hilman2018-07-181-26/+81
| | | | | | | | | | * Virtual Filesystem * Fix delete bug and documentate * Review fixes + other stuff * Fix puyo regression
* Revert "Virtual Filesystem (#597)"bunnei2018-07-071-67/+26
| | | | This reverts commit 12e9522b32d972a8e9b327c7ee7c14040a61ffdd.
* Merge pull request #630 from FearlessTobi/remove-citra-referencesbunnei2018-07-061-1/+1
|\ | | | | Remove some references to Citra
| * Remove some references to CitrafearlessTobi2018-07-061-1/+1
| |
* | Virtual Filesystem (#597)Zach Hilman2018-07-061-26/+67
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* Add configurable logging backendsJames Rowe2018-07-021-5/+12
|
* Update clang formatJames Rowe2018-07-021-10/+8
|
* Rename logging macro back to LOG_*James Rowe2018-07-021-40/+40
|
* file_util: Make move constructor/assignment operator and related functions ↵Lioncash2018-04-291-3/+3
| | | | | | | | | 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.
* general: Convert assertion macros over to be fmt-compatibleLioncash2018-04-271-3/+3
|
* common: Move logging macros over to new fmt-capable macros where applicableLioncash2018-04-261-48/+48
|
* Format: Run the new clang format on everythingJames Rowe2018-01-201-9/+8
|
* file_util: Log when using local user directorywwylele2017-03-111-0/+2
|
* file_util: lower logging level for harmless caseswwylele2017-03-081-9/+7
|
* file_util: Fixed implicit type conversion warning (#2503)noah the goodra2017-01-301-2/+2
|
* file_util: fix missing sysdata pathwwylele2016-12-231-3/+1
|
* file_util: Remove unused paths.bunnei2016-12-211-49/+3
|
* Common: Fix gcc build on macOSJeffrey Pfau2016-12-131-0/+11
|
* WINVER definition moved to CMake and cleanupfreiro2016-11-301-3/+0
|
* Removed /user/ from pathfreiro2016-11-261-2/+1
|
* Switch to AppData/Roamingfreiro2016-11-241-3/+3
|
* Return by value and other fixesfreiro2016-11-191-13/+7
|
* Win32 move default user folder location to AppDatafreiro2016-11-191-0/+23
|
* common: convert to standard stat()/fstat() interfacesAnthony J. Bentley2016-10-271-15/+10
| | | | | | | | | | | | | 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.
* common: stat64 is non-standard, hide on a random UnixJan Beich2016-10-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Remove special rules for Windows.h and library includesYuri Kunde Schlesner2016-09-211-0/+1
|
* Use negative priorities to avoid special-casing the self-includeYuri Kunde Schlesner2016-09-211-1/+1
|