Commit Graph

22 Commits

Author SHA1 Message Date
Ben Marsh
b8e2cda212 EpicGames.Serialization: Add tests for deserializing dictionaries into read-only properties.
#preflight none

[CL 20252945 by Ben Marsh in ue5-main branch]
2022-05-17 18:40:04 -04:00
Ben Marsh
12a0d5010f EpicGames.Serialization: Support deserializing into getter-only collection properties.
#preflight none

[CL 20252879 by Ben Marsh in ue5-main branch]
2022-05-17 18:36:34 -04:00
Ben Marsh
b50740d5c1 Horde: Compact binary serialization improvements.
- Fix serialization of lists, directories and arrays that are set to null.
- Throw an exception when serializing a type that does not have any explicit compact binary field attributes. This is usually an error, caused by serializing a framework type with no matching converter, but can also occur when serializing an empty base class instance. To handle these situations, the class can be marked with [CbObject] to explicitly opt-in to being valid for serialization.

#fyi Joe.Kirchoff
#preflight none

[CL 19526671 by Ben Marsh in ue5-main branch]
2022-03-28 10:11:10 -04:00
Ben Marsh
7a0ca03010 Fix test failure.
#preflight none

[CL 19511958 by Ben Marsh in ue5-main branch]
2022-03-25 10:01:43 -04:00
Ben Marsh
6b226011d7 Change EpicGames.Serialization library to match standard coding style.
#preflight none

[CL 19501703 by Ben Marsh in ue5-main branch]
2022-03-24 15:56:16 -04:00
Ben Marsh
17ddfdfdfc Horde: More improvements to Bundles.
- Now does all string manipulations in UTF8 rather than converting to and fro with data received from Perforce
- Added support for reading a stream out of a CbWriter object. This allows pushing data directly to Horde Storage from the piecemeal 1kb buffers it allocates without having to concatenate everything into a contiguous array first, removing some big allocations and data copying on the common path for serializing objects into Horde Storage.
- Refactored the way that BundleNodeRef objects work so they don't need to track the Bundle that owns them, so we can add some serialization/deserialization tests without having to set up as much framework code.

#preflight none

[CL 19345769 by Ben Marsh in ue5-main branch]
2022-03-10 19:56:01 -05:00
Ben Marsh
1b3110c5ec Horde: Refactored system for creating bundles of tree objects.
- Tree can now be modified without having to have entire working set in memory.
- Multiple nodes can be compressed/decompressed together, and an optional IMemoryCache allows caching decompressed blocks.
- Added support for specifying custom compact-binary serializers on individual properties.
- Added test suite to test bundling functionality.
- Fixed issue where VarInts of negative values would not serialize correctly.
#preflight 621952f68849a7424fa36567

[CL 19158249 by Ben Marsh in ue5-main branch]
2022-02-25 17:11:58 -05:00
Joakim Lindqvist
28a6cd7b1b Missing file from change 19111703 (more tests for EpicGames.Serialization)
#preflight none

[CL 19111816 by Joakim Lindqvist in ue5-main branch]
2022-02-24 06:01:24 -05:00
Joakim Lindqvist
b37024fe9b C# Compact Binary Serialization - Added more tests from Horde Storage (Jupiter Tests) and fixed issues exposed by them.
#preflight none

[CL 19111703 by Joakim Lindqvist in ue5-main branch]
2022-02-24 05:44:12 -05:00
Ben Marsh
9e6e68ba17 CS: Add overloads for commonly serialized compact binary types.
#preflight 61e4a67d7b0f77175a5d6621

[CL 18630220 by Ben Marsh in ue5-main branch]
2022-01-16 18:26:30 -05:00
Ben Marsh
e0f2ac5e4c Target NET 6 for the EpicGames.Serialization.Tests library, so we can run it from the Docker image.
[CL 18272361 by Ben Marsh in ue5-main branch]
2021-11-23 13:01:18 -05:00
Ben Marsh
e1cb80903f Horde: Fix tests in serialization library.
#fyi Ryan.Durand

[CL 18271689 by Ben Marsh in ue5-main branch]
2021-11-23 12:18:30 -05:00
Ben Marsh
5a129c2997 Horde: Add support for querying all objects underneath a given root (eg. /api/v1/objects/NS/HASH/tree). Objects are returned as a stream of compact binary object attachment fields (followed by an actual object) and binary attachment fields.
Optional request body specifies a list of objects that the client already has, and the server does not need to recurse through.

#fyi Joe.Kirchoff

[CL 17391157 by Ben Marsh in ue5-main branch]
2021-09-01 15:22:55 -04:00
Ben Marsh
77210c0efc Horde: Fix DateTime CB serialization tests.
[CL 17368297 by Ben Marsh in ue5-main branch]
2021-08-31 10:56:03 -04:00
jonathan adamczewski
db8046e278 Move DotNETCommon/BuildUtilities to Shared/EpicGames.Build
Also moves DotNETCommon/Metadata.cs to Shared/Metadata.cs

#jira none
#rb tim.smith

[CL 17116964 by jonathan adamczewski in ue5-main branch]
2021-08-10 11:08:41 -04:00
joe kirchoff
d77482768d [Backout] - CL16961198
#fyi Joe.Kirchoff
Original CL Desc
-----------------------------------------------------------------
Use Microsoft.CodeAnalysis.CSharp.Workspaces for code analysis

#rb none
#rnx

[CL 16961691 by joe kirchoff in ue5-main branch]
2021-07-26 17:58:54 -04:00
Joe Kirchoff
8fcb4dc40e Use Microsoft.CodeAnalysis.CSharp.Workspaces for code analysis
#rb none
#rnx

[CL 16961198 by Joe Kirchoff in ue5-main branch]
2021-07-26 17:14:29 -04:00
Ben Marsh
b3fb0f0503 Horde: Write managed workspace snapshots using Compact Binary.
[CL 16811525 by Ben Marsh in ue5-main branch]
2021-07-06 11:00:26 -04:00
Ben Marsh
a855dca4ea Rename ReadOnlyUtf8String to Utf8String. Strings are always immutable in C#.
[CL 16807051 by Ben Marsh in ue5-main branch]
2021-07-02 12:16:55 -04:00
Ben Marsh
7e3b00497a Horde: Various compact binary library improvements.
CbObject/CbBinary/CbArray:
* Added proxy classes for viewing objects in the debugger. CbArray now displays as an array, CbObject displays as an array of fields, etc...
* Removed overloaded "View" methods, which are not required in C# due to GC.

CbWriter:
* Significantly fewer memory allocations/copying. Output buffer is now allocated in large chunks, with length fields only inserted when copying to the final output buffer.
* Methods for writing named/unnamed fields are now more idomatic with other C# serialization classes (ie. WriteXXX(Name, Value) and WriteXXXValue(Value)).

Other:
* Added serialization tests to Horde projects and fixed NuGet dependencies.

[CL 16804192 by Ben Marsh in ue5-main branch]
2021-07-01 09:12:10 -04:00
Ben Marsh
2c4b316eb5 Add missing configurations for EpicGames.Serialization.Tests.
[CL 16703657 by Ben Marsh in ue5-main branch]
2021-06-17 08:59:42 -04:00
Ben Marsh
c7bcab5731 Add C# compact binary library. Includes almost all functionality from C++ library, and test suite.
[CL 16703410 by Ben Marsh in ue5-main branch]
2021-06-17 08:22:02 -04:00