[Ada] Read directory in Ada.Directories.Start_Search rather than Get_Next_Entry
authorPatrick Bernardi <bernardi@adacore.com>
Wed, 22 Dec 2021 21:32:41 +0000 (16:32 -0500)
committerPierre-Marie de Rodat <derodat@adacore.com>
Fri, 7 Jan 2022 16:24:15 +0000 (16:24 +0000)
commita64478660ee95930773d356760e39e05fe0147fe
tree9ac3b7f48f09479a3ad723ac9949166aa3afd7e2
parent9b573d421a457852da09253f966246fcc0e16a27
[Ada] Read directory in Ada.Directories.Start_Search rather than Get_Next_Entry

gcc/ada/

* libgnat/a-direct.adb (Search_Data): Remove type.
(Directory_Vectors): New package instantiation.
(Search_State): New type.
(Fetch_Next_Entry): Remove.
(Close): Remove.
(Finalize): Rewritten.
(Full_Name): Ditto.
(Get_Next_Entry): Return next entry from Search results vector
rather than querying the directory directly using readdir.
(Kind): Rewritten.
(Modification_Time): Rewritten.
(More_Entries): Use Search state cursor to determine if more
entries are available for users to read.
(Simple_Name): Rewritten.
(Size): Rewritten.
(Start_Search_Internal): Rewritten to load the contents of the
directory that matches the pattern and filter into the search
object.
* libgnat/a-direct.ads (Search_Type): New type.
(Search_Ptr): Ditto.
(Directory_Entry_Type): Rewritten to support new Start_Search
procedure.
* libgnat/s-filatt.ads (File_Length_Attr): New function.
gcc/ada/libgnat/a-direct.adb
gcc/ada/libgnat/a-direct.ads
gcc/ada/libgnat/s-filatt.ads