Guekka / bethutil

Common utilities for working with bethesda assets (dds, nif, bsa, hkx...)
https://guekka.github.io/bethutil/
Mozilla Public License 2.0
4 stars 1 forks source link

feat(bsa): implement flagging for tes4 archives #46

Closed mklokocka closed 2 months ago

mklokocka commented 2 months ago

Basic implementation of BSA flagging. Tested with bsa_tool, it's working.

Not happy with the style, but I do not know modern C++ so any pointers are welcome.

Also unsure whether it is actually correct to apply the flags for SSE, nor SLE for that matter. Fairly certain TES4/FO3/FNV all should have these flags however.

Guekka commented 2 months ago

Thank you for contributing

Not happy with the style, but I do not know modern C++ so any pointers are welcome.

I think it's okay. I'm just not sure whether having the extension / flag map at this place is a good idea. Since we already store info about files in AllowedPath, maybe we should try to keep it centralized

Also unsure whether it is actually correct to apply the flags for SSE, nor SLE for that matter. Fairly certain TES4/FO3/FNV all should have these flags however.

Pretty sure Skyrim also has these flags, but it works fine without them


Your changes are missing some tests. You will need to modify the expected archive in data/pack.7z. Let me know if you need help

codecov[bot] commented 2 months ago

Codecov Report

Attention: Patch coverage is 94.91525% with 3 lines in your changes missing coverage. Please review.

Project coverage is 80.28%. Comparing base (f222ced) to head (bf8ff01).

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/Guekka/bethutil/pull/46/graphs/tree.svg?width=650&height=150&src=pr&token=llth93S2Em&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Edgar)](https://app.codecov.io/gh/Guekka/bethutil/pull/46?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Edgar) ```diff @@ Coverage Diff @@ ## main #46 +/- ## ========================================== + Coverage 78.19% 80.28% +2.09% ========================================== Files 38 38 Lines 1651 1684 +33 ========================================== + Hits 1291 1352 +61 + Misses 360 332 -28 ``` | [Files](https://app.codecov.io/gh/Guekka/bethutil/pull/46?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Edgar) | Coverage Δ | | |---|---|---| | [include/btu/bsa/archive.hpp](https://app.codecov.io/gh/Guekka/bethutil/pull/46?src=pr&el=tree&filepath=include%2Fbtu%2Fbsa%2Farchive.hpp&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Edgar#diff-aW5jbHVkZS9idHUvYnNhL2FyY2hpdmUuaHBw) | `100.00% <ø> (ø)` | | | [src/bsa/archive.cpp](https://app.codecov.io/gh/Guekka/bethutil/pull/46?src=pr&el=tree&filepath=src%2Fbsa%2Farchive.cpp&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Edgar#diff-c3JjL2JzYS9hcmNoaXZlLmNwcA==) | `77.17% <100.00%> (+1.73%)` | :arrow_up: | | [src/bsa/pack.cpp](https://app.codecov.io/gh/Guekka/bethutil/pull/46?src=pr&el=tree&filepath=src%2Fbsa%2Fpack.cpp&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Edgar#diff-c3JjL2JzYS9wYWNrLmNwcA==) | `95.12% <100.00%> (+2.43%)` | :arrow_up: | | [include/btu/bsa/settings.hpp](https://app.codecov.io/gh/Guekka/bethutil/pull/46?src=pr&el=tree&filepath=include%2Fbtu%2Fbsa%2Fsettings.hpp&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Edgar#diff-aW5jbHVkZS9idHUvYnNhL3NldHRpbmdzLmhwcA==) | `87.21% <93.18%> (+25.27%)` | :arrow_up: | ------ [Continue to review full report in Codecov by Sentry](https://app.codecov.io/gh/Guekka/bethutil/pull/46?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Edgar). > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Edgar) > `Δ = absolute (impact)`, `ø = not affected`, `? = missing data` > Powered by [Codecov](https://app.codecov.io/gh/Guekka/bethutil/pull/46?dropdown=coverage&src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Edgar). Last update [f222ced...bf8ff01](https://app.codecov.io/gh/Guekka/bethutil/pull/46?dropdown=coverage&src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Edgar). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Edgar).