-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(typegen): implement Requests.cs and enable C Style Enums for uni…
…t enum variants Implements a class otherwise, always for enums. Which isn't ideal, however passing the option to the user might be wiser.
- Loading branch information
Showing
2 changed files
with
36 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,28 @@ | ||
// hi | ||
using System; | ||
using System.Collections.Generic; | ||
|
||
namespace SharedTypes | ||
{ | ||
public static class Requests | ||
{ | ||
public static List<Request> BincodeDeserialize(ArraySegment<byte> input) | ||
{ | ||
Serde.IDeserializer deserializer = new Bincode.BincodeDeserializer(input); | ||
deserializer.increase_container_depth(); | ||
|
||
var length = deserializer.deserialize_len(); | ||
var requests = new List<Request>(); | ||
for (var i = 0; i < length; ++i) | ||
{ | ||
while (deserializer.get_buffer_offset() < input.Count) | ||
{ | ||
var req = Request.Deserialize(deserializer); | ||
requests.Add(req); | ||
} | ||
} | ||
|
||
deserializer.decrease_container_depth(); | ||
return requests; | ||
} | ||
} | ||
} |