Class AVMultiDictionary
Represents a managed wrapper around FFmpeg's AVDictionary that
supports multiple values for the same key.
Implements
Inherited Members
Namespace: FFmpeg.Collections
Assembly: FFmpeg.dll
Syntax
public sealed class AVMultiDictionary : ILookup<string, string>, IEnumerable<IGrouping<string, string>>, IEnumerable, IDisposable, IAVPointer<_AVDictionary>
Remarks
Unlike AVDictionary, this class allows duplicate keys by storing multiple entries with the same key.
Constructors
View SourceAVMultiDictionary(bool)
Initializes a new empty AVMultiDictionary.
Declaration
public AVMultiDictionary(bool ignoreCase = true)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | ignoreCase | If set to true, the dictionary will ignore case when comparing keys. |
AVMultiDictionary(IDictionary<string, string>, bool)
Initializes a new AVMultiDictionary containing the specified key/value pairs.
Declaration
public AVMultiDictionary(IDictionary<string, string> values, bool ignoreCase = false)
Parameters
| Type | Name | Description |
|---|---|---|
| IDictionary<string, string> | values | |
| bool | ignoreCase |
AVMultiDictionary(ILookup<string, string>, bool)
Initializes a new AVMultiDictionary containing the values from the specified lookup.
Declaration
public AVMultiDictionary(ILookup<string, string> values, bool ignoreCase = false)
Parameters
| Type | Name | Description |
|---|---|---|
| ILookup<string, string> | values | |
| bool | ignoreCase |
Properties
View SourceCount
Gets the total number of key/value pairs contained in the dictionary.
Declaration
public int Count { get; }
Property Value
| Type | Description |
|---|---|
| int |
Remarks
Multiple entries with the same key are counted individually.
this[string]
Gets an enumerable sequence containing all values associated with the specified key.
Declaration
public IEnumerable<string> this[string key] { get; }
Parameters
| Type | Name | Description |
|---|---|---|
| string | key | The key whose values to get. |
Property Value
| Type | Description |
|---|---|
| IEnumerable<string> | An enumerable collection of values associated with the specified key. |
Methods
View SourceAdd(string, string)
Adds a key/value pair to the dictionary.
Declaration
public void Add(string key, string value)
Parameters
| Type | Name | Description |
|---|---|---|
| string | key | The key of the element to add. |
| string | value | The value of the element to add. |
Remarks
This method does not replace existing values. If the key already exists, an additional value is added.
Clear()
Removes all key/value pairs from the dictionary.
Declaration
public void Clear()
Contains(string)
Determines whether the dictionary contains the specified key.
Declaration
public bool Contains(string key)
Parameters
| Type | Name | Description |
|---|---|---|
| string | key | The key to locate in the dictionary. |
Returns
| Type | Description |
|---|---|
| bool | true if the dictionary contains an element with the specified key; otherwise, false. |
Dispose()
Releases the unmanaged FFmpeg dictionary associated with this instance.
Declaration
public void Dispose()
~AVMultiDictionary()
Declaration
protected ~AVMultiDictionary()
GetEnumerator()
Returns an enumerator that iterates through the dictionary.
Declaration
public IEnumerator<IGrouping<string, string>> GetEnumerator()
Returns
| Type | Description |
|---|---|
| IEnumerator<IGrouping<string, string>> | An enumerator that can be used to iterate through the dictionary. |
RemoveAll(string)
Removes all values associated with the specified key.
Declaration
public bool RemoveAll(string key)
Parameters
| Type | Name | Description |
|---|---|---|
| string | key | The key whose values to remove. |
Returns
| Type | Description |
|---|---|
| bool |
Remarks
If multiple values exist for the specified key, only the first matching entry is removed.
RemoveFirst(string)
Removes the first value associated with the specified key.
Declaration
public bool RemoveFirst(string key)
Parameters
| Type | Name | Description |
|---|---|---|
| string | key | The key whose first value to remove. |
Returns
| Type | Description |
|---|---|
| bool |
Remarks
If multiple values exist for the specified key, only the first matching entry is removed.
ToString()
Returns a string representation of the dictionary.
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| string | A colon-separated list of key/value groups in the form
|