Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modify and truncate DAF files #243

Merged
merged 15 commits into from
May 22, 2024

Conversation

ChristopherRabotin
Copy link
Member

Summary

  • Provides the ability to truncate segments or remove segments from any DAF file, available via API and CLI
  • Provides the ability, via the API only, to rename segments in DAF files

Architectural Changes

Most of the DAF functionality has been moved to a GenericDAF<W>, where W is either Bytes or BytesMut (of course, only the latter enables modification of the underlying bytes).

New Features

  • Truncate existing DAF segments
  • Remove existing DAF segments
  • Rename DAF segments (modifying the name record)

Improvements

No change

Bug Fixes

No change

Testing and validation

  1. Renaming test renames a segment, saves the new DAF/SPK, reloads it, and ensures that the name was changed
  2. Modification test truncates a segment that isn't at the start of the file, saves it, and reloads it, checking that the start time was modified and the end time was not modified. A manual test was also done here via the CLI for both the truncation and inspection of the changes
  3. Modification test includes removing the Moon (301) from the DE440s.bsp file, and checks that after saving, that entry is indeed removed.

Documentation

This PR does not primarily deal with documentation changes.

@ChristopherRabotin ChristopherRabotin linked an issue May 22, 2024 that may be closed by this pull request
2 tasks
Copy link
Member Author

@ChristopherRabotin ChristopherRabotin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed, looks ok, could use a clean up of the io_imports in mut_daf (that macro isn't needed but it doesn't hurt per se).

@ChristopherRabotin ChristopherRabotin merged commit 47c4f21 into master May 22, 2024
17 checks passed
@ChristopherRabotin ChristopherRabotin deleted the 176-modify-and-truncate-daf-files branch May 22, 2024 06:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Modify and truncate DAF files
1 participant