AdaCL.Strings

Tools for changing strings.

More...

Entities

Simple types

Hex_Digit

Subprograms

Append_All
Append_All
Append_First
Append_First
Append_Last
Append_Last
Change_All
Change_All
Change_First
Change_First
Change_Last
Change_Last
Field_End
First_Word
Hash
Hash
Hash
Hash
Insert_All
Insert_All
Insert_First
Insert_First
Insert_Last
Insert_Last
Last_Word
Value

Description

No, I have not created some new String class - yet. Just a few string tools.

Hex_Digit [source]

35 subtype Hex_Digit is Natural range 0 .. 16#F#;

Append_All [source]

129 procedure Append_All
130 (Source : in out Ada.Strings.Unbounded.Unbounded_String;
131 Search : in String;
132 New_Item : in String;
133 Mapping : in Ada.Strings.Maps.Character_Mapping := Ada.Strings.Maps.Identity);

Searches for all occurences of text "Search" and Inserts text "Insert" after the found text but only when "Insert" is not allready there.

Source of type Unbounded_String

String to be changed

Search of type String

String we look for

New_Item of type String

String we want to insert

Mapping of type Character_Mapping

Search mapping

Append_All [source]

144 procedure Append_All
145 (Source : in out Ada.Strings.Unbounded.Unbounded_String;
146 Search : in String;
147 New_Item : in String;
148 Mapping : in Ada.Strings.Maps.Character_Mapping := Ada.Strings.Maps.Identity;
149 Count : out Natural);

Searches for all occurences of text "Search" and Inserts text "Insert" after the found text but only when "Insert" is not allready there.

Source of type Unbounded_String

String to be changed

Search of type String

String we look for

New_Item of type String

String we want to insert

Mapping of type Character_Mapping

Search mapping

Count of type Natural

Count of replaces done

Append_First [source]

159 procedure Append_First
160 (Source : in out Ada.Strings.Unbounded.Unbounded_String;
161 Search : in String;
162 New_Item : in String;
163 Mapping : in Ada.Strings.Maps.Character_Mapping := Ada.Strings.Maps.Identity);

Searches for first occurence of text "Search" and Inserts text "Insert" after the found text but only when "Insert" is not allready there.

Source of type Unbounded_String

String to be changed

Search of type String

String we look for

New_Item of type String

String we want to insert

Mapping of type Character_Mapping

Search mapping

Append_First [source]

174 procedure Append_First
175 (Source : in out Ada.Strings.Unbounded.Unbounded_String;
176 Search : in String;
177 New_Item : in String;
178 Mapping : in Ada.Strings.Maps.Character_Mapping := Ada.Strings.Maps.Identity;
179 Found : out Boolean);

Searches for first occurence of text "Search" and Inserts text "Insert" after the found text but only when "Insert" is not allready there.

Source of type Unbounded_String

String to be changed

Search of type String

String we look for

New_Item of type String

String we want to insert

Mapping of type Character_Mapping

Search mapping

Found of type Boolean

Count of replaces done

Append_Last [source]

189 procedure Append_Last
190 (Source : in out Ada.Strings.Unbounded.Unbounded_String;
191 Search : in String;
192 New_Item : in String;
193 Mapping : in Ada.Strings.Maps.Character_Mapping := Ada.Strings.Maps.Identity);

Searches for last occurence of text "Search" and Inserts text "Insert" after the found text but only when "Insert" is not allready there.

Source of type Unbounded_String

String to be changed

Search of type String

String we look for

New_Item of type String

String we want to insert

Mapping of type Character_Mapping

Search mapping

Append_Last [source]

204 procedure Append_Last
205 (Source : in out Ada.Strings.Unbounded.Unbounded_String;
206 Search : in String;
207 New_Item : in String;
208 Mapping : in Ada.Strings.Maps.Character_Mapping := Ada.Strings.Maps.Identity;
209 Found : out Boolean);

Searches for last occurence of text "Search" and Inserts text "Insert" after the found text but only when "Insert" is not allready there.

Source of type Unbounded_String

String to be changed

Search of type String

String we look for

New_Item of type String

String we want to insert

Mapping of type Character_Mapping

Search mapping

Found of type Boolean

Count of replaces done

Change_All [source]

