.. oe:namespace:: OEDataFlow


.. meta::
   :keywords: OEReadRecord OERecord datarecord

..  _OEDataFlow_OEReadRecord:

.. oe:function:: OEReadRecord

   .. oe:language:: c++

      .. oe:api::

         bool OEReadRecord(OERecord& record, OEPlatform::oeistream& ifs,
                           const std::string& fmt = "binary")

      Reads an :ref:`OERecord <OEDataFlow_OERecord>` object from a stream,
      and returns *true* if successful. Records can be read from the stream
      until this function returns *false*.

      record
        The record to be filled.

      ifs
        The stream to read the record from.

      fmt
        The format to read the record in. The default is "binary".  Other formats only used internally.

      .. seealso::

         * :ref:`OERecord <OEDataFlow_OERecord>`
         * :ref:`oeistream <OEPlatform_oeistream>`

   .. oe:language:: python

      .. oe:api::

         OEReadRecord(ifs: Union[TextIO, BinaryIO, oeistream],
                      fmt: str = "binary")
         OEReadRecords(ifs: Union[TextIO, BinaryIO, oeistream],
                       fmt: str = "binary")

      Reads and returns an :ref:`OERecord <OEDataFlow_OERecord>` object
      from a stream. Records can be read from the stream until this function
      returns a *None* value.

      record
        The record to be filled.

      ifs
        The stream to read the record from.

      fmt
        The format to read the record in. The default is "binary". Other formats only used internally.

      .. seealso::

         * :ref:`OERecord <OEDataFlow_OERecord>`
         * :ref:`oeistream <OEPlatform_oeistream>`


.. oe:language:: python

   .. oe:function:: read_record

      **read_record** is an alias to the
      :oe:func:`OEDataFlow::OEReadRecord` function.

   .. oe:function:: read_records

      **read_records** is an iterator for the
      :oe:func:`OEDataFlow::OEReadRecord` function.

