.. index:: 
  !DocumentLicense.checkLicense Method
  
.. _id3_document_document_license_check_license_class_method:

===============================================================================
DocumentLicense.checkLicense Method
===============================================================================

Module: :ref:`DocumentLicense<id3_document_document_license_class>`

Definition
----------

Checks a license from a file.

This function does two things:

- First it loads the license from a file using the given path

- Then it checks the validity of the license regarding the host it is called on (Windows, Linux, Android ...)

.. important:: Calling this function is required to get access to the license member getters.

.. note:: The optional parameter is required on Android and must be the JNIEnv* pointer casted as a void*. It can be set as NULL for other devices.


.. tab-set::

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

      .. code:: Python

        @staticmethod
        check_license(license_path: str) -> None

      **Parameters**

        .. line-block::

          ``license_path`` str
          :guilabel:`in` Absolute or relative path to the license file.


      **Exceptions**

        .. line-block::

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


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

      .. code:: Dart

        static void checkLicense(String? licensePath)

      **Parameters**

        .. line-block::

          ``licensePath`` String
          :guilabel:`in` Absolute or relative path to the license file.


      **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 static void CheckLicense(string licensePath)

      **Parameters**

        .. line-block::

          ``licensePath`` string
          :guilabel:`in` Absolute or relative path to the license file.


      **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 static void checkLicense(String licensePath) throws DocumentException

      **Parameters**

        .. line-block::

          ``licensePath`` String
          :guilabel:`in` Absolute or relative path to the license file.


      **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 static func checkLicense(licensePath: String) throws

      **Parameters**

        .. line-block::

          ``licensePath`` String
          :guilabel:`in` Absolute or relative path to the license file.


      **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 id3DocumentLicense_CheckLicense (
            const char * licensePath, 
            void * optionalParameter)

      **Parameters**

        .. line-block::

          ``licensePath`` const char *
          :guilabel:`in` Absolute or relative path to the license file.

          ``optionalParameter`` void *
          :guilabel:`in` Only used on Android: JNIEnv* pointer casted as a void*. Ignored for other devices.


      **Returns**

        .. line-block::

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


