.. include:: ../substitutions

.. oe:namespace:: OEChem

.. meta::
   :keywords: OEChemIsLicensed

..  _OEChem_OEChemIsLicensed:

.. oe:function:: OEChemIsLicensed

   .. oe:language:: c++ java csharp

      .. oe:api::

         bool OEChemIsLicensed(const char* feature = 0,
                               unsigned int* expdate = 0)

   .. oe:language:: python

      .. oe:api:: python

         OEChemIsLicensed(feature: str = None, expdate: int = None) -> bool

   Determines whether a valid license file is present.  This function may
   be called without a legitimate run-time license to determine whether
   it is safe to call any **OEChem TK**, **OESystem TK** or **OEPlatform TK**
   functionality.

   .. oe:language:: c++

      For example, to verify that **OEChem TK** can be used:

      .. oe:source:: OEChemIsLicensed.cpp
         :language: c++
         :frag:     SNIPPET-OECHEMISLICENSED-VERIFY

   .. oe:language:: python java csharp

      The 'features' argument can be used to check for a valid license to
      **OEChem TK** along with that feature, such as 'python', 'java' or 'clr'
      (for Csharp).
      For example, to verify that **OEChem TK** can be used:

      .. oe:source:: OEChemIsLicensed.py
         :language: python
         :frag:     SNIPPET-OECHEMISLICENSED-VERIFY

      .. oe:source:: OEChemIsLicensed.java
         :language: java
         :frag:     SNIPPET-OECHEMISLICENSED-VERIFY

      .. oe:source:: OEChemIsLicensed.cs
         :language: csharp
         :frag:     SNIPPET-OECHEMISLICENSED-VERIFY

   The second argument can be used to get the expiration date of the
   license. This is an array of size three with the date returned as
   {day, month, year}. Even if the function returns ``false`` due to an
   expired license, the 'expdate' will show that expiration date. A value
   of a zeroes implies that no license or date was found.

   .. oe:source:: OEChemIsLicensed.cpp
      :language: c++
      :frag:     SNIPPET-OECHEMISLICENSED-EXPIRE

   .. oe:source:: OEChemIsLicensed.py
      :language: python
      :frag:     SNIPPET-OECHEMISLICENSED-EXPIRE

   .. oe:source:: OEChemIsLicensed.java
      :language: java
      :frag:     SNIPPET-OECHEMISLICENSED-EXPIRE

   .. oe:source:: OEChemIsLicensed.cs
      :language: csharp
      :frag:     SNIPPET-OECHEMISLICENSED-EXPIRE
