.. include:: ../../toolkit-substitutions

.. oe:namespace:: OESaiph


.. meta::
   :keywords: OESmilesFileConverter, SmilesFileConverter


.. _OESaiph_OESmilesFileConverter:

.. oe:class:: OESmilesFileConverter

   .. attention::

      |PRELIMINARY-API|

   .. oe:api::

      class OESmilesFileConverter

   The :ref:`OESmilesFileConverter <OESaiph_OESmilesFileConverter>` class extracts data from SMI, ISM, CAN, CXSMILES, and
   USM files into :ref:`OERecord <OEDataFlow_OERecord>`. With the addition of an :ref:`OEMolConversionOptions <OESaiph_OEMolConversionOptions>`,
   a SMILES :ref:`OEField <OEDataFlow_OEField>` and a molecule title :ref:`OEField <OEDataFlow_OEField>` can be added to the
   :ref:`OERecord <OEDataFlow_OERecord>`.
   
   .. oe:method:: Constructors

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

         .. oe:api::

            OESmilesFileConverter()
            OESmilesFileConverter(const OESmilesFileConverter &)

      .. oe:language:: python

         .. oe:api:: python

            OESmilesFileConverter() -> OESmilesFileConverter
            OESmilesFileConverter(arg2: OESmilesFileConverter) -> OESmilesFileConverter

   .. oe:method:: Open

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

         .. oe:api::

            bool Open(const std::string& path,
                      const std::string& displayName = std::string()) override
            bool Open(const std::string& path,
                      const OEMolConversionOptions& options,
                      const std::string& displayName = std::string())

      .. oe:language:: python

         .. oe:api:: python

            Open(path: str, displayName: str = str()) -> bool
            Open(path: str, options: OEMolConversionOptions,
                 displayName: str = str()) -> bool

      Returns a boolean based on whether the file can be opened.
      :ref:`OEMolConversionOptions <OESaiph_OEMolConversionOptions>`
      is set at open.

   .. oe:method:: operator=
      :language: c++

      .. oe:api::

         OESmilesFileConverter &operator=(const OESmilesFileConverter &)

      Assignment operator.


   .. oe:method:: Close

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

         .. oe:api::

            void Close()

      .. oe:language:: python

         .. oe:api:: python

            Close() -> None

      Closes the stream.

   .. oe:method:: GetNextRecord

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

         .. oe:api::

            unsigned int GetNextRecord(OEDataFlow::OEMolRecord& record) override

      .. oe:language:: python

         .. oe:api:: python

            GetNextRecord(record: OEMolRecord) -> int

      Steps through each row of the file adding to the :ref:`OEMolRecord <OEDataFlow_OEMolRecord>`
      passed into the function. The function returns constants based on each pass.
      Return codes: ``SaiphReturnCode::Success``, ``SaiphReturnCode::Fail``, ``SaiphReturnCode::EndOfFile``

   .. oe:method:: GetProgress

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

         .. oe:api::

            float GetProgress()

      .. oe:language:: python

         .. oe:api:: python

            GetProgress() -> float

      Returns the percentage of the file that has been traversed.
