.. index:: 
  !StringDict.add Method
  
.. _id3_document_string_dict_add_class_method:

===============================================================================
StringDict.add Method
===============================================================================

Module: :ref:`StringDict<id3_document_string_dict_class>`

Definition
----------

Adds an item to the StringDict object.


.. tab-set::

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

      .. code:: Python

        add(self, key: str, item: str) -> None

      **Parameters**

        .. line-block::

          ``key`` str
          :guilabel:`in` Unique key of the  item to add.

          ``item`` str
          :guilabel:`in`  item to add.


      **Exceptions**

        .. line-block::

          :ref:`DocumentException<id3_document_document_exception>`
          An error has occurred during Document Library execution.


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

      .. code:: Dart

        void add(String? key, String? item)

      **Parameters**

        .. line-block::

          ``key`` String
          :guilabel:`in` Unique key of the  item to add.

          ``item`` String
          :guilabel:`in`  item to add.


      **Exceptions**

        .. line-block::

          :ref:`DocumentException<id3_document_document_exception>`
          An error has occurred during Document Library execution.


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

      .. code:: C#

        public void Add(string key, string item)

      **Parameters**

        .. line-block::

          ``key`` string
          :guilabel:`in` Unique key of the  item to add.

          ``item`` string
          :guilabel:`in`  item to add.


      **Exceptions**

        .. line-block::

          :ref:`DocumentException<id3_document_document_exception>`
          An error has occurred during Document Library execution.


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

      .. code:: Java

        public void add(String key, String item) throws DocumentException

      **Parameters**

        .. line-block::

          ``key`` String
          :guilabel:`in` Unique key of the  item to add.

          ``item`` String
          :guilabel:`in`  item to add.


      **Exceptions**

        .. line-block::

          :ref:`DocumentException<id3_document_document_exception>`
          An error has occurred during Document Library execution.


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

      .. code:: Swift

        public func add(key: String, item: String) throws

      **Parameters**

        .. line-block::

          ``key`` String
          :guilabel:`in` Unique key of the  item to add.

          ``item`` String
          :guilabel:`in`  item to add.


      **Exceptions**

        .. line-block::

          :ref:`DocumentException<id3_document_document_exception>`
          An error has occurred during Document Library execution.


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

      .. code:: C

        int id3DocumentStringDict_Add (
            ID3_DOCUMENT_STRING_DICT hStringDict, 
            const char * key, 
            const char * item)

      **Parameters**

        .. line-block::

          ``hStringDict`` :ref:`ID3_DOCUMENT_STRING_DICT<id3_document_string_dict_class>`
          :guilabel:`in` Handle to the StringDict object.

          ``key`` const char *
          :guilabel:`in` Unique key of the  item to add.

          ``item`` const char *
          :guilabel:`in`  item to add.


      **Returns**

        .. line-block::

          ``int``
          An error code.
          See :ref:`id3DocumentError<id3_document_document_error_enum>` file for the list of possible error codes.