44 procedure Change_All
45 (Source : in out Ada.Strings.Unbounded.Unbounded_String;
46 Search : in String;
47 Replace : in String;
48 Mapping : in Ada.Strings.Maps.Character_Mapping := Ada.Strings.Maps.Identity);

Replace all Search with Replace

Source of type Unbounded_String

String to be changed

Search of type String

String we look for

Replace of type String

String we want to have

Mapping of type Character_Mapping

Search mapping

Change_All [source]

58 procedure Change_All
59 (Source : in out Ada.Strings.Unbounded.Unbounded_String;
60 Search : in String;
61 Replace : in String;
62 Mapping : in Ada.Strings.Maps.Character_Mapping := Ada.Strings.Maps.Identity;
63 Count : out Natural);

Replace all Search with Replace and Count how often it was done.

Source of type Unbounded_String

String to be changed

Search of type String

String we look for

Replace of type String

String we want to have

Mapping of type Character_Mapping

Search mapping

Count of type Natural

Count of replaces done

Change_First [source]

72 procedure Change_First
73 (Source : in out Ada.Strings.Unbounded.Unbounded_String;
74 Search : in String;
75 Replace : in String;
76 Mapping : in Ada.Strings.Maps.Character_Mapping := Ada.Strings.Maps.Identity);

Replace all Search with Replace

Source of type Unbounded_String

String to be changed

Search of type String

String we look for

Replace of type String

String we want to have

Mapping of type Character_Mapping

Search mapping

Change_First [source]

86 procedure Change_First
87 (Source : in out Ada.Strings.Unbounded.Unbounded_String;
88 Search : in String;
89 Replace : in String;
90 Mapping : in Ada.Strings.Maps.Character_Mapping := Ada.Strings.Maps.Identity;
91 Found : out Boolean);

Replace First Search with Replace and return success flag.

Source of type Unbounded_String

String to be changed

Search of type String

String we look for

Replace of type String

String we want to have

Mapping of type Character_Mapping

Search mapping

Found of type Boolean

Count of replaces done

Change_Last [source]

100 procedure Change_Last
101 (Source : in out Ada.Strings.Unbounded.Unbounded_String;
102 Search : in String;
103 Replace : in String;
104 Mapping : in Ada.Strings.Maps.Character_Mapping := Ada.Strings.Maps.Identity);

Replace Last Search with Replace

Source of type Unbounded_String

: String we look for

Search of type String

: String to be changed

Replace of type String

: String we want to have

Mapping of type Character_Mapping

: Search mapping

Change_Last [source]

114 procedure Change_Last
115 (Source : in out Ada.Strings.Unbounded.Unbounded_String;
116 Search : in String;
117 Replace : in String;
118 Mapping : in Ada.Strings.Maps.Character_Mapping := Ada.Strings.Maps.Identity;
119 Found : out Boolean);

Replace Last Search with Replace and return success flag.

Source of type Unbounded_String

String to be changed

Search of type String

String we look for

Replace of type String

String we want to have

Mapping of type Character_Mapping

Search mapping

Found of type Boolean

Count of replaces done

Field_End [source]

217 function Field_End
218 (Source : in String;
219 Field_Separator : in Character;
220 Starting_At : Positive)
221 return Natural with
222 Pure_Function;

Return the end-of-field position in Data after "Starting_Index", assuming that fields are separated by the Field_Separator. If there's no Field_Separator, return the end of the Data.

Source of type String

String to search in

Field_Separator of type Character

Field seperator.

Starting_At of type Positive

Start search at.

Return value

First_Word [source]

358 function First_Word
359 (Source : in String;
360 Delimiter : in Character := ' ')
361 return String with
362 Pure_Function;

Extract the first word.

Source of type String

String to search

Delimiter of type Character

word delimiter. Default is space.

Return value

Hash [source]

315 function Hash (Key : String) return Natural with
316 Pure_Function;

Hash function for booch components.

Key of type String

String to calculate a hash value form

Return value

hash value

Hash [source]

323 function Hash (Key : Ada.Strings.Unbounded.Unbounded_String) return Natural with
324 Pure_Function;

Hash function for booch components.

Key of type Unbounded_String

String to calculate a hash value form

Return value

hash value

Hash [source]

331 function Hash (Key : Ada.Strings.Unbounded.Unbounded_String) return Ada.Containers.Hash_Type with
332 Pure_Function;

Hash function for Ada components.

Key of type Unbounded_String

String to calculate a hash value form

Return value

hash value

Hash [source]

339 function Hash (Key : String) return Ada.Containers.Hash_Type with
340 Pure_Function;

Hash function for Ada components.

Key of type String

String to calculate a hash value form

Return value

hash value

Insert_All [source]

259 procedure Insert_All
260 (Source : in out Ada.Strings.Unbounded.Unbounded_String;
261 Search : in String;
262 New_Item : in String;
263 Mapping : in Ada.Strings.Maps.Character_Mapping := Ada.Strings.Maps.Identity);

Searches for all occurences of text "Search" and Inserts text "Insert" bevore when "Insert" is there.

Source of type Unbounded_String

Search mapping

Search of type String

String we want to insert

New_Item of type String

String we look for

Mapping of type Character_Mapping

String to be changed

Insert_All [source]

273 procedure Insert_All
274 (Source : in out Ada.Strings.Unbounded.Unbounded_String;
275 Search : in String;
276 New_Item : in String;
277 Mapping : in Ada.Strings.Maps.Character_Mapping := Ada.Strings.Maps.Identity;
278 Count : out Natural);

Searches for all occurences of text "Search" and Inserts text "Insert" bevore when "Insert" is there.

Source of type Unbounded_String

String to be changed

Search of type String

String we look for

New_Item of type String

String we want to insert

Mapping of type Character_Mapping

Search mapping

Count of type Natural

Count of replaces done

Insert_First [source]

231 procedure Insert_First
232 (Source : in out Ada.Strings.Unbounded.Unbounded_String;
233 Search : in String;
234 New_Item : in String;
235 Mapping : in Ada.Strings.Maps.Character_Mapping := Ada.Strings.Maps.Identity);

Searches for first occurence of text "Search" and Inserts text "Insert" bevore when "Insert" is there.

Source of type Unbounded_String

String to be changed

Search of type String

String we look for

New_Item of type String

String we want to insert

Mapping of type Character_Mapping

Search mapping

Insert_First [source]

245 procedure Insert_First
246 (Source : in out Ada.Strings.Unbounded.Unbounded_String;
247 Search : in String;
248 New_Item : in String;
249 Mapping : in Ada.Strings.Maps.Character_Mapping := Ada.Strings.Maps.Identity;
250 Found : out Boolean);

Searches for first occurence of text "Search" and Inserts text "Insert" bevore when "Insert" is there.

Source of type Unbounded_String

String to be changed

Search of type String

String we look for

New_Item of type String

String we want to insert

Mapping of type Character_Mapping

Search mapping

Found of type Boolean

Count of replaces done

Insert_Last [source]

287 procedure Insert_Last
288 (Source : in out Ada.Strings.Unbounded.Unbounded_String;
289 Search : in String;
290 New_Item : in String;
291 Mapping : in Ada.Strings.Maps.Character_Mapping := Ada.Strings.Maps.Identity);

Searches for last occurence of text "Search" and Inserts text "Insert" bevore when "Insert" is there.

Source of type Unbounded_String

String to be changed

Search of type String

String we look for

New_Item of type String

String we want to insert

Mapping of type Character_Mapping

Search mapping

Insert_Last [source]

301 procedure Insert_Last
302 (Source : in out Ada.Strings.Unbounded.Unbounded_String;
303 Search : in String;
304 New_Item : in String;
305 Mapping : in Ada.Strings.Maps.Character_Mapping := Ada.Strings.Maps.Identity;
306 Found : out Boolean);

Searches for last occurence of text "Search" and Inserts text "Insert" bevore when "Insert" is there.

Source of type Unbounded_String

String to be changed

Search of type String

String we look for

New_Item of type String

String we want to insert

Mapping of type Character_Mapping

Search mapping

Found of type Boolean

Count of replaces done

Last_Word [source]

369 function Last_Word
370 (Source : in String;
371 Delimiter : in Character := ' ')
372 return String with
373 Pure_Function;

Extract the last word.

Source of type String

String to search

Delimiter of type Character

word delimiter. Default is space.

Return value

Value [source]

347 function Value (Image : Ada.Strings.Unbounded.Unbounded_String) return Integer is
348 (Integer'Value (Ada.Strings.Unbounded.To_String (Image))) with
349 Pure_Function, Inline;

convert String into Integer

Image of type Unbounded_String

String to to be shown as Integer

Return value

pased integer value