1------------------------------------------------------------------------------
2--                                                                          --
3--                         GNAT RUN-TIME COMPONENTS                         --
4--                                                                          --
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          --
6--                                                                          --
7--                                 S p e c                                  --
8--                                                                          --
9--          Copyright (C) 1992-2018, Free Software Foundation, Inc.         --
10--                                                                          --
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.                                     --
17--                                                                          --
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.               --
21--                                                                          --
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/>.                                          --
26--                                                                          --
27-- GNAT was originally developed  by the GNAT team at  New York University. --
28-- Extensive contributions were provided by Ada Core Technologies Inc.      --
29--                                                                          --
30------------------------------------------------------------------------------
31
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.
38
39with Ada.Strings.Wide_Wide_Maps;
40
41private package Ada.Strings.Wide_Wide_Search is
42   pragma Preelaborate;
43
44   function Index
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;
50
51   function Index
52     (Source  : Wide_Wide_String;
53      Pattern : Wide_Wide_String;
54      Going   : Direction := Forward;
55      Mapping : Wide_Wide_Maps.Wide_Wide_Character_Mapping_Function)
56      return Natural;
57
58   function Index
59     (Source : Wide_Wide_String;
60      Set    : Wide_Wide_Maps.Wide_Wide_Character_Set;
61      Test   : Membership := Inside;
62      Going  : Direction  := Forward) return Natural;
63
64   function Index
65     (Source  : Wide_Wide_String;
66      Pattern : Wide_Wide_String;
67      From    : Positive;
68      Going   : Direction := Forward;
69      Mapping : Wide_Wide_Maps.Wide_Wide_Character_Mapping :=
70                  Wide_Wide_Maps.Identity)
71      return Natural;
72
73   function Index
74     (Source  : Wide_Wide_String;
75      Pattern : Wide_Wide_String;
76      From    : Positive;
77      Going   : Direction := Forward;
78      Mapping : Wide_Wide_Maps.Wide_Wide_Character_Mapping_Function)
79      return Natural;
80
81   function Index
82     (Source  : Wide_Wide_String;
83      Set     : Wide_Wide_Maps.Wide_Wide_Character_Set;
84      From    : Positive;
85      Test    : Membership := Inside;
86      Going   : Direction := Forward) return Natural;
87
88   function Index_Non_Blank
89     (Source : Wide_Wide_String;
90      Going  : Direction := Forward) return Natural;
91
92   function Index_Non_Blank
93     (Source : Wide_Wide_String;
94      From   : Positive;
95      Going  : Direction := Forward) return Natural;
96
97   function Count
98     (Source  : Wide_Wide_String;
99      Pattern : Wide_Wide_String;
100      Mapping : Wide_Wide_Maps.Wide_Wide_Character_Mapping :=
101                  Wide_Wide_Maps.Identity)
102      return Natural;
103
104   function Count
105     (Source  : Wide_Wide_String;
106      Pattern : Wide_Wide_String;
107      Mapping : Wide_Wide_Maps.Wide_Wide_Character_Mapping_Function)
108      return Natural;
109
110   function Count
111     (Source : Wide_Wide_String;
112      Set    : Wide_Wide_Maps.Wide_Wide_Character_Set) return Natural;
113
114   procedure Find_Token
115     (Source : Wide_Wide_String;
116      Set    : Wide_Wide_Maps.Wide_Wide_Character_Set;
117      From   : Positive;
118      Test   : Membership;
119      First  : out Positive;
120      Last   : out Natural);
121
122   procedure Find_Token
123     (Source : Wide_Wide_String;
124      Set    : Wide_Wide_Maps.Wide_Wide_Character_Set;
125      Test   : Membership;
126      First  : out Positive;
127      Last   : out Natural);
128
129end Ada.Strings.Wide_Wide_Search;
130