real-logic / simple-binary-encoding

Simple Binary Encoding (SBE) - High Performance Message Codec
Apache License 2.0
3.1k stars 521 forks source link

[C#] Add ToString output #852

Closed MFrpurdy closed 3 years ago

MFrpurdy commented 3 years ago

It would be helpful, when debugging especially, to have ToString output like the generated Java encoders/decoders.

I have a PR ready for this if you think it's a good idea.

Example output:

[Car](sbeTemplateId=1|sbeSchemaId=1|sbeSchemaVersion=0|sbeBlockLength=45):SerialNumber=1234|ModelYear=2013|Available=T|Code=A|SomeNumbers=[0,1,2,3]|VehicleCode=abcdef|Extras={SportsPack, CruiseControl}|DiscountedModel=C|Engine=(Capacity=2000|NumCylinders=4|ManufacturerCode=123|Efficiency=35|BoosterEnabled=T|Booster=(BoostType=NITROUS|HorsePower=200))|FuelFigures=[(Speed=30|Mpg=35.9|UsageDescription='Urban Cycle'),(Speed=55|Mpg=49|UsageDescription='Combined Cycle'),(Speed=75|Mpg=40|UsageDescription='Highway Cycle')]|PerformanceFigures=[(OctaneRating=95|Acceleration=[(Mph=30|Seconds=4),(Mph=60|Seconds=7.5),(Mph=100|Seconds=12.2)]),(OctaneRating=99|Acceleration=[(Mph=30|Seconds=3.8),(Mph=60|Seconds=7.1),(Mph=100|Seconds=11.8)])]|Manufacturer='Honda'|Model='Civic VTi'|ActivationCode='abcdef'
billsegall commented 3 years ago

This would definitely be a great addition.

mjpt777 commented 3 years ago

That would be great.