Commit Graph

88 Commits (6b07718871a616ec8d73ce882e3c6075571badfd)

Author SHA1 Message Date
Alexei Kotov 89d856d03e Merge branch 'use_is_directory_member' into 'master'
Use is_directory member function

See merge request OpenMW/openmw!3897
11 months ago
psi29a 518f34c869 Merge branch 'bsa_archive' into 'master'
Cleanup and optimize BSA archives code

See merge request OpenMW/openmw!3876
11 months ago
elsid c2ac1ce046
Use is_directory member function
To reduce the number of syscalls.
11 months ago
elsid e2e1d913af
Remove redundant destructor 11 months ago
elsid cc9f9b53ba
Convert BsaVersion to enum class 11 months ago
elsid df077a2524
Simplify and reduce code duplication for BSA archive creation 11 months ago
elsid 1b1ed55762
Add context to the errors on recursive iteration over directory
To avoid showing users errors like:
recursive_directory_iterator::operator++: Access is denied.

And show something like this:
Failed to recursively iterate over "/home/elsid/.local/share/openmw/test_data"
when incrementing to the next item from
"/home/elsid/.local/share/openmw/test_data/permission_denied": Permission denied
11 months ago
elsid a2345194c8
Optimize lookup for a file in the BSA archive
Use binary search in sorted vector or normalized paths instead of linear search
in the original file struct. With number of files from 1k to 10k in vanilla
archives this gives some benefits.
11 months ago
elsid d147d1d250
Initialize FileSystemArchive index in constructor
It should be initialize for each created archive anyway. There is no good reason
to have additional complexity for lazy initialization. And it helps to catch
problems with specific directory when it's added to the VFS not when all are
added and index is built.
11 months ago
elsid a6657c18cc
Use normalized path for file archives indices 11 months ago
elsid 062d3e9c00
Add NormalizedView for normalized paths 11 months ago
elsid 1689c59546
Add tests for VFS::Path::Normalized 11 months ago
elsid 70061329a1
Return Path::Normalized from RecursiveDirectoryIterator 12 months ago
elsid 9279138fb0
Accept normalized path by VFS::Manager functions 12 months ago
elsid d549cfd66b
Check path for being normalized 12 months ago
elsid 35d9b18b4c
Add type for normalized VFS path and use for VFS::Manager file map key
This will reduce the number of path normalizations while more places will use
this type. In some cases it also will reduce number of temporary allocations for
new strings.

For now make conversion from and to std::string_view implicit to allow gradual
migration to this type.
12 months ago
elsid a2147d70cc
Use forward declaration for some VFS types
This will allow to save on preprocessed code size in the future changes.
12 months ago
elsid 0d8dc5aabc
Use string_view for VFS lookups 1 year ago
elsid 3363616f56
Remove redundant startsWith function 1 year ago
Evil Eye f5a20d1e9c Change include guard name 2 years ago
Evil Eye e8ddccaefe Use std::transform 2 years ago
Evil Eye e791d2b498 Fix unit tests 2 years ago
Evil Eye eeda48ec50 Drop support for --fs-strict 2 years ago
Elias Howell bf8fafa79a fixed some typos and spelling errors 2 years ago
Cédric Mocquillon d30deef4b5 Use the right archive type to load bsa according to their type 2 years ago
Cédric Mocquillon c1fbe90953 Handle GNRL case of ba2 format 2 years ago
jvoisin 3cbf1dc042 First pass with include-what-you-use 2 years ago
clang-format-bot ddb0522bbf
Apply clang-format to code base 2 years ago
Project579 2df8bfed25 Fix build errors after rebase against master due to large amount of changes. 2 years ago
Project579 a13709c510 Replace implicit convertions from std::filesystem::path to std::string with correctly converting functions. 2 years ago
Project579 e5c417c968 Make sure all paths are passed as std::filesystem::path instead of std::string where possible. 2 years ago
Project579 4bb07282c9 Replace all remaining occurrences of boost::filesystem with std::filesystem. 2 years ago
elsid f99ed6f1db
Split components/misc/stringops.hpp into multiple headers
Replace all ciEqual overloads with one having std::string_view as argument.
2 years ago
psi29a b032a643f9 Merge branch 'vfs_string_view' into 'master'
Use std::string_view in VFS::Manager

See merge request OpenMW/openmw!2148
3 years ago
Petr Mikheev 38ee6d285d Use std::string_view in VFS::Manager 3 years ago
elsid 6c8ed4d19c
Move Files::IStreamPtr alias to a separate header
To avoid transitive include of Windows.h all over the engine.
3 years ago
elsid 9398e97600
Avoid manual memory management for VFS archives 3 years ago
elsid bef15edf0b
Remove redundant ostream, istream, iostream and sstream includes
* Replace by std::to_string and operator+ where possible.
* Move the code requiring to include <sstream> from .hpp to .cpp files.
3 years ago
AnyOldName3 c3d23b4948 Extra hack to make this build on Ubuntu with old CMake 3 years ago
AnyOldName3 bdcac26d8c Fix regressions from https://gitlab.com/OpenMW/openmw/-/merge_requests/1917 3 years ago
jvoisin bd5ccaac3c Followup to 21efb74b58 3 years ago
jvoisin 21efb74b58 Remove even most boost:: 3 years ago
jvoisin 6feb92a9bf Remove boost::filesystem from a couple of files 3 years ago
cody glassman 04843fed6d moddable post-processing pipeline 3 years ago
elsid 5eb8c4aebe
Avoid redundant conversion to const char* and use make_shared 3 years ago
Cédric Mocquillon ff7ad93bac Avoid missusing of CompressedBSAFile with private inheritance 3 years ago
Evil Eye b834527813 Add missing include 3 years ago
Bo Svensson db3d938ee9
cleans up BSAFile (#3177)
We currently build a large map of a BSAFile's contents unused by Open MW. We already map archive contents in VFS. With this PR we remove the map from BSAFile and reimplement its only current use in BSATool.
3 years ago
Bo Svensson 7c50f823d8
devirtualises BSAFile (#3161)
Currently, Open MW's basic file access speed is limited by a peculiar layer of virtualisation in BSAFile's interface. This PR removes such virtualisation by properly separating BSAFile from CompressedBSAFile in low level contexts.
3 years ago
Cédric Mocquillon b676d93e03 Use a pair of iterator to represents a range for directory listing 3 years ago