blob: 2872b8c0d942c8083a228eccacd9413708f3bcce (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
|
-- Programmed by Jedidiah Barber
-- Released into the public domain
package FLTK.Filenames is
Max_Path_Length : constant Natural;
subtype Path_String is String
with Dynamic_Predicate => Path_String'Length <= Max_Path_Length;
type Comparison is (Lesser, Equal, Greater);
type Compare_Function is access function
(A, B : in String)
return Comparison;
function Alpha_Sort
(A, B : in String)
return Comparison;
function Case_Alpha_Sort
(A, B : in String)
return Comparison;
function Numeric_Sort
(A, B : in String)
return Comparison;
function Case_Numeric_Sort
(A, B : in String)
return Comparison;
type File_List is new Wrapper with private;
function Length
(This : in File_List)
return Natural;
function Item
(This : in File_List;
Index : in Positive)
return Path_String
with Pre => Index in 1 .. This.Length;
Open_URI_Error : exception;
function Decode_URI
(URI : in Path_String)
return Path_String;
procedure Open_URI
(URI : in Path_String);
function Absolute
(Name : in Path_String)
return Path_String;
function Absolute
(Name : in Path_String;
Changed : out Boolean)
return Path_String;
function Relative
(Name : in Path_String)
return Path_String;
function Relative
(Name : in Path_String;
Changed : out Boolean)
return Path_String;
function Expand
(Name : in Path_String)
return Path_String;
function Expand
(Name : in Path_String;
Changed : out Boolean)
return Path_String;
function Base_Name
(Name : in Path_String)
return Path_String;
function Extension
(Name : in Path_String)
return Path_String;
function Set_Extension
(Name : in Path_String;
Suffix : in String)
return Path_String;
function Is_Directory
(Name : in Path_String)
return Boolean;
function Get_Listing
(Name : in Path_String;
Sort : in not null Compare_Function := Numeric_Sort'Access)
return File_List;
function Match
(Input, Pattern : in String)
return Boolean;
private
type File_List is new Wrapper with record
Entries : Interfaces.C.int := 0;
end record;
overriding procedure Finalize
(This : in out File_List);
fl_path_max : constant Interfaces.C.int;
pragma Import (C, fl_path_max, "fl_path_max");
Max_Path_Length : constant Natural := Natural (fl_path_max);
pragma Inline (Length);
pragma Inline (Item);
pragma Inline (Is_Directory);
pragma Inline (Match);
end FLTK.Filenames;
|