-- --
-- B o d y --
-- --
--- Copyright (C) 2001-2005 Adacore, Inc. --
+-- Copyright (C) 2001-2008, AdaCore --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNAT; see file COPYING. If not, write --
--- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, --
--- MA 02111-1307, USA. --
+-- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
+-- Boston, MA 02110-1301, USA. --
-- --
-- As a special exception, if other files instantiate generics from this --
-- unit, or you link this unit with other files to produce an executable, --
is
File_Regexp : constant Regexp.Regexp := Regexp.Compile (File_Pattern);
Index : Natural := 0;
+ Quit : Boolean;
procedure Read_Directory (Directory : Dir_Name_Str);
-- Open Directory and read all entries. This routine is called
-- recursively for each sub-directories.
function Make_Pathname (Dir, File : String) return String;
- -- Returns the pathname for File by adding Dir as prefix.
+ -- Returns the pathname for File by adding Dir as prefix
-------------------
-- Make_Pathname --
--------------------
procedure Read_Directory (Directory : Dir_Name_Str) is
- Dir : Dir_Type;
Buffer : String (1 .. 2_048);
Last : Natural;
- Quit : Boolean;
+
+ Dir : Dir_Type;
+ pragma Warnings (Off, Dir);
begin
Open (Dir, Directory);
begin
if Regexp.Match (Dir_Entry, File_Regexp) then
- Quit := False;
Index := Index + 1;
begin
and then OS_Lib.Is_Directory (Pathname)
then
Read_Directory (Pathname);
+ exit when Quit;
end if;
end;
end loop;
end Read_Directory;
begin
+ Quit := False;
Read_Directory (Root_Directory);
end Find;
is
File_Regexp : constant Regexp.Regexp :=
Regexp.Compile (File_Pattern, Glob => True);
- Dir : Dir_Type;
+
+ Dir : Dir_Type;
+ pragma Warnings (Off, Dir);
+
Buffer : String (1 .. 2_048);
Last : Natural;
end;
-- Exit if Quit set by call to Action, either at this level
- -- or at at some lower recursive call to Next_Level.
+ -- or at some lower recursive call to Next_Level.
exit Dir_Iterator when Quit;
end loop Dir_Iterator;
end if;
end Read;
+ -- Start of processing for Wildcard_Iterator
+
begin
if Path = "" then
return;