.. include:: ../substitutions

.. oe:namespace:: OEChem

.. meta::
   :keywords: OEGetMolDatabaseIdxFileName

.. oe:function:: OEGetMolDatabaseIdxFileName

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

      .. oe:api::

         std::string OEGetMolDatabaseIdxFileName(const std::string& filename)

   .. oe:language:: python

      .. oe:api:: python

         OEGetMolDatabaseIdxFileName(databaseFileName: str) -> str

   Returns the default index file name generated by
   :oe:func:`OEChem::OECreateMolDatabaseIdx` and
   :oe:meth:`OEChem::OEMolDatabase::Save`. Returns an empty string if
   an empty string is given.

   The index file name created is based upon the ``filename`` passed,
   optionally accounting for :file:`.gz`. The following table
   demonstrates the pattern used to create index file names:

   =================== =====================
   Database File Name  Index File Name
   =================== =====================
   database.oeb        database.oeb.idx
   database.oeb.gz     database.oeb.idx.gz
   =================== =====================

   .. seealso::

      * :oe:func:`OEChem::OECreateMolDatabaseIdx`
      * :oe:meth:`OEChem::OEMolDatabase::Save`

