16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
------------------------------------------------------------------------------
-- Natools.String_Slices provide an object that represents a substring of a --
-- shared parent string. --
------------------------------------------------------------------------------
private with Natools.References;
package Natools.String_Slices is
pragma Preelaborate (String_Slices);
-----------------------
-- String range type --
-----------------------
|
>
|
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
------------------------------------------------------------------------------
-- Natools.String_Slices provide an object that represents a substring of a --
-- shared parent string. --
------------------------------------------------------------------------------
private with Natools.References;
private with Natools.Storage_Pools;
package Natools.String_Slices is
pragma Preelaborate (String_Slices);
-----------------------
-- String range type --
-----------------------
|
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
|
function Duplicate (S : Slice) return Slice;
-- Create a new parent string and a slice designating it.
-- This does not copy parts of S parent string outside of S range.
-- Semantically equivalent to (To_Slice (To_String (S))).
private
type Access_In_Default_Pool is access Boolean;
-- Access type only used to infer default storage pool
package String_Refs is new References
(String,
Access_In_Default_Pool'Storage_Pool,
Access_In_Default_Pool'Storage_Pool);
type Slice is tagged record
Bounds : String_Range := (1, 0);
Ref : String_Refs.Reference;
end record;
Null_Slice : constant Slice := ((1, 0), Ref => <>);
end Natools.String_Slices;
|
<
<
<
|
|
|
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
|
function Duplicate (S : Slice) return Slice;
-- Create a new parent string and a slice designating it.
-- This does not copy parts of S parent string outside of S range.
-- Semantically equivalent to (To_Slice (To_String (S))).
private
package String_Refs is new References
(String,
Storage_Pools.Access_In_Default_Pool'Storage_Pool,
Storage_Pools.Access_In_Default_Pool'Storage_Pool);
type Slice is tagged record
Bounds : String_Range := (1, 0);
Ref : String_Refs.Reference;
end record;
Null_Slice : constant Slice := ((1, 0), Ref => <>);
end Natools.String_Slices;
|