Zach Hilman
3bf488ce52
vfs: Add VfsFilesystem interface and default implementation
8 years ago
Lioncash
7353cfc781
fsp_srv: Use std::string_view's copy() function instead of strncpy()
Given elements inserted into a vector are zeroed out, we can just copy
MAX_LEN - 1 elements and the data will already be properly null
terminated.
8 years ago
Zach Hilman
91cfe70301
loader: Add icon and title support to XCI
8 years ago
Zach Hilman
5927cf0e17
Use const where applicable
8 years ago
Zach Hilman
9e88f03e75
Avoid parsing RomFS to directory in NCA
8 years ago
Zach Hilman
2cc962e171
content_archive: Add support for titlekey cryptography
8 years ago
Lioncash
42a4c6b79e
vfs_vector: Remove unused variable in FindAndRemoveVectorElement()
This wasn't being used for anything, so it can be removed.
8 years ago
Lioncash
cec9e9b811
vfs_vector: Avoid unnecessary copies where applicable
The lambda elements should be taken by const reference here, and we can
move the virtual directory passed to ReplaceFileWithSubdirectory()
8 years ago
Zach Hilman
13cdf1f159
Add missing parameter to files.push_back()
8 years ago
Zach Hilman
187d8e215f
Use more descriptive error codes and messages
8 years ago
Zach Hilman
a9c921a41d
Use ErrorEncrypted where applicable and fix no keys crash
8 years ago
Zach Hilman
03149d3e4a
Add missing includes and use const where applicable
8 years ago
Zach Hilman
239a3113e4
Make XCI comply to review and style guidelines
8 years ago
Zach Hilman
22342487e8
Extract mbedtls to cpp file
8 years ago
Zach Hilman
df5b75694f
Remove files that are not used
8 years ago
Lioncash
57c4d7aa00
partition_filesystem: Remove dynamic_cast in PrintDebugInfo()
We shouldn't be upcasting our file instances. Given a
PartitionFilesystem is currently designed to accept any arbitrary
VfsFile instances, casting to a more specific type than that is just bad
design, and shows an interface design issue.
8 years ago
Zach Hilman
906d785c73
RomFS Extraction
8 years ago
Zach Hilman
59cb258409
VFS Regression and Accuracy Fixes ( #776 )
* 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&
8 years ago
Lioncash
db48ebb9c9
partition_filesystem: Use std::move where applicable
Avoids copying a std::string instance and avoids unnecessary atomic
reference count incrementing and decrementing.
8 years ago
Zach Hilman
e8f641a52d
NRO Assets and NACP file format
Cleanup
Review fixes
8 years ago
Lioncash
0081252d31
vfs: Correct file_p variable usage within InterpretAsDirectory()
ReplaceFileWithSubdirectory() takes a VirtualFile and a VirtualDir, but
it was being passed a string as one of its arguments. The only reason
this never caused issues is because this template isn't instantiated
anywhere yet.
This corrects an issue before it occurs.
8 years ago
Lioncash
398444e676
file_util, vfs: Use std::string_view where applicable
Avoids unnecessary construction of std::string instances where
applicable.
8 years ago
Lioncash
0ba7fe4ab1
file_util: Use a u64 to represent number of entries
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.
8 years ago
Lioncash
459e158340
file_sys/errors: Remove redundant object constructor calls
Given we're already constructing the error code, we don't need to call
the constructor inside of it.
8 years ago
Lioncash
b46c0ed1fa
vfs_real: Remove redundant copying of std::vector instances in GetFiles() and GetSubdirectories()
We already return by value, so we don't explicitly need to make the
copy.
8 years ago
Lioncash
ec71915ede
partition_filesystem, vfs_real: Add missing standard includes
8 years ago
Lioncash
d36e327ba6
partition_filesystem, vfs_real: Use std::move in ReplaceFileWithSubdirectory() where applicable
Avoids unnecessary atomic increment and decrement operations.
8 years ago
Lioncash
2b91386e15
partition_filesystem, vfs_real: Use std::distance() instead of subtraction
This is a little bit more self-documenting on what is being done here.
8 years ago
Lioncash
3e0727df1b
vfs_offset: Simplify TrimToFit()
We can simply use std::clamp() here, instead of using an equivalent
with std::max() and std::min().
8 years ago
Lioncash
894b0de0f2
vfs: Make WriteBytes() overload taking a std::vector pass the std::vector by const reference
Given the data is intended to be directly written, there's no need to
take the std::vector by value and copy the data.
8 years ago
Lioncash
dd09439fee
vfs: Use variable template variants of std::is_trivially_copyable
Provides the same behavior, but with less writing
8 years ago
Lioncash
05231d8b08
vfs: Amend constness on pointers in WriteBytes() and WriteArrays() member functions to be const qualified
These functions don't modify the data being pointed to, so these can be
pointers to const data
8 years ago
Lioncash
0e9d58e82a
vfs_offset: std::move file and name parameters of OffsetVfsFile
Avoids potentially unnecessary atomic reference count incrementing and
decrementing, as well as string copying.
8 years ago
Lioncash
bbd6429ecb
partition_filesystem: Return pfs_dirs member variable within GetSubdirectories()
This should be returned here, otherwise pfs_dirs is effectively only
ever added to, but never read.
8 years ago
Lioncash
88ba94e8a2
savedata_factory: Make SaveDataDescriptor's DebugInfo() function a const member function
This function doesn't alter class state.
8 years ago
Lioncash
9abc5763b6
partition_filesystem: Ensure all class members of PartitionFilesystem are initialized
Previously is_hfs and pfs_header members wouldn't be initialized in the
constructor, as they were stored in locals instead. This would result in
things like GetName() and PrintDebugInfo() behaving incorrectly.
While we're at it, initialize the members to deterministic values as
well, in case loading ever fails.
8 years ago
Lioncash
4790bb907d
content_archive: Make IsDirectoryExeFS() take a shared_ptr as a const reference
There's no need to take this by value when it's possible to avoid
unnecessary copies entirely like this.
8 years ago
Lioncash
87a9bb392b
content_archive: Add missing standard includes
8 years ago
Lioncash
0b566f43a1
content_archive: std::move VirtualFile in NCA's constructor
Gets rid of unnecessary atomic reference count incrementing and
decrementing.
8 years ago
Lioncash
5e626c774f
vfs: Deduplicate accumulation code in VfsDirectory's GetSize()
We can just use a generic lambda to avoid writing the same thing twice.
8 years ago
Zach Hilman
29aff8d5ab
Virtual Filesystem 2: Electric Boogaloo ( #676 )
* Virtual Filesystem
* Fix delete bug and documentate
* Review fixes + other stuff
* Fix puyo regression
8 years ago
Zach Hilman
69bfe075b5
General Filesystem and Save Data Fixes ( #670 )
8 years ago
Subv
7e5e4f8d7a
FileSys: Append the requested path to the filesystem base path in DeleteFile.
We were trying to delete things in the current directory instead of the actual filesystem directory. This may fix some savedata issues in some games.
8 years ago
bunnei
eb6cbfdbd8
savedata_factory: Always create a save directory for games.
8 years ago
bunnei
913896cbd9
Revert "Virtual Filesystem ( #597 )"
This reverts commit 77c684c114 .
8 years ago
Zach Hilman
77c684c114
Virtual Filesystem ( #597 )
* 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
8 years ago
James Rowe
0d46f0df12
Update clang format
8 years ago
James Rowe
638956aa81
Rename logging macro back to LOG_*
8 years ago
Zach Hilman
63f26d5c40
Add support for decrypted NCA files ( #567 )
* Start to add NCA support in loader
* More nca stuff
* More changes to nca.cpp
* Now identifies decrypted NCA cont.
* Game list fixes and more structs and stuff
* More updates to Nca class
* Now reads ExeFs (i think)
* ACTUALLY LOADS EXEFS!
* RomFS loads and games execute
* Cleanup and Finalize
* plumbing, cleanup and testing
* fix some things that i didnt think of before
* Preliminary Review Changes
* Review changes for bunnei and subv
8 years ago
Subv
a3d82ef5d9
Build: Fixed some MSVC warnings in various parts of the code.
8 years ago