1 ------------------------------------------------------------------------------
3 -- GNAT RUN-TIME COMPONENTS --
5 -- A D A . S T R I N G S . W I D E _ W I D E _ S E A R C H --
9 -- Copyright (C) 1992-2023, Free Software Foundation, Inc. --
11 -- GNAT is free software; you can redistribute it and/or modify it under --
12 -- terms of the GNU General Public License as published by the Free Soft- --
13 -- ware Foundation; either version 3, or (at your option) any later ver- --
14 -- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
15 -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
16 -- or FITNESS FOR A PARTICULAR PURPOSE. --
18 -- As a special exception under Section 7 of GPL version 3, you are granted --
19 -- additional permissions described in the GCC Runtime Library Exception, --
20 -- version 3.1, as published by the Free Software Foundation. --
22 -- You should have received a copy of the GNU General Public License and --
23 -- a copy of the GCC Runtime Library Exception along with this program; --
24 -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
25 -- <http://www.gnu.org/licenses/>. --
27 -- GNAT was originally developed by the GNAT team at New York University. --
28 -- Extensive contributions were provided by Ada Core Technologies Inc. --
30 ------------------------------------------------------------------------------
32 -- This package contains search functions from Ada.Strings.Wide_Wide_Fixed.
33 -- They are separated because Ada.Strings.Wide_Wide_Bounded shares these
34 -- search functions with Ada.Strings.Wide_Wide_Unbounded, and we don't want to
35 -- drag in other irrelevant stuff from Ada.Strings.Wide_Wide_Fixed when using
36 -- the other two packages. We make this a private package, since user programs
37 -- should access these subprograms via one of the standard string packages.
39 with Ada
.Strings
.Wide_Wide_Maps
;
41 private package Ada
.Strings
.Wide_Wide_Search
is
45 (Source
: Wide_Wide_String
;
46 Pattern
: Wide_Wide_String
;
47 Going
: Direction
:= Forward
;
48 Mapping
: Wide_Wide_Maps
.Wide_Wide_Character_Mapping
:=
49 Wide_Wide_Maps
.Identity
) return Natural;
52 (Source
: Wide_Wide_String
;
53 Pattern
: Wide_Wide_String
;
54 Going
: Direction
:= Forward
;
55 Mapping
: Wide_Wide_Maps
.Wide_Wide_Character_Mapping_Function
)
59 (Source
: Wide_Wide_String
;
60 Set
: Wide_Wide_Maps
.Wide_Wide_Character_Set
;
61 Test
: Membership
:= Inside
;
62 Going
: Direction
:= Forward
) return Natural;
65 (Source
: Wide_Wide_String
;
66 Pattern
: Wide_Wide_String
;
68 Going
: Direction
:= Forward
;
69 Mapping
: Wide_Wide_Maps
.Wide_Wide_Character_Mapping
:=
70 Wide_Wide_Maps
.Identity
)
74 (Source
: Wide_Wide_String
;
75 Pattern
: Wide_Wide_String
;
77 Going
: Direction
:= Forward
;
78 Mapping
: Wide_Wide_Maps
.Wide_Wide_Character_Mapping_Function
)
82 (Source
: Wide_Wide_String
;
83 Set
: Wide_Wide_Maps
.Wide_Wide_Character_Set
;
85 Test
: Membership
:= Inside
;
86 Going
: Direction
:= Forward
) return Natural;
88 function Index_Non_Blank
89 (Source
: Wide_Wide_String
;
90 Going
: Direction
:= Forward
) return Natural;
92 function Index_Non_Blank
93 (Source
: Wide_Wide_String
;
95 Going
: Direction
:= Forward
) return Natural;
98 (Source
: Wide_Wide_String
;
99 Pattern
: Wide_Wide_String
;
100 Mapping
: Wide_Wide_Maps
.Wide_Wide_Character_Mapping
:=
101 Wide_Wide_Maps
.Identity
)
105 (Source
: Wide_Wide_String
;
106 Pattern
: Wide_Wide_String
;
107 Mapping
: Wide_Wide_Maps
.Wide_Wide_Character_Mapping_Function
)
111 (Source
: Wide_Wide_String
;
112 Set
: Wide_Wide_Maps
.Wide_Wide_Character_Set
) return Natural;
115 (Source
: Wide_Wide_String
;
116 Set
: Wide_Wide_Maps
.Wide_Wide_Character_Set
;
119 First
: out Positive;
123 (Source
: Wide_Wide_String
;
124 Set
: Wide_Wide_Maps
.Wide_Wide_Character_Set
;
126 First
: out Positive;
129 end Ada
.Strings
.Wide_Wide_Search
;