Class IceDecoderExtensions
Provides extension methods for IceDecoder to decode sequences or dictionaries.
public static class IceDecoderExtensions
- Inheritance
-
IceDecoderExtensions
- Inherited Members
Methods
CheckEndOfBuffer(ref IceDecoder)
Verifies the Ice decoder has reached the end of its underlying buffer.
public static void CheckEndOfBuffer(this ref IceDecoder decoder)
Parameters
decoderIceDecoderThe Ice decoder.
DecodeCollection<TCollection, TElement>(ref IceDecoder, Func<int, TCollection>, Action<TCollection, TElement>, DecodeFunc<TElement>)
Decodes an Ice sequence mapped to a custom collection.
public static TCollection DecodeCollection<TCollection, TElement>(this ref IceDecoder decoder, Func<int, TCollection> collectionFactory, Action<TCollection, TElement> addElement, DecodeFunc<TElement> decodeFunc)
Parameters
decoderIceDecoderThe Ice decoder.
collectionFactoryFunc<int, TCollection>A delegate used to create the collection with the specified capacity.
addElementAction<TCollection, TElement>A delegate used to add each decoded element to the collection.
decodeFuncDecodeFunc<TElement>The decode function for each element of the collection.
Returns
- TCollection
The decoded collection.
Type Parameters
TCollectionThe type of the returned collection.
TElementThe type of the elements in the collection.
DecodeDictionary<TDictionary, TKey, TValue>(ref IceDecoder, Func<int, TDictionary>, DecodeFunc<TKey>, DecodeFunc<TValue>)
Decodes a dictionary.
public static TDictionary DecodeDictionary<TDictionary, TKey, TValue>(this ref IceDecoder decoder, Func<int, TDictionary> dictionaryFactory, DecodeFunc<TKey> keyDecodeFunc, DecodeFunc<TValue> valueDecodeFunc) where TDictionary : IDictionary<TKey, TValue> where TKey : notnull
Parameters
decoderIceDecoderThe Ice decoder.
dictionaryFactoryFunc<int, TDictionary>The factory for creating the dictionary instance.
keyDecodeFuncDecodeFunc<TKey>The decode function for each key of the dictionary.
valueDecodeFuncDecodeFunc<TValue>The decode function for each value of the dictionary.
Returns
- TDictionary
The dictionary decoded by this decoder.
Type Parameters
TDictionaryThe type of the returned dictionary.
TKeyThe type of the keys in the dictionary.
TValueThe type of the values in the dictionary.
DecodeLinkedList<TElement>(ref IceDecoder, DecodeFunc<TElement>)
Decodes an Ice sequence mapped to a LinkedList<T>.
public static LinkedList<TElement> DecodeLinkedList<TElement>(this ref IceDecoder decoder, DecodeFunc<TElement> decodeFunc)
Parameters
decoderIceDecoderThe Ice decoder.
decodeFuncDecodeFunc<TElement>The decode function for each element of the sequence.
Returns
- LinkedList<TElement>
Type Parameters
TElementThe type of the elements in the sequence.
DecodeList<TElement>(ref IceDecoder, DecodeFunc<TElement>)
Decodes an Ice sequence mapped to a List<T>.
public static List<TElement> DecodeList<TElement>(this ref IceDecoder decoder, DecodeFunc<TElement> decodeFunc)
Parameters
decoderIceDecoderThe Ice decoder.
decodeFuncDecodeFunc<TElement>The decode function for each element of the sequence.
Returns
Type Parameters
TElementThe type of the elements in the sequence.
DecodeQueue<TElement>(ref IceDecoder, DecodeFunc<TElement>)
Decodes an Ice sequence mapped to a Queue<T>.
public static Queue<TElement> DecodeQueue<TElement>(this ref IceDecoder decoder, DecodeFunc<TElement> decodeFunc)
Parameters
decoderIceDecoderThe Ice decoder.
decodeFuncDecodeFunc<TElement>The decode function for each element of the sequence.
Returns
Type Parameters
TElementThe type of the elements in the sequence.
DecodeSequence<T>(ref IceDecoder, DecodeFunc<T>)
Decodes a sequence.
public static T[] DecodeSequence<T>(this ref IceDecoder decoder, DecodeFunc<T> decodeFunc)
Parameters
decoderIceDecoderThe Ice decoder.
decodeFuncDecodeFunc<T>The decode function for each element of the sequence.
Returns
- T[]
An array of T.
Type Parameters
TThe type of the elements in the array.
DecodeSequence<T>(ref IceDecoder, Action<T>?)
Decodes a sequence of fixed-size numeric values.
public static T[] DecodeSequence<T>(this ref IceDecoder decoder, Action<T>? checkElement = null) where T : struct
Parameters
decoderIceDecoderThe Ice decoder.
checkElementAction<T>A delegate used to check each element of the array (optional).
Returns
- T[]
An array of T.
Type Parameters
TThe sequence element type.
DecodeStack<TElement>(ref IceDecoder, DecodeFunc<TElement>)
Decodes an Ice sequence mapped to a Stack<T>.
public static Stack<TElement> DecodeStack<TElement>(this ref IceDecoder decoder, DecodeFunc<TElement> decodeFunc)
Parameters
decoderIceDecoderThe Ice decoder.
decodeFuncDecodeFunc<TElement>The decode function for each element of the sequence.
Returns
Type Parameters
TElementThe type of the elements in the sequence.