1 ------------------------------------------------------------------------------
3 -- GNAT RUN-TIME COMPONENTS --
5 -- A D A . D I R E C T O R I E S . V A L I D I T Y --
10 -- Copyright (C) 2004-2010, Free Software Foundation, Inc. --
12 -- GNAT is free software; you can redistribute it and/or modify it under --
13 -- terms of the GNU General Public License as published by the Free Soft- --
14 -- ware Foundation; either version 3, or (at your option) any later ver- --
15 -- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
16 -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
17 -- or FITNESS FOR A PARTICULAR PURPOSE. --
19 -- As a special exception under Section 7 of GPL version 3, you are granted --
20 -- additional permissions described in the GCC Runtime Library Exception, --
21 -- version 3.1, as published by the Free Software Foundation. --
23 -- You should have received a copy of the GNU General Public License and --
24 -- a copy of the GCC Runtime Library Exception along with this program; --
25 -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
26 -- <http://www.gnu.org/licenses/>. --
28 -- GNAT was originally developed by the GNAT team at New York University. --
29 -- Extensive contributions were provided by Ada Core Technologies Inc. --
31 ------------------------------------------------------------------------------
33 -- This is the POSIX version of this package
35 package body Ada
.Directories
.Validity
is
37 ---------------------------------
38 -- Is_Path_Name_Case_Sensitive --
39 ---------------------------------
41 function Is_Path_Name_Case_Sensitive
return Boolean is
44 end Is_Path_Name_Case_Sensitive
;
46 ------------------------
47 -- Is_Valid_Path_Name --
48 ------------------------
50 function Is_Valid_Path_Name
(Name
: String) return Boolean is
52 -- A path name cannot be empty and cannot contain any NUL character
54 if Name
'Length = 0 then
58 for J
in Name
'Range loop
59 if Name
(J
) = ASCII
.NUL
then
65 -- If Name does not contain any NUL character, it is valid
68 end Is_Valid_Path_Name
;
70 --------------------------
71 -- Is_Valid_Simple_Name --
72 --------------------------
74 function Is_Valid_Simple_Name
(Name
: String) return Boolean is
76 -- A file name cannot be empty and cannot contain a slash ('/') or
79 if Name
'Length = 0 then
83 for J
in Name
'Range loop
84 if Name
(J
) = '/' or else Name
(J
) = ASCII
.NUL
then
90 -- If Name does not contain any slash or NUL, it is valid
93 end Is_Valid_Simple_Name
;
99 function OpenVMS
return Boolean is
108 function Windows
return Boolean is
113 end Ada
.Directories
.Validity
;