[gcc/]
[official-gcc.git] / gcc / ada / a-strsea.ads
blobbf8686815c02cb8eb75c15ea7cc98bf113678bf7
1 ------------------------------------------------------------------------------
2 -- --
3 -- GNAT RUN-TIME COMPONENTS --
4 -- --
5 -- A D A . S T R I N G S . S E A R C H --
6 -- --
7 -- S p e c --
8 -- --
9 -- Copyright (C) 1992-2010, 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 ------------------------------------------------------------------------------
32 -- This package contains the search functions from Ada.Strings.Fixed. They
33 -- are separated out because they are shared by Ada.Strings.Bounded and
34 -- Ada.Strings.Unbounded, and we don't want to drag other irrelevant stuff
35 -- from Ada.Strings.Fixed when using the other two packages. We make this
36 -- a private package, since user programs should access these subprograms
37 -- via one of the standard string packages.
39 with Ada.Strings.Maps;
41 private package Ada.Strings.Search is
42 pragma Preelaborate;
44 function Index
45 (Source : String;
46 Pattern : String;
47 Going : Direction := Forward;
48 Mapping : Maps.Character_Mapping := Maps.Identity) return Natural;
50 function Index
51 (Source : String;
52 Pattern : String;
53 Going : Direction := Forward;
54 Mapping : Maps.Character_Mapping_Function) return Natural;
56 function Index
57 (Source : String;
58 Set : Maps.Character_Set;
59 Test : Membership := Inside;
60 Going : Direction := Forward) return Natural;
62 function Index
63 (Source : String;
64 Pattern : String;
65 From : Positive;
66 Going : Direction := Forward;
67 Mapping : Maps.Character_Mapping := Maps.Identity) return Natural;
69 function Index
70 (Source : String;
71 Pattern : String;
72 From : Positive;
73 Going : Direction := Forward;
74 Mapping : Maps.Character_Mapping_Function) return Natural;
76 function Index
77 (Source : String;
78 Set : Maps.Character_Set;
79 From : Positive;
80 Test : Membership := Inside;
81 Going : Direction := Forward) return Natural;
83 function Index_Non_Blank
84 (Source : String;
85 Going : Direction := Forward) return Natural;
87 function Index_Non_Blank
88 (Source : String;
89 From : Positive;
90 Going : Direction := Forward) return Natural;
92 function Count
93 (Source : String;
94 Pattern : String;
95 Mapping : Maps.Character_Mapping := Maps.Identity) return Natural;
97 function Count
98 (Source : String;
99 Pattern : String;
100 Mapping : Maps.Character_Mapping_Function) return Natural;
102 function Count
103 (Source : String;
104 Set : Maps.Character_Set) return Natural;
106 procedure Find_Token
107 (Source : String;
108 Set : Maps.Character_Set;
109 From : Positive;
110 Test : Membership;
111 First : out Positive;
112 Last : out Natural);
114 procedure Find_Token
115 (Source : String;
116 Set : Maps.Character_Set;
117 Test : Membership;
118 First : out Positive;
119 Last : out Natural);
121 end Ada.Strings.Search;