Skip to content

Conversation

@Mosakaas
Copy link
Owner

@Mosakaas Mosakaas commented Dec 1, 2025

Provides interfaces for mixing and matching save / load behaviour to an Input/Output source, using any type of serialization, using any kind of compression.

⚠️ This is a breaking change! ⚠️
The interfaces have already been implemented into the SaveFile, doing away with the events for onSave and onLoad. I feel that these events provide little benefit that can easily be recreated by anyone who needs the old behaviour. I will provide an upgrade tutorial if deemed necessary.

This is still a draft. Documentation and tests need still be provided, but the implementation may already be reviewed.

Currently missing some constructor parameters for HttpClient initialization.
Additionally, expose a static class SaveFile with the method CreateGZipJsonFile. This returns a SaveFile using File Input/Output, Json Serialization and GZip compression. This is likely how the SaveFile will mostly be used.
Now you can call this method with a JsonSerializerContext or JsonTypeInfo parameter.
The HttpIO is ready for the field! It now exposes the necessary headers and optional Request uris, some easy-to-use constructors and properly disposes its objects.
We need to compress the memory stream and leave it open BEFORE writing it with our IAsyncIOStreamProvider.

Note that this isn't a completely correct name, since it doesn't provide a write / input stream, it accepts one. Will need to change this once a good name has been devised.
Gzip should be GZip
@Mosakaas Mosakaas marked this pull request as ready for review December 22, 2025 15:41
@Mosakaas Mosakaas merged commit 3fcf9e3 into main Dec 22, 2025
@Mosakaas Mosakaas deleted the feature/Save_interfaces branch December 22, 2025 15:42
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.

2 participants