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

.. oe:namespace:: OESaiph


.. meta::
   :keywords: OEDUFileConverter, DUFileConverter


.. _OESaiph_OEDUFileConverter:

.. oe:class:: OEDUFileConverter

   .. attention::

      |PRELIMINARY-API|

   .. oe:api::

      class OEDUFileConverter
      
   The :ref:`OEDUFileConverter <OESaiph_OEDUFileConverter>` class extracts the :ref:`OEDesignUnit <OEBio_OEDesignUnit>` 
   from an OEDU file into :ref:`OERecord <OEDataFlow_OERecord>`. The Iridium category is determined by each OERecord extracted.

   
   .. oe:method:: Constructors

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

         .. oe:api::

            OEDUFileConverter()
            OEDUFileConverter(const OEDUFileConverter &)

      .. oe:language:: python

         .. oe:api:: python

            OEDUFileConverter() -> OEDUFileConverter
            OEDUFileConverter(arg2: OEDUFileConverter) -> OEDUFileConverter

   .. oe:method:: Open

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

         .. oe:api::

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

      .. oe:language:: python

         .. oe:api:: python

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

      Returns a boolean based on whether the file can be opened.

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

      .. oe:api::

         OEDUFileConverter &operator=(const OEDUFileConverter &)

      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.
