-- This package provides a means for creating line iterators from
-- the contents of files, and for saving line iterators to files.
--
with Lines;
package Files is

    subtype Iterator is Lines.Iterator;

    function Create (From_File : in String) return Iterator;
    --
    -- Creates an initialized iterator of lines from the contents of the
    -- specified file. If the file is empty, sets "Done" to True; other-
    -- wise, resets the iterator to the first line in the iterator.
    --
    -- Raises "IO_Failure" if difficulty is encountered opening,
    -- reading from, or closing the specified file.

    procedure Save (To_File : in String; This_Iterator : in out Iterator);
    --
    -- Saves the specified iterator to the specified file by writing
    -- the string image of each line to the file.
    --
    -- Raises "Not_Initialized" if the specified iterator is not initialized.
    --
    -- Raises "IO_Failure" if difficulty is encountered opening,
    -- writing to, or closing the specified file.

    Not_Initialized : exception;
    Io_Failure : exception;

end Files;