-
Notifications
You must be signed in to change notification settings - Fork 75
Expand file tree
/
Copy pathIEditorSerializer.cs
More file actions
28 lines (25 loc) · 1.18 KB
/
Copy pathIEditorSerializer.cs
File metadata and controls
28 lines (25 loc) · 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
using RPGCore.DataEditor.Files;
using RPGCore.DataEditor.Manifest;
using System;
using System.IO;
namespace RPGCore.DataEditor;
/// <summary>
/// A serializer for reading and writing <see cref="IEditorValue"/>.
/// </summary>
public interface IEditorSerializer
{
/// <summary>
/// Reads an <see cref="IEditorValue"/> of the specified <paramref name="type"/> from the <paramref name="input"/>.
/// </summary>
/// <param name="session">The <see cref="EditorFile"/> to read into.</param>
/// <param name="type">The type of the object to deserialize into.</param>
/// <param name="input">The data to read from.</param>
IEditorValue DeserializeValue(EditorSession session, TypeName type, ReadOnlySpan<byte> input);
/// <summary>
/// Writes an <see cref="IEditorValue"/> to a <see cref="Stream"/>.
/// </summary>
/// <param name="value">The <see cref="IEditorValue"/> to write to the <see cref="Stream"/>.</param>
/// <param name="type">The <see cref="TypeName"/> that represents the default type for the context.</param>
/// <param name="output">The <see cref="Stream"/> to write the <see cref="IEditorValue"/> to.</param>
void SerializeValue(IEditorValue value, TypeName type, Stream output);
}