On this page
- Availability and ownership
- Import and instantiate
- Contract and lifecycle reading
- API 001
- API 002
- API 003
- API 004
- API 005
- API 006
- API 007
- API 008
- API 009
- API 010
- API 011
- API 012
- API 013
- API 014
- API 015
- API 016
- API 017
- API 018
- API 019
- API 020
- API 021
- API 022
- API 023
- API 024
- API 025
- API 026
- API 027
- API 028
- API 029
- API 030
- API 031
- API 032
- API 033
- API 034
- API 035
- API 036
- API 037
- API 038
- API 039
- API 040
- API 041
- API 042
Ada.Strings.Wide_Fixed
Ada.Strings.Fixed's operations for Wide_String (RM A.4.7).
Read the family guide for representation, selection and resource rules. The complete declaration page retains exact signatures/contracts; the source specification is the implementation baseline.
Availability and ownership
Generated with Ada.Strings.Fixed from one text (tools/library), with the same contracts for Wide_String and Ada.Strings.Wide_Maps. Its bodies are proved (test/programs/prove/library-ada-strings-bounded, with Wide_Bounded).
A client proof uses these contracts without proving the body again (see library assurance). Global => null excludes package-global effects, not changes made through an in out argument.
Import and instantiate
with Ada.Strings.Wide_Fixed;import Ada.Strings.Wide_Fixed;
A Vibe module imports this unit's names with from Ada.Strings.Wide_Fixed import Name; see library use across syntaxes. In Varc, keep each name's declared spelling and write & on arguments the call changes.
Contract and lifecycle reading
A Pre condition is the caller's obligation; a Post is what a normal return guarantees. What a postcondition does not state, a client cannot assume. Ghost functions are for contracts and ghost code. The family guide describes copying, lifetime, order and cost.
API 001
Occurs_After (declaration) — The occurrence of Pattern after Source's first Done characters (at Source'First + Done), each character of Source mapped: Done <= Source'Length - Pattern'Length, and each mapped character there the pattern's (its expression is in the body, so that a client's proof does not take it apart)
Declared interface:
function Occurs_After (Source, Pattern : Wide_String; Done : Natural; Mapping : Wide_Maps.Wide_Character_Mapping) return Boolean
with Ghost, Global => null;API 002
Count_After (declaration) — How many times Pattern occurs after Source's first Done characters without overlapping, each found from the left.
Declared interface:
function Count_After (Source, Pattern : Wide_String; Done : Natural; Mapping : Wide_Maps.Wide_Character_Mapping) return Natural is
(if Done > Source'Length - Pattern'Length then 0
elsif Occurs_After (Source, Pattern, Done, Mapping) then 1 + Count_After (Source, Pattern, Done + Pattern'Length, Mapping)
else Count_After (Source, Pattern, Done + 1, Mapping))
with Ghost, Global => null,
Pre => Pattern'Length > 0 and then Done <= Source'Length,
Post => Count_After'Result <= Source'Length - Done,
Subprogram_Variant => (Decreases => Source'Length - Done);API 003
Count_In (declaration) — How many characters after Source's first Done characters are in Set.
Declared interface:
function Count_In (Source : Wide_String; Set : Wide_Maps.Wide_Character_Set; Done : Natural) return Natural is
(if Done >= Source'Length then 0
else (if Wide_Maps.Is_In (Source (Source'First + Done), Set) then 1 else 0) + Count_In (Source, Set, Done + 1))
with Ghost, Global => null,
Pre => Done <= Source'Length,
Post => Count_In'Result <= Source'Length - Done,
Subprogram_Variant => (Decreases => Source'Length - Done);API 004
Joined (declaration) — A, B and C joined, from 1 (the results of Replace_Slice, Insert and Overwrite)
Declared interface:
function Joined (A, B, C : Wide_String) return Wide_String is
(Wide_String'(for I in 1 .. A'Length + B'Length + C'Length =>
(if I <= A'Length then A (A'First + (I - 1))
elsif I <= A'Length + B'Length then B (B'First + (I - 1 - A'Length))
else C (C'First + (I - 1 - A'Length - B'Length)))))
with Global => null,
Pre => Long_Long_Long_Integer (A'Length) + Long_Long_Long_Integer (B'Length) + Long_Long_Long_Integer (C'Length)
< Verada.Storage.Length_Bound,
Post => Joined'Result'Length = A'Length + B'Length + C'Length
and then Joined'Result'Length < Verada.Storage.Length_Bound
and then Joined'Result'First = 1;API 005
Moved (declaration) — Source fitted to Length characters, as Move fits it (RM A.4.3(56-58)): longer, the characters Drop (or, when Drop is Error, Justify) keeps; shorter, padded with Pad on the side or sides Justify leaves (an odd padding's extra character on the right)
Declared interface:
function Moved (Source : Wide_String; Length : Natural; Drop : Truncation; Justify : Alignment; Pad : Wide_Character) return Wide_String is
(Wide_String'(for I in 1 .. Length =>
(if Source'Length >= Length
then (if Source'Length > Length and then (Drop = Left or else (Drop = Error and then Justify = Right))
then Source (Source'Last - (Length - I))
else Source (Source'First + (I - 1)))
elsif I > (case Justify is when Left => 0, when Right => Length - Source'Length, when Center => (Length - Source'Length) / 2)
and then I - (case Justify is when Left => 0, when Right => Length - Source'Length, when Center => (Length - Source'Length) / 2)
<= Source'Length
then Source (Source'First
+ (I - 1 - (case Justify is when Left => 0, when Right => Length - Source'Length, when Center => (Length - Source'Length) / 2)))
else Pad)))
with Global => null,
Post => Moved'Result'Length = Length and then Moved'Result'First = 1;API 006
Fits (declaration) — Whether Move may fit Source to Length characters: where the RM raises Length_Error, the characters Drop = Error would lose are not all Pad.
Declared interface:
function Fits (Source : Wide_String; Length : Natural; Drop : Truncation; Justify : Alignment; Pad : Wide_Character) return Boolean is
(Source'Length <= Length or else Drop /= Error
or else (Justify = Left and then (for all I in Source'First + Length .. Source'Last => Source (I) = Pad))
or else (Justify = Right and then (for all I in Source'First .. Source'Last - Length => Source (I) = Pad)))
with Global => null;API 007
Move (declaration) — Source into Target, fitted to Target's length.
Declared interface:
procedure Move (Source : Wide_String; Target : out Wide_String; Drop : Truncation := Error; Justify : Alignment := Left; Pad : Wide_Character := Wide_Space)
with Global => null,
Pre => Fits (Source, Target'Length, Drop, Justify, Pad),
Post => Target = Moved (Source, Target'Length, Drop, Justify, Pad);API 008
Index (declaration) — The first (or last) place in Source where Pattern occurs, each character of Source mapped, searching from From on (Forward) or up to From (Backward); or 0.
Declared interface:
function Index (Source : Wide_String; Pattern : Wide_String; From : Positive; Going : Direction := Forward;
Mapping : Wide_Maps.Wide_Character_Mapping := Wide_Maps.Identity) return Natural
with Global => null,
Pre => Pattern'Length > 0 and then From in Source'Range,
Post => (if Going = Forward
then (if Index'Result = 0
then (for all D in From - Source'First .. Source'Length - Pattern'Length => not Occurs_After (Source, Pattern, D, Mapping))
else Index'Result >= From and then Index'Result - Source'First <= Source'Length - Pattern'Length
and then Occurs_After (Source, Pattern, Index'Result - Source'First, Mapping)
and then (for all D in From - Source'First .. Index'Result - Source'First - 1 => not Occurs_After (Source, Pattern, D, Mapping)))
else (if Index'Result = 0
then (for all D in 0 .. From - Source'First + 1 - Pattern'Length => not Occurs_After (Source, Pattern, D, Mapping))
else Index'Result >= Source'First and then Index'Result - Source'First <= From - Source'First + 1 - Pattern'Length
and then Occurs_After (Source, Pattern, Index'Result - Source'First, Mapping)
and then (for all D in Index'Result - Source'First + 1 .. From - Source'First + 1 - Pattern'Length => not Occurs_After (Source, Pattern, D, Mapping))));API 009
Index (declaration) — The first (or last) place in Source where Pattern occurs, each character of Source mapped, searching from From on (Forward) or up to From (Backward); or 0.
Declared interface:
function Index (Source : Wide_String; Pattern : Wide_String; From : Positive; Going : Direction := Forward;
Mapping : Wide_Maps.Wide_Character_Mapping_Function) return Natural
with Global => null,
Pre => Pattern'Length > 0 and then Mapping /= null and then From in Source'Range,
Post => Index'Result = 0 or else (Index'Result >= Source'First and then Index'Result - Source'First <= Source'Length - Pattern'Length);API 010
Index (declaration) — The first (or last) place in Source where Pattern occurs, each character of Source mapped, or 0.
Declared interface:
function Index (Source : Wide_String; Pattern : Wide_String; Going : Direction := Forward;
Mapping : Wide_Maps.Wide_Character_Mapping := Wide_Maps.Identity) return Natural
with Global => null,
Pre => Pattern'Length > 0,
Post => (if Index'Result = 0
then (for all D in 0 .. Source'Length - Pattern'Length => not Occurs_After (Source, Pattern, D, Mapping))
else Index'Result >= Source'First and then Index'Result - Source'First <= Source'Length - Pattern'Length
and then Occurs_After (Source, Pattern, Index'Result - Source'First, Mapping)
-- (unmapped, the characters there are the pattern's, and so the slice)
and then (if Mapping = Wide_Maps.Identity
then (for all I in Index'Result .. Index'Result + (Pattern'Length - 1) =>
Source (I) = Pattern (Pattern'First + (I - Index'Result)))
and then Source (Index'Result .. Index'Result + (Pattern'Length - 1)) = Pattern)
and then (if Going = Forward
then (for all D in 0 .. Index'Result - Source'First - 1 => not Occurs_After (Source, Pattern, D, Mapping))
else (for all D in Index'Result - Source'First + 1 .. Source'Length - Pattern'Length => not Occurs_After (Source, Pattern, D, Mapping))));API 011
Index (declaration) — The first (or last) place in Source where Pattern occurs, each character of Source mapped, or 0.
Declared interface:
function Index (Source : Wide_String; Pattern : Wide_String; Going : Direction := Forward;
Mapping : Wide_Maps.Wide_Character_Mapping_Function) return Natural
with Global => null,
Pre => Pattern'Length > 0 and then Mapping /= null,
Post => Index'Result = 0 or else (Index'Result >= Source'First and then Index'Result - Source'First <= Source'Length - Pattern'Length);API 012
Index (declaration) — The first (or last) place, from From on (Forward) or up to From (Backward), whose character is in Set (Test Inside) or not (Outside); or 0.
Declared interface:
function Index (Source : Wide_String; Set : Wide_Maps.Wide_Character_Set; From : Positive; Test : Membership := Inside;
Going : Direction := Forward) return Natural
with Global => null,
Pre => From in Source'Range,
Post => (if Going = Forward
then (if Index'Result = 0
then (for all I in From .. Source'Last => Wide_Maps.Is_In (Source (I), Set) /= (Test = Inside))
else Index'Result in From .. Source'Last
and then Wide_Maps.Is_In (Source (Index'Result), Set) = (Test = Inside)
and then (for all I in From .. Index'Result - 1 => Wide_Maps.Is_In (Source (I), Set) /= (Test = Inside)))
else (if Index'Result = 0
then (for all I in Source'First .. From => Wide_Maps.Is_In (Source (I), Set) /= (Test = Inside))
else Index'Result in Source'First .. From
and then Wide_Maps.Is_In (Source (Index'Result), Set) = (Test = Inside)
and then (for all I in Index'Result .. From => (if I > Index'Result then Wide_Maps.Is_In (Source (I), Set) /= (Test = Inside)))));API 013
Index (declaration) — The first (or last) place, from From on (Forward) or up to From (Backward), whose character is in Set (Test Inside) or not (Outside); or 0.
Declared interface:
function Index (Source : Wide_String; Set : Wide_Maps.Wide_Character_Set; Test : Membership := Inside; Going : Direction := Forward) return Natural
with Global => null,
Post => (if Index'Result = 0
then (for all I in Source'Range => Wide_Maps.Is_In (Source (I), Set) /= (Test = Inside))
else Index'Result in Source'Range
and then Wide_Maps.Is_In (Source (Index'Result), Set) = (Test = Inside)
and then (if Going = Forward
then (for all I in Source'First .. Index'Result - 1 => Wide_Maps.Is_In (Source (I), Set) /= (Test = Inside))
else (for all I in Index'Result .. Source'Last => (if I > Index'Result then Wide_Maps.Is_In (Source (I), Set) /= (Test = Inside)))));API 014
Index_Non_Blank (declaration) — The first (or last) character, from From on or up to From, that is not a space; or 0.
Declared interface:
function Index_Non_Blank (Source : Wide_String; From : Positive; Going : Direction := Forward) return Natural
with Global => null,
Pre => From in Source'Range,
Post => (if Going = Forward
then (if Index_Non_Blank'Result = 0
then (for all I in From .. Source'Last => Source (I) = Wide_Space)
else Index_Non_Blank'Result in From .. Source'Last
and then Source (Index_Non_Blank'Result) /= Wide_Space
and then (for all I in From .. Index_Non_Blank'Result - 1 => Source (I) = Wide_Space))
else (if Index_Non_Blank'Result = 0
then (for all I in Source'First .. From => Source (I) = Wide_Space)
else Index_Non_Blank'Result in Source'First .. From
and then Source (Index_Non_Blank'Result) /= Wide_Space
and then (for all I in Index_Non_Blank'Result .. From => (if I > Index_Non_Blank'Result then Source (I) = Wide_Space))));API 015
Index_Non_Blank (declaration) — The first (or last) character of Source that is not a space, or 0.
Declared interface:
function Index_Non_Blank (Source : Wide_String; Going : Direction := Forward) return Natural
with Global => null,
Post => (if Index_Non_Blank'Result = 0
then (for all I in Source'Range => Source (I) = Wide_Space)
else Index_Non_Blank'Result in Source'Range
and then Source (Index_Non_Blank'Result) /= Wide_Space
and then (if Going = Forward
then (for all I in Source'Range => (if I < Index_Non_Blank'Result then Source (I) = Wide_Space))
else (for all I in Source'Range => (if I > Index_Non_Blank'Result then Source (I) = Wide_Space))));API 016
Count (declaration) — How many times Pattern occurs, without overlapping, each character of Source mapped.
Declared interface:
function Count (Source : Wide_String; Pattern : Wide_String; Mapping : Wide_Maps.Wide_Character_Mapping := Wide_Maps.Identity) return Natural
with Global => null,
Pre => Pattern'Length > 0,
Post => Count'Result = Count_After (Source, Pattern, 0, Mapping);API 017
Count (declaration) — How many times Pattern occurs, without overlapping, each character of Source mapped.
Declared interface:
function Count (Source : Wide_String; Pattern : Wide_String; Mapping : Wide_Maps.Wide_Character_Mapping_Function) return Natural
with Global => null,
Pre => Pattern'Length > 0 and then Mapping /= null,
Post => Count'Result <= Source'Length;API 018
Count (declaration) — How many characters are in Set.
Declared interface:
function Count (Source : Wide_String; Set : Wide_Maps.Wide_Character_Set) return Natural
with Global => null,
Post => Count'Result = Count_In (Source, Set, 0);API 019
Find_Token (declaration) — The first run of characters from From on that are all in Set (Test Inside) or all not (Outside), as long as it goes: First .. Last; First = From and Last = 0 when there is none.
Declared interface:
procedure Find_Token (Source : Wide_String; Set : Wide_Maps.Wide_Character_Set; From : Positive; Test : Membership;
First : out Positive; Last : out Natural)
with Global => null,
Pre => From in Source'Range,
Post => (if Last = 0
then First = From
and then (for all I in From .. Source'Last => Wide_Maps.Is_In (Source (I), Set) /= (Test = Inside))
else First in From .. Last and then Last <= Source'Last
and then (for all I in From .. First - 1 => Wide_Maps.Is_In (Source (I), Set) /= (Test = Inside))
and then (for all I in First .. Last => Wide_Maps.Is_In (Source (I), Set) = (Test = Inside))
and then (Last = Source'Last or else Wide_Maps.Is_In (Source (Last + 1), Set) /= (Test = Inside)));API 020
Find_Token (declaration) — As Find_Token from Source'First (First = Source'First and Last = 0 when there is none)
Declared interface:
procedure Find_Token (Source : Wide_String; Set : Wide_Maps.Wide_Character_Set; Test : Membership;
First : out Positive; Last : out Natural)
with Global => null,
Pre => Source'First > 0,
Post => (if Last = 0
then First = Source'First
and then (for all I in Source'Range => Wide_Maps.Is_In (Source (I), Set) /= (Test = Inside))
else First in Source'First .. Last and then Last <= Source'Last
and then (for all I in Source'First .. First - 1 => Wide_Maps.Is_In (Source (I), Set) /= (Test = Inside))
and then (for all I in First .. Last => Wide_Maps.Is_In (Source (I), Set) = (Test = Inside))
and then (Last = Source'Last or else Wide_Maps.Is_In (Source (Last + 1), Set) /= (Test = Inside)));API 021
Translate (declaration) — Each character mapped.
Declared interface:
function Translate (Source : Wide_String; Mapping : Wide_Maps.Wide_Character_Mapping) return Wide_String
with Global => null,
Post => Translate'Result'Length = Source'Length and then Translate'Result'First = 1
and then (for all I in 1 .. Source'Length => Translate'Result (I) = Wide_Maps.Value (Mapping, Source (Source'First + (I - 1))));API 022
Translate (declaration) — Each character mapped.
Declared interface:
procedure Translate (Source : in out Wide_String; Mapping : Wide_Maps.Wide_Character_Mapping)
with Global => null,
Post => (for all I in Source'Range => Source (I) = Wide_Maps.Value (Mapping, Source'Old (I)));API 023
Translate (declaration) — Each character mapped.
Declared interface:
function Translate (Source : Wide_String; Mapping : Wide_Maps.Wide_Character_Mapping_Function) return Wide_String
with Global => null,
Pre => Mapping /= null,
Post => Translate'Result'Length = Source'Length and then Translate'Result'First = 1;API 024
Translate (declaration) — Each character mapped.
Declared interface:
procedure Translate (Source : in out Wide_String; Mapping : Wide_Maps.Wide_Character_Mapping_Function)
with Global => null,
Pre => Mapping /= null;API 025
Replace_Slice (declaration) — The characters Low .. High replaced by By (By inserted before Low when High < Low)
Declared interface:
function Replace_Slice (Source : Wide_String; Low : Positive; High : Natural; By : Wide_String) return Wide_String
with Global => null,
Pre => Low - 1 <= Source'Last and then (if High < Low then Low >= Source'First else High >= Source'First - 1),
Post => Replace_Slice'Result'First = 1 and then Replace_Slice'Result'Length < Verada.Storage.Length_Bound
and then Replace_Slice'Result
= Joined (Source (Source'First .. Low - 1), By, (if High >= Source'Last then "" else Source (Integer'Max (High + 1, Low) .. Source'Last)));API 026
Replace_Slice (declaration) — The characters Low .. High replaced by By (By inserted before Low when High < Low)
Declared interface:
procedure Replace_Slice (Source : in out Wide_String; Low : Positive; High : Natural; By : Wide_String;
Drop : Truncation := Error; Justify : Alignment := Left; Pad : Wide_Character := Wide_Space)
with Global => null,
Pre => Low - 1 <= Source'Last and then (if High < Low then Low >= Source'First else High >= Source'First - 1)
and then Fits (Replace_Slice (Source, Low, High, By), Source'Length, Drop, Justify, Pad),
Post => Source = Moved (Replace_Slice (Source'Old, Low, High, By), Source'Length, Drop, Justify, Pad);API 027
Insert (declaration) — New_Item inserted before Before.
Declared interface:
function Insert (Source : Wide_String; Before : Positive; New_Item : Wide_String) return Wide_String
with Global => null,
Pre => Before - 1 <= Source'Last and then Before >= Source'First,
Post => Insert'Result'First = 1 and then Insert'Result'Length < Verada.Storage.Length_Bound
and then Insert'Result = Joined (Source (Source'First .. Before - 1), New_Item, Source (Before .. Source'Last));API 028
Insert (declaration) — New_Item inserted before Before.
Declared interface:
procedure Insert (Source : in out Wide_String; Before : Positive; New_Item : Wide_String; Drop : Truncation := Error)
with Global => null,
Pre => Before - 1 <= Source'Last and then Before >= Source'First
and then Fits (Insert (Source, Before, New_Item), Source'Length, Drop, Left, Wide_Space),
Post => Source = Moved (Insert (Source'Old, Before, New_Item), Source'Length, Drop, Left, Wide_Space);API 029
Overwrite (declaration) — New_Item written over the characters from Position on, the string extended where it runs past the end.
Declared interface:
function Overwrite (Source : Wide_String; Position : Positive; New_Item : Wide_String) return Wide_String
with Global => null,
Pre => Position - 1 <= Source'Last and then Position >= Source'First,
Post => Overwrite'Result'First = 1 and then Overwrite'Result'Length < Verada.Storage.Length_Bound
and then Overwrite'Result
= Joined (Source (Source'First .. Position - 1), New_Item,
(if New_Item'Length > Source'Last - Position then "" else Source (Position + New_Item'Length .. Source'Last)));API 030
Overwrite (declaration) — New_Item written over the characters from Position on, the string extended where it runs past the end.
Declared interface:
procedure Overwrite (Source : in out Wide_String; Position : Positive; New_Item : Wide_String; Drop : Truncation := Right)
with Global => null,
Pre => Position - 1 <= Source'Last and then Position >= Source'First
and then Fits (Overwrite (Source, Position, New_Item), Source'Length, Drop, Left, Wide_Space),
Post => Source = Moved (Overwrite (Source'Old, Position, New_Item), Source'Length, Drop, Left, Wide_Space);API 031
Delete (declaration) — The characters From .. Through removed (none when Through < From)
Declared interface:
function Delete (Source : Wide_String; From : Positive; Through : Natural) return Wide_String
with Global => null,
Pre => Through < From or else (From - 1 <= Source'Last and then Through >= Source'First - 1),
Post => Delete'Result'First = 1 and then Delete'Result'Length < Verada.Storage.Length_Bound
and then Delete'Result
= (if Through < From then Joined (Source, "", "")
else Joined (Source (Source'First .. From - 1), "", (if Through >= Source'Last then "" else Source (Integer'Max (Through + 1, From) .. Source'Last))));API 032
Delete (declaration) — The characters From .. Through removed (none when Through < From)
Declared interface:
procedure Delete (Source : in out Wide_String; From : Positive; Through : Natural; Justify : Alignment := Left; Pad : Wide_Character := Wide_Space)
with Global => null,
Pre => Through < From or else (From - 1 <= Source'Last and then Through >= Source'First - 1),
Post => Source = Moved (Delete (Source'Old, From, Through), Source'Length, Error, Justify, Pad);API 033
Trim (declaration) — Source without its leading spaces (Left), trailing ones (Right) or both.
Declared interface:
function Trim (Source : Wide_String; Side : Trim_End) return Wide_String
with Global => null,
Post => Trim'Result'First = 1 and then Trim'Result'Length < Verada.Storage.Length_Bound
and then (if Index_Non_Blank (Source) = 0 then Trim'Result'Length = 0
else Trim'Result
= Joined (Source ((if Side = Right then Source'First else Index_Non_Blank (Source))
.. (if Side = Left then Source'Last else Index_Non_Blank (Source, Backward))), "", ""));API 034
Trim (declaration) — Source without its leading spaces (Left), trailing ones (Right) or both.
Declared interface:
procedure Trim (Source : in out Wide_String; Side : Trim_End; Justify : Alignment := Left; Pad : Wide_Character := Wide_Space)
with Global => null,
Post => Source = Moved (Trim (Source'Old, Side), Source'Length, Error, Justify, Pad);API 035
Trim (declaration) — Source without its leading characters that are in Left and its trailing ones in Right.
Declared interface:
function Trim (Source : Wide_String; Left, Right : Wide_Maps.Wide_Character_Set) return Wide_String
with Global => null,
Post => Trim'Result'First = 1 and then Trim'Result'Length < Verada.Storage.Length_Bound
and then (if Index (Source, Left, Outside) = 0 or else Index (Source, Right, Outside, Backward) < Index (Source, Left, Outside)
then Trim'Result'Length = 0
else Trim'Result = Joined (Source (Index (Source, Left, Outside) .. Index (Source, Right, Outside, Backward)), "", ""));API 036
Trim (declaration) — Source without its leading characters that are in Left and its trailing ones in Right.
Declared interface:
procedure Trim (Source : in out Wide_String; Left, Right : Wide_Maps.Wide_Character_Set; Justify : Alignment := Strings.Left; Pad : Wide_Character := Wide_Space)
with Global => null,
Post => Source = Moved (Trim (Source'Old, Left, Right), Source'Length, Error, Justify, Pad);API 037
Head (declaration) — The first Count characters of Source, padded with Pad.
Declared interface:
function Head (Source : Wide_String; Count : Natural; Pad : Wide_Character := Wide_Space) return Wide_String
with Global => null,
Post => Head'Result'Length = Count and then Head'Result'First = 1
and then (for all I in 1 .. Count => Head'Result (I) = (if I <= Source'Length then Source (Source'First + (I - 1)) else Pad));API 038
Head (declaration) — The first Count characters of Source, padded with Pad.
Declared interface:
procedure Head (Source : in out Wide_String; Count : Natural; Justify : Alignment := Left; Pad : Wide_Character := Wide_Space)
with Global => null,
Pre => Fits (Head (Source, Count, Pad), Source'Length, Error, Justify, Pad),
Post => Source = Moved (Head (Source'Old, Count, Pad), Source'Length, Error, Justify, Pad);API 039
Tail (declaration) — The last Count characters of Source, padded on the left with Pad.
Declared interface:
function Tail (Source : Wide_String; Count : Natural; Pad : Wide_Character := Wide_Space) return Wide_String
with Global => null,
Post => Tail'Result'Length = Count and then Tail'Result'First = 1
and then (for all I in 1 .. Count =>
Tail'Result (I) = (if I > Count - Source'Length then Source (Source'Last - (Count - I)) else Pad));API 040
Tail (declaration) — The last Count characters of Source, padded on the left with Pad.
Declared interface:
procedure Tail (Source : in out Wide_String; Count : Natural; Justify : Alignment := Left; Pad : Wide_Character := Wide_Space)
with Global => null,
Pre => Fits (Tail (Source, Count, Pad), Source'Length, Error, Justify, Pad),
Post => Source = Moved (Tail (Source'Old, Count, Pad), Source'Length, Error, Justify, Pad);API 041
"*" (declaration) — Left copies of Right.
Declared interface:
function "*" (Left : Natural; Right : Wide_Character) return Wide_String
with Global => null,
Post => "*"'Result'Length = Left and then "*"'Result'First = 1
and then (for all I in 1 .. Left => "*"'Result (I) = Right);API 042
"*" (declaration) — Left copies of Right: Right's characters first, then each a copy of the one Right'Length before it.
Declared interface:
function "*" (Left : Natural; Right : Wide_String) return Wide_String
with Global => null,
Post => Long_Long_Long_Integer ("*"'Result'Length) = Long_Long_Long_Integer (Left) * Long_Long_Long_Integer (Right'Length)
and then "*"'Result'First = 1
and then (for all I in 1 .. "*"'Result'Length =>
"*"'Result (I) = (if I <= Right'Length then Right (Right'First + (I - 1)) else "*"'Result (I - Right'Length)));