1 ------------------------------------------------------------------------------
3 -- GNAT RUN-TIME COMPONENTS --
5 -- A D A . S T R I N G S . W I D E _ S E A R C H --
9 -- Copyright (C) 1992-2010, 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 the search functions from Ada.Strings.Wide_Fixed.
33 -- They are separated out because they are shared by Ada.Strings.Wide_Bounded
34 -- and Ada.Strings.Wide_Unbounded, and we don't want to drag other irrelevant
35 -- stuff from Ada.Strings.Wide_Fixed when using the other two packages. We
36 -- make this a private package, since user programs should access these
37 -- subprograms via one of the standard string packages.
39 with Ada
.Strings
.Wide_Maps
;
41 private package Ada
.Strings
.Wide_Search
is
45 (Source
: Wide_String;
46 Pattern
: Wide_String;
47 Going
: Direction
:= Forward
;
48 Mapping
: Wide_Maps
.Wide_Character_Mapping
:=
49 Wide_Maps
.Identity
) return Natural;
52 (Source
: Wide_String;
53 Pattern
: Wide_String;
54 Going
: Direction
:= Forward
;
55 Mapping
: Wide_Maps
.Wide_Character_Mapping_Function
) return Natural;
58 (Source
: Wide_String;
59 Set
: Wide_Maps
.Wide_Character_Set
;
60 Test
: Membership
:= Inside
;
61 Going
: Direction
:= Forward
) return Natural;
64 (Source
: Wide_String;
65 Pattern
: Wide_String;
67 Going
: Direction
:= Forward
;
68 Mapping
: Wide_Maps
.Wide_Character_Mapping
:= Wide_Maps
.Identity
)
72 (Source
: Wide_String;
73 Pattern
: Wide_String;
75 Going
: Direction
:= Forward
;
76 Mapping
: Wide_Maps
.Wide_Character_Mapping_Function
) return Natural;
79 (Source
: Wide_String;
80 Set
: Wide_Maps
.Wide_Character_Set
;
82 Test
: Membership
:= Inside
;
83 Going
: Direction
:= Forward
) return Natural;
85 function Index_Non_Blank
86 (Source
: Wide_String;
87 Going
: Direction
:= Forward
) return Natural;
89 function Index_Non_Blank
90 (Source
: Wide_String;
92 Going
: Direction
:= Forward
) return Natural;
95 (Source
: Wide_String;
96 Pattern
: Wide_String;
97 Mapping
: Wide_Maps
.Wide_Character_Mapping
:= Wide_Maps
.Identity
)
101 (Source
: Wide_String;
102 Pattern
: Wide_String;
103 Mapping
: Wide_Maps
.Wide_Character_Mapping_Function
) return Natural;
106 (Source
: Wide_String;
107 Set
: Wide_Maps
.Wide_Character_Set
) return Natural;
110 (Source
: Wide_String;
111 Set
: Wide_Maps
.Wide_Character_Set
;
114 First
: out Positive;
116 pragma Ada_2012
(Find_Token
);
119 (Source
: Wide_String;
120 Set
: Wide_Maps
.Wide_Character_Set
;
122 First
: out Positive;
125 end Ada
.Strings
.Wide_Search
;