.. index:: 
  !StringDict Class

.. _id3_document_string_dict_class:

===============================================================================
StringDict Class
===============================================================================

Namespace: :ref:`id3.Document<reference_document>`

.. toctree::
  :hidden:

  add<add>
  clear<clear>
  clone<clone>
  containsKey<contains_key>
  count<count>
  get<get>
  getCount<get_count>
  keys<keys>
  remove<remove>
  set<set>


Definition
----------
.. line-block::
    Represents a string dictionary.

.. tab-set::

    .. tab-item:: Python
      :sync: Python

      .. code:: Python

        class StringDict

    .. tab-item:: Dart
      :sync: Dart

      .. code:: Dart

        class StringDict implements Finalizable

    .. tab-item:: C#
      :sync: C#

      .. code:: C#

        public partial class StringDict

    .. tab-item:: Java
      :sync: Java

      .. code:: Java

        public class StringDict implements AutoCloseable, Serializable

    .. tab-item:: Swift
      :sync: Swift

      .. code:: Swift

        public class StringDict

    .. tab-item:: C
      :sync: C

      .. code:: C

        typedef struct id3DocumentStringDict *ID3_DOCUMENT_STRING_DICT;



Usage
-----

.. tab-set::

    .. tab-item:: Python
      :sync: Python

      .. code:: Python

        stringDictInstance = StringDict()
        # ...

      **Explicit destruction**

      .. code:: Python

        # ...
        del stringDictInstance

    .. tab-item:: Dart
      :sync: Dart

      .. code:: Dart

        final stringDictInstance = sdk.StringDict();
        // ...

      **Explicit destruction**

      .. code:: Dart

        // ...
        stringDictInstance.dispose()

    .. tab-item:: C#
      :sync: C#

      .. code:: C#

        using (var stringDictInstance = new StringDict())
        {
           // ...
        }

      **Explicit destruction**

      .. code:: C#

        var stringDictInstance = new StringDict()
        // ...
        stringDictInstance.Dispose()

    .. tab-item:: Java
      :sync: Java

      .. code:: Java

        try (StringDict stringDictInstance = new StringDict()) {
        // ...
        }

      **Explicit destruction**

      .. code:: Java

        StringDict stringDictInstance = new StringDict();
        // ...
        stringDictInstance.close();

    .. tab-item:: Swift
      :sync: Swift

      .. code:: Swift

        private var stringDictInstance: StringDict? = nil
        stringDictInstance = try StringDict()

    .. tab-item:: C
      :sync: C

      .. code:: C

        ID3_DOCUMENT_STRING_DICT hStringDict{};
        int err = id3DocumentStringDict_Initialize(&hStringDict);
        if (err == ID3_SUCCESS) {
            // ...
            id3DocumentStringDict_Dispose(&hStringDict);
        }


Properties
----------

.. list-table:: 
  :width: 100%
  :widths: 30 5 65
  :header-rows: 1

  * - Name
    - Type
    - Description
  * - :ref:`count<id3_document_string_dict_count_class_member>`
    - int
    - Gets the number of elements contained in the dict
  * - :ref:`keys<id3_document_string_dict_keys_class_member>`
    - :ref:`StringList<id3_document_string_list_class>`
    - Gets a string list containing the keys in the dict.
  * - operator [string key]
    - string
    - Gets or sets the element for the key in the dict.

Iteration
---------

This class supports iteration in Dart, C#, Java and Python.

The iteration is done on keys


Methods
-------

.. list-table:: 
  :width: 100%
  :widths: 30 70
  :header-rows: 1

  * - Name
    - Description
  * - :ref:`add<id3_document_string_dict_add_class_method>`
    - Adds an item to the StringDict object.
  * - :ref:`clear<id3_document_string_dict_clear_class_method>`
    - Clears the StringDict object.
  * - :ref:`clone<id3_document_string_dict_clone_class_method>`
    - Clones the StringDict object.
  * - :ref:`containsKey<id3_document_string_dict_contains_key_class_method>`
    - Determines whether the StringDictobject contains the specified key.
  * - :ref:`get<id3_document_string_dict_get_class_method>`
    - Gets an item of the StringDict object.
  * - :ref:`getCount<id3_document_string_dict_get_count_class_method>`
    - Gets the number of elements in the StringDict object.
  * - :ref:`remove<id3_document_string_dict_remove_class_method>`
    - Removes an element of the StringDict object.
  * - :ref:`set<id3_document_string_dict_set_class_method>`
    - Sets an item of the StringDict object.
