Class AVDictionary
Represents a managed wrapper around FFmpeg's AVDictionary structure.
Implements
Inherited Members
Namespace: FFmpeg.Collections
Assembly: FFmpeg.dll
Syntax
public sealed class AVDictionary : IDictionary<string, string>, ICollection<KeyValuePair<string, string>>, IEnumerable<KeyValuePair<string, string>>, IEnumerable, IDisposable, IAVPointer<_AVDictionary>
Remarks
This class implements IDictionary<TKey, TValue> and provides managed access to FFmpeg metadata dictionaries.
Constructors
View SourceAVDictionary(bool, bool)
Initializes a new empty AVDictionary.
Declaration
public AVDictionary(bool ignoreCase = true, bool ignoreSuffix = false)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | ignoreCase | If set to |
| bool | ignoreSuffix | If set to |
AVDictionary(IEnumerable<KeyValuePair<string, string>>, bool, bool)
Initializes a new AVDictionary containing the specified key/value pairs.
Declaration
public AVDictionary(IEnumerable<KeyValuePair<string, string>> dict, bool ignoreCase = true, bool ignoreSuffix = false)
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<KeyValuePair<string, string>> | dict | The key/value pairs used to initialize the dictionary. |
| bool | ignoreCase | true to perform case-insensitive key lookups; otherwise, false. |
| bool | ignoreSuffix | true to ignore suffixes during key comparisons; otherwise, false. |
Properties
View SourceCount
Gets the number of key-value pairs contained in the dictionary.
Declaration
public int Count { get; }
Property Value
| Type | Description |
|---|---|
| int |
IsReadOnly
Gets a value indicating whether the dictionary is read-only.
Declaration
public bool IsReadOnly { get; }
Property Value
| Type | Description |
|---|---|
| bool |
this[string]
Gets or sets the value associated with the specified key.
Declaration
public string this[string key] { get; set; }
Parameters
| Type | Name | Description |
|---|---|---|
| string | key | The key whose value to get or set. |
Property Value
| Type | Description |
|---|---|
| string | The value associated with the specified key. |
Exceptions
| Type | Condition |
|---|---|
| KeyNotFoundException | Thrown when the key is not found. |
Keys
Gets a collection containing the keys in the dictionary.
Declaration
public ICollection<string> Keys { get; }
Property Value
| Type | Description |
|---|---|
| ICollection<string> |
Values
Gets a collection containing the values in the dictionary.
Declaration
public ICollection<string> Values { get; }
Property Value
| Type | Description |
|---|---|
| ICollection<string> |
Methods
View SourceAdd(KeyValuePair<string, string>)
Adds the specified key-value pair to the dictionary.
Declaration
public void Add(KeyValuePair<string, string> item)
Parameters
| Type | Name | Description |
|---|---|---|
| KeyValuePair<string, string> | item | The key-value pair to add. |
Add(string, string)
Adds the specified key and value 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. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException | Thrown when the key is null. |
| ArgumentException | Thrown when an element with the same key already exists in the dictionary. |
AppendText(string, string)
Appends the specified text to the value associated with the specified key. If the key does not exist, a new entry is created.
Declaration
public void AppendText(string key, string value)
Parameters
| Type | Name | Description |
|---|---|---|
| string | key | The key of the element to add. |
| string | value | The value to append to the existing value. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException | Thrown when the key is null. |
Clear()
Removes all key/value pairs from the dictionary.
Declaration
public void Clear()
Contains(KeyValuePair<string, string>)
Determines whether the dictionary contains a specific key-value pair.
Declaration
public bool Contains(KeyValuePair<string, string> item)
Parameters
| Type | Name | Description |
|---|---|---|
| KeyValuePair<string, string> | item | The key-value pair to locate in the dictionary. |
Returns
| Type | Description |
|---|---|
| bool |
|
ContainsKey(string)
Determines whether the dictionary contains a specific key.
Declaration
public bool ContainsKey(string key)
Parameters
| Type | Name | Description |
|---|---|---|
| string | key | The key to locate in the dictionary. |
Returns
| Type | Description |
|---|---|
| bool |
|
CopyTo(KeyValuePair<string, string>[], int)
Declaration
public void CopyTo(KeyValuePair<string, string>[] array, int arrayIndex)
Parameters
| Type | Name | Description |
|---|---|---|
| KeyValuePair<string, string>[] | array | |
| int | arrayIndex |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException |
|
| ArgumentOutOfRangeException |
|
| ArgumentException | The destination array is too small. |
Dispose()
Releases the unmanaged FFmpeg dictionary associated with this instance.
Declaration
public void Dispose()
Remarks
After this method has been called, the dictionary should no longer be used.
~AVDictionary()
Declaration
protected ~AVDictionary()
GetEnumerator()
Returns an enumerator that iterates through the dictionary.
Declaration
public IEnumerator<KeyValuePair<string, string>> GetEnumerator()
Returns
| Type | Description |
|---|---|
| IEnumerator<KeyValuePair<string, string>> | An enumerator for the dictionary. |
Remove(KeyValuePair<string, string>)
Removes the specified key-value pair from the dictionary.
Declaration
public bool Remove(KeyValuePair<string, string> item)
Parameters
| Type | Name | Description |
|---|---|---|
| KeyValuePair<string, string> | item | The key-value pair to remove. |
Returns
| Type | Description |
|---|---|
| bool |
|
Remove(string)
Removes the value with the specified key from the dictionary.
Declaration
public bool Remove(string key)
Parameters
| Type | Name | Description |
|---|---|---|
| string | key | The key of the element to remove. |
Returns
| Type | Description |
|---|---|
| bool |
|
ToString()
Returns a string representation of the dictionary.
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| string | A colon-separated list of key/value pairs in the form
|
Overrides
View SourceTryGetValue(string, out string)
Gets the value associated with the specified key.
Declaration
public bool TryGetValue(string key, out string value)
Parameters
| Type | Name | Description |
|---|---|---|
| string | key | The key whose value to get. |
| string | value | When this method returns, contains the value associated with
|
Returns
| Type | Description |
|---|---|
| bool |
|