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

.. oe:namespace:: OEBio

.. oe:function:: OEReadDesignUnit

   .. attention::

      |TWOLANGUAGE|

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

      .. oe:api::

         bool OEReadDesignUnit(const std::string& fname, OEDesignUnit& du)
         bool OEReadDesignUnit(OEPlatform::oeistream& ifs, OEDesignUnit& du,
                               unsigned type = OEDesignUnitFileType::OEDesignUnit)

   .. oe:language:: python

      .. oe:api:: python

         OEReadDesignUnit(fname: str, du: OEDesignUnit) -> bool
         OEReadDesignUnit(ifs: oeistream, du: OEDesignUnit, type: int) -> bool

   Read the contents of the file named ``fname`` into an :ref:`OEDesignUnit <OEBio_OEDesignUnit>` named
   ``du``. Returns ``true`` if an OEDesignUnit was read successfully, and ``false`` otherwise.

   An overload is provided to take any arbitrary
   :ref:`oeistream <OEPlatform_oeistream>`.

   .. seealso::

      * :ref:`OEDesignUnit <OEBio_OEDesignUnit>` class
      * :oe:func:`OEBio::OEIsReadableDesignUnit` function
      * :oe:func:`OEBio::OEWriteDesignUnit` function
