.. oe:namespace:: OEChem



.. meta::
   :keywords: OEMolDatabaseSaveOptions, MolDatabaseSaveOptions


.. _OEChem_OEMolDatabaseSaveOptions:

.. oe:class:: OEMolDatabaseSaveOptions

   .. oe:api::

      class OEMolDatabaseSaveOptions

   The class used to contain additional options for the
   :oe:meth:`OEChem::OEMolDatabase::Save` method.
   
   .. oe:method:: Constructors

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

         .. oe:api::

            OEMolDatabaseSaveOptions()
            OEMolDatabaseSaveOptions(unsigned int format, unsigned int flavor,
                                     bool writeIdx,
                                     const std::string& idxFileName)

      .. oe:language:: python

         .. oe:api:: python

            OEMolDatabaseSaveOptions() -> OEMolDatabaseSaveOptions
            OEMolDatabaseSaveOptions(format: int, flavor: int, writeIdx: bool,
                                     idxFileName: str) -> OEMolDatabaseSaveOptions

      The default constructor initializes the object to the following: 

      *format* :oe:const:`OEChem::OEFormat::UNDEFINED`
      
      *flavor* ``0``
      
      *writeIdx* ``true``

      *idxFileName* Empty string


   .. oe:method:: GetFlavor

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

         .. oe:api::

            unsigned int GetFlavor() const

      .. oe:language:: python

         .. oe:api:: python

            GetFlavor() -> int

      Returns a constant from the :oe:constns:`OEChem::OEOFlavor`
      namespace for the format being saved to. 

   .. oe:method:: GetFormat

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

         .. oe:api::

            unsigned int GetFormat() const

      .. oe:language:: python

         .. oe:api:: python

            GetFormat() -> int

      Returns a constant from the :ref:`the OEFormat namespace <OEChem_OEFormat>`
      namespace.

   .. oe:method:: GetIdxFileName

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

         .. oe:api::

            const std::string& GetIdxFileName() const

      .. oe:language:: python

         .. oe:api:: python

            GetIdxFileName() -> str

      Returns the name of the index file being written to. If this
      file name is empty and
      :oe:meth:`OEChem::OEMolDatabaseSaveOptions::GetWriteIdx` returns
      ``true``, the file name will be automatically determined with
      the same rules as :oe:func:`OEChem::OEGetMolDatabaseIdxFileName`. 

      .. seealso::

         * :oe:func:`OEChem::OEGetMolDatabaseIdxFileName`
         * :oe:func:`OEChem::OECreateMolDatabaseIdx`

   .. oe:method:: GetWriteIdx

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

         .. oe:api::

            bool GetWriteIdx() const

      .. oe:language:: python

         .. oe:api:: python

            GetWriteIdx() -> bool

      Returns whether an index file should be created as well. 

   .. oe:method:: SetFlavor

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

         .. oe:api::

            void SetFlavor(unsigned int flvr)

      .. oe:language:: python

         .. oe:api:: python

            SetFlavor(flvr: int) -> None

      Specifies what the file format flavor the database should be
      saved to. ``flvr`` should be a value from the
      :oe:constns:`OEChem::OEOFlavor` namespace.

   .. oe:method:: SetFormat

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

         .. oe:api::

            void SetFormat(unsigned int fmt)

      .. oe:language:: python

         .. oe:api:: python

            SetFormat(fmt: int) -> None

      Specifies what file format the database should be saved
      to. ``fmt`` should be a value from the
      :ref:`the OEFormat namespace <OEChem_OEFormat>`.

   .. oe:method:: SetIdxFileName

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

         .. oe:api::

            void SetIdxFileName(const std::string& f)

      .. oe:language:: python

         .. oe:api:: python

            SetIdxFileName(f: str) -> None

      Specifies what the index file name should be. 

      .. seealso:: 

         :ref:`section_index_files`

   .. oe:method:: SetWriteIdx

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

         .. oe:api::

            void SetWriteIdx(bool w)

      .. oe:language:: python

         .. oe:api:: python

            SetWriteIdx(w: bool) -> None

      Specifies whether an index file should be created during the
      database save operation.

