| | 1 | | // Copyright (c) ZeroC, Inc. |
| | 2 | |
|
| | 3 | | namespace ZeroC.Slice; |
| | 4 | |
|
| | 5 | | /// <summary>Provides an extension method for <see cref="SliceDecoder" /> to decode a <c>WellKnownTypes::Duration</c> |
| | 6 | | /// into a <see cref="TimeSpan"/>.</summary> |
| | 7 | | public static class DurationSliceDecoderExtensions |
| | 8 | | { |
| | 9 | | /// <summary>Decodes a duration.</summary> |
| | 10 | | /// <param name="decoder">The Slice decoder.</param> |
| | 11 | | /// <returns>The duration decoded as a <see cref="TimeSpan"/>.</returns> |
| 8 | 12 | | public static TimeSpan DecodeDuration(this ref SliceDecoder decoder) => new(decoder.DecodeVarInt62()); |
| | 13 | | } |