Class PdbHashTable
- Namespace
- AsmResolver.Symbols.Pdb.Metadata
- Assembly
- AsmResolver.Symbols.Pdb.dll
Provides methods for serializing and deserializing dictionaries as PDB hash tables.
public static class PdbHashTable
- Inheritance
-
PdbHashTable
- Inherited Members
Methods
FromReader<TKey, TValue>(ref BinaryStreamReader, Func<uint, uint, (TKey, TValue)>)
Reads a single PDB hash table from the input stream and converts it into a dictionary.
public static Dictionary<TKey, TValue> FromReader<TKey, TValue>(ref BinaryStreamReader reader, Func<uint, uint, (TKey, TValue)> mapper) where TKey : notnull
Parameters
reader
BinaryStreamReaderThe input stream to read from.
mapper
Func<uint, uint, (TKey, TValue)>A function that maps the raw key-value pairs into high level constructs.
Returns
- Dictionary<TKey, TValue>
The reconstructed dictionary.
Type Parameters
TKey
The type of keys in the final dictionary.
TValue
The type of values in the final dictionary.
GetPdbHashTableSize<TKey, TValue>(IDictionary<TKey, TValue>, Func<TKey, uint>)
Computes the number of bytes required to store the provided dictionary as a PDB hash table.
public static uint GetPdbHashTableSize<TKey, TValue>(this IDictionary<TKey, TValue> dictionary, Func<TKey, uint> hasher) where TKey : notnull
Parameters
dictionary
IDictionary<TKey, TValue>The dictionary to serialize.
hasher
Func<TKey, uint>A function that computes the hash code for a single key within the dictionary.
Returns
- uint
The number of bytes required.
Type Parameters
TKey
The type of keys in the input dictionary.
TValue
The type of values in the input dictionary.
WriteAsPdbHashTable<TKey, TValue>(IDictionary<TKey, TValue>, BinaryStreamWriter, Func<TKey, uint>, Func<TKey, TValue, (uint, uint)>)
Serializes a dictionary to a PDB hash table to an output stream.
public static void WriteAsPdbHashTable<TKey, TValue>(this IDictionary<TKey, TValue> dictionary, BinaryStreamWriter writer, Func<TKey, uint> hasher, Func<TKey, TValue, (uint, uint)> mapper) where TKey : notnull
Parameters
dictionary
IDictionary<TKey, TValue>The dictionary to serialize.
writer
BinaryStreamWriterThe output stream to write to.
hasher
Func<TKey, uint>A function that computes the hash code for a single key within the dictionary.
mapper
Func<TKey, TValue, (uint, uint)>A function that maps every key-value pair to raw key-value uint32 pairs.
Type Parameters
TKey
The type of keys in the input dictionary.
TValue
The type of values in the input dictionary.