|
DataMuseum.dkPresents historical artifacts from the history of: Rational R1000/400 |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about Rational R1000/400 Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - download
Length: 54272 (0xd400) Types: Ada Source Notes: 03_class, FILE, R1k_Segment, e3_tag, package body Vstring_Assign, seg_005833
└─⟦8527c1e9b⟧ Bits:30000544 8mm tape, Rational 1000, Arrival backup of disks in PAM's R1000 └─⟦5a81ac88f⟧ »Space Info Vol 1« └─⟦this⟧
with Arithmetic; use Arithmetic; with Vstring_Heap; use Vstring_Heap; with Vstring_Type; use Vstring_Type; package body Vstring_Assign is ------------------------------------------------------------------------------ -- Copyright 1988 - 1991 by Rational, Santa Clara, California. -- -- All Rights Reserved. -- -- Permission to use, copy, modify, and distribute this software and its -- documentation for any purpose and without fee is hereby granted, -- provided that the above copyright notice(s) appear in all copies and that -- both that copyright notice(s) and this permission notice appear in -- supporting documentation, and that the name of Rational not be used in -- advertising or publicity pertaining to distribution of the software -- without specific, written prior permission. -- -- Rational disclaims all warranties with regard to this software, including -- all implied warranties of merchantability and fitness, in no event shall -- Rational be liable for any special, indirect or consequential damages or -- any damages whatsoever resulting from loss of use, data or profits, whether -- in an action of contract, negligence or other tortious action, arising out -- of or in connection with the use or performance of this software. ------------------------------------------------------------------------------ --\x0c procedure Assign (Vstr1 : in out Vstring_Data; Vstr2 : Vstring_Data) is Pos2 : S_Natural := Vstr2.Length; begin if Pos2 > Vstr1.Maximum_Length then Pos2 := Vstr1.Maximum_Length; end if; Vstr1.Chars (1 .. Pos2) := Vstr2.Chars (1 .. Pos2); Vstr1.Length := Pos2; end Assign; --\x0c procedure Assign (Vstr1 : in out Vstring_Data; Vstr2 : Vstring) is Pos2 : S_Natural := Vstr2.Length; begin if Pos2 > Vstr1.Maximum_Length then Pos2 := Vstr1.Maximum_Length; end if; Vstr1.Chars (1 .. Pos2) := Vstr2.Chars (1 .. Pos2); Vstr1.Length := Pos2; end Assign; --\x0c procedure Assign (Vstr1 : in out Vstring_Data; Vstr2 : E_String) is Pos2 : S_Natural := Vstr2'Length; begin if Pos2 > Vstr1.Maximum_Length then Pos2 := Vstr1.Maximum_Length; end if; Vstr1.Chars (1 .. Pos2) := Vstr2 (Vstr2'First .. Vstr2'First + Pos2 - 1); Vstr1.Length := Pos2; end Assign; --\x0c procedure Assign (Vstr1 : in out Vstring_Data; Vstr2 : Character) is begin if Vstr1.Maximum_Length < 1 then return; end if; Vstr1.Chars (1) := Vstr2; Vstr1.Length := 1; end Assign; --\x0c procedure Assign (Vstr1 : in out Vstring_Data; Vstr2 : Character; Copies : S_Natural) is begin if Vstr1.Maximum_Length < Copies then Vstr1.Chars := (others => Vstr2); Vstr1.Length := Vstr1.Maximum_Length; else Vstr1.Chars (1 .. Copies) := (others => Vstr2); Vstr1.Length := Copies; end if; end Assign; --\x0c procedure Assign (Vstr1 : Vstring; Vstr2 : Vstring_Data) is Pos2 : S_Natural := Vstr2.Length; begin if Pos2 > Vstr1.Maximum_Length then Pos2 := Vstr1.Maximum_Length; end if; Vstr1.Chars (1 .. Pos2) := Vstr2.Chars (1 .. Pos2); Vstr1.Length := Pos2; end Assign; --\x0c procedure Assign (Vstr1 : Vstring; Vstr2 : Vstring) is Pos2 : S_Natural := Vstr2.Length; begin if Pos2 > Vstr1.Maximum_Length then Pos2 := Vstr1.Maximum_Length; end if; Vstr1.Chars (1 .. Pos2) := Vstr2.Chars (1 .. Pos2); Vstr1.Length := Pos2; end Assign; --\x0c procedure Assign (Vstr1 : Vstring; Vstr2 : E_String) is Pos2 : S_Natural := Vstr2'Length; begin if Pos2 > Vstr1.Maximum_Length then Pos2 := Vstr1.Maximum_Length; end if; Vstr1.Chars (1 .. Pos2) := Vstr2 (Vstr2'First .. Vstr2'First + Pos2 - 1); Vstr1.Length := Pos2; end Assign; --\x0c procedure Assign (Vstr1 : Vstring; Vstr2 : Character) is begin if Vstr1.Maximum_Length < 1 then return; end if; Vstr1.Chars (1) := Vstr2; Vstr1.Length := 1; end Assign; --\x0c procedure Assign (Vstr1 : Vstring; Vstr2 : Character; Copies : S_Natural) is begin if Vstr1.Maximum_Length < Copies then Vstr1.Chars := (others => Vstr2); Vstr1.Length := Vstr1.Maximum_Length; else Vstr1.Chars (1 .. Copies) := (others => Vstr2); Vstr1.Length := Copies; end if; end Assign; --\x0c procedure Assign_New (Vstr1 : out Vstring; Vstr2 : Vstring_Data) is V : Vstring := New_Vstring (Vstr2.Length); Pos2 : S_Natural := Vstr2.Length; begin Vstr1 := V; V.Chars (1 .. Pos2) := Vstr2.Chars (1 .. Pos2); V.Length := Pos2; end Assign_New; --\x0c procedure Assign_Resize (Vstr1 : in out Vstring; Vstr2 : E_String; Resize_Amount : S_Positive := 256) is ----Just line Assign except that Vstr1 is resized upwards if necessary to -- hold all of Vstr1&Vstr2. Ns : S_Natural; Length : S_Natural := Vstr2'Length; begin Ns := Length; if Vstr1.Maximum_Length < Ns then Ns := Ns + Resize_Amount - 1; Ns := Ns - Ns rem Resize_Amount; Resize_Vstring (Vstr1, Ns); end if; Vstr1.Chars (1 .. Length) := Vstr2; Vstr1.Length := Length; end Assign_Resize; --\x0c procedure Assign_Resize (Vstr1 : in out Vstring; Vstr2 : Vstring_Data; Resize_Amount : S_Positive := 256) is ----Just line Assign except that Vstr1 is resized upwards if necessary to -- hold all of Vstr1&Vstr2. Ns : S_Natural; begin Ns := Vstr2.Length; if Vstr1.Maximum_Length < Ns then Ns := Ns + Resize_Amount - 1; Ns := Ns - Ns rem Resize_Amount; Resize_Vstring (Vstr1, Ns); end if; Vstr1.Chars (1 .. Vstr2.Length) := Vstr2.Chars (1 .. Vstr2.Length); Vstr1.Length := Vstr2.Length; end Assign_Resize; --\x0c procedure Assign_Resize (Vstr1 : in out Vstring; Vstr2 : Vstring; Resize_Amount : S_Positive := 256) is ----Just line Assign except that Vstr1 is resized upwards if necessary to -- hold all of Vstr1&Vstr2. Ns : S_Natural; begin Ns := Vstr2.Length; if Vstr1.Maximum_Length < Ns then Ns := Ns + Resize_Amount - 1; Ns := Ns - Ns rem Resize_Amount; Resize_Vstring (Vstr1, Ns); end if; Vstr1.Chars (1 .. Vstr2.Length) := Vstr2.Chars (1 .. Vstr2.Length); Vstr1.Length := Vstr2.Length; end Assign_Resize; --\x0c procedure Assign_New (Vstr1 : out Vstring; Vstr2 : Vstring) is V : Vstring := New_Vstring (Vstr2.Length); Pos2 : S_Natural := Vstr2.Length; begin Vstr1 := V; V.Chars (1 .. Pos2) := Vstr2.Chars (1 .. Pos2); V.Length := Pos2; end Assign_New; --\x0c procedure Assign_New (Vstr1 : out Vstring; Vstr2 : E_String) is V : Vstring := New_Vstring (Vstr2'Length); Pos2 : S_Natural := Vstr2'Length; begin Vstr1 := V; V.Chars (1 .. Pos2) := Vstr2 (Vstr2'First .. Vstr2'First + Pos2 - 1); V.Length := Pos2; end Assign_New; --\x0c procedure Assign_New (Vstr1 : out Vstring; Vstr2 : Character) is V : Vstring := New_Vstring (1); begin Vstr1 := V; V.Chars (1) := Vstr2; V.Length := 1; end Assign_New; --\x0c procedure Assign_New (Vstr1 : out Vstring; Vstr2 : Character; Copies : S_Natural) is V : Vstring := New_Vstring (Copies); begin Vstr1 := V; V.Chars (1 .. Copies) := (others => Vstr2); V.Length := Copies; end Assign_New; --\x0c procedure Append (Vstr1 : in out Vstring_Data; Vstr2 : Vstring_Data) is Left : S_Natural := Vstr1.Maximum_Length - Vstr1.Length; begin if Left > Vstr2.Length then Left := Vstr2.Length; end if; Vstr1.Chars (Vstr1.Length + 1 .. Vstr1.Length + Left) := Vstr2.Chars (1 .. Left); Vstr1.Length := Vstr1.Length + Left; end Append; --\x0c procedure Append (Vstr1 : in out Vstring_Data; Vstr2 : Vstring) is Left : S_Natural := Vstr1.Maximum_Length - Vstr1.Length; begin if Left > Vstr2.Length then Left := Vstr2.Length; end if; Vstr1.Chars (Vstr1.Length + 1 .. Vstr1.Length + Left) := Vstr2.Chars (1 .. Left); Vstr1.Length := Vstr1.Length + Left; end Append; --\x0c procedure Append (Vstr1 : in out Vstring_Data; Vstr2 : E_String) is Left : S_Natural := Vstr1.Maximum_Length - Vstr1.Length; begin if Left > Vstr2'Length then Left := Vstr2'Length; end if; Vstr1.Chars (Vstr1.Length + 1 .. Vstr1.Length + Left) := Vstr2 (Vstr2'First .. Vstr2'First + Left - 1); Vstr1.Length := Vstr1.Length + Left; end Append; --\x0c procedure Append (Vstr1 : in out Vstring_Data; Vstr2 : Character) is Left : S_Natural := Vstr1.Maximum_Length - Vstr1.Length; begin if Left >= 1 then Vstr1.Chars (Vstr1.Length + 1) := Vstr2; Vstr1.Length := Vstr1.Length + 1; end if; end Append; --\x0c procedure Append (Vstr1 : in out Vstring_Data; Vstr2 : Character; Copies : S_Natural) is Left : S_Natural := Vstr1.Maximum_Length - Vstr1.Length; begin if Left > Copies then Left := Copies; end if; Vstr1.Chars (Vstr1.Length + 1 .. Vstr1.Length + Left) := (others => Vstr2); Vstr1.Length := Vstr1.Length + Copies; end Append; --\x0c procedure Append (Vstr1 : Vstring; Vstr2 : Vstring_Data) is Left : S_Natural := Vstr1.Maximum_Length - Vstr1.Length; begin if Left > Vstr2.Length then Left := Vstr2.Length; end if; Vstr1.Chars (Vstr1.Length + 1 .. Vstr1.Length + Left) := Vstr2.Chars (1 .. Left); Vstr1.Length := Vstr1.Length + Left; end Append; --\x0c procedure Append (Vstr1 : Vstring; Vstr2 : Vstring) is Left : S_Natural := Vstr1.Maximum_Length - Vstr1.Length; begin if Left > Vstr2.Length then Left := Vstr2.Length; end if; Vstr1.Chars (Vstr1.Length + 1 .. Vstr1.Length + Left) := Vstr2.Chars (1 .. Left); Vstr1.Length := Vstr1.Length + Left; end Append; --\x0c procedure Append (Vstr1 : Vstring; Vstr2 : E_String) is Left : S_Natural := Vstr1.Maximum_Length - Vstr1.Length; begin if Left > Vstr2'Length then Left := Vstr2'Length; end if; Vstr1.Chars (Vstr1.Length + 1 .. Vstr1.Length + Left) := Vstr2 (Vstr2'First .. Vstr2'First + Left - 1); Vstr1.Length := Vstr1.Length + Left; end Append; --\x0c procedure Append (Vstr1 : Vstring; Vstr2 : Character) is Left : S_Natural := Vstr1.Maximum_Length - Vstr1.Length; begin if Left >= 1 then Vstr1.Chars (Vstr1.Length + 1) := Vstr2; Vstr1.Length := Vstr1.Length + 1; end if; end Append; --\x0c procedure Append (Vstr1 : Vstring; Vstr2 : Character; Copies : S_Natural) is Left : S_Natural := Vstr1.Maximum_Length - Vstr1.Length; begin if Left > Copies then Left := Copies; end if; Vstr1.Chars (Vstr1.Length + 1 .. Vstr1.Length + Left) := (others => Vstr2); Vstr1.Length := Vstr1.Length + Copies; end Append; --\x0c procedure Append_Resize (Vstr1 : in out Vstring; Vstr2 : E_String; Resize_Amount : S_Positive := 256) is ----Just line Append except that Vstr1 is resized upwards if necessary to -- hold all of Vstr1&Vstr2. Ns : S_Natural; Length : S_Natural := Vstr2'Length; begin Ns := Vstr1.Length + Length; if Vstr1.Maximum_Length < Ns then Ns := Ns + Resize_Amount - 1; Ns := Ns - Ns rem Resize_Amount; Resize_Vstring (Vstr1, Ns); end if; Vstr1.Chars (Vstr1.Length + 1 .. Vstr1.Length + Length) := Vstr2 (Vstr2'First .. Vstr2'Last); Vstr1.Length := Vstr1.Length + Length; end Append_Resize; --\x0c procedure Append_Resize (Vstr1 : in out Vstring; Vstr2 : Character; Resize_Amount : S_Positive := 256) is ----Just line Append except that Vstr1 is resized upwards if necessary to -- hold all of Vstr1&Vstr2. Ns : S_Natural; begin Ns := Vstr1.Length + 1; if Vstr1.Maximum_Length < Ns then Ns := Ns + Resize_Amount - 1; Ns := Ns - Ns rem Resize_Amount; Resize_Vstring (Vstr1, Ns); end if; Vstr1.Chars (Vstr1.Length + 1) := Vstr2; Vstr1.Length := Vstr1.Length + 1; end Append_Resize; --\x0c procedure Append_Resize (Vstr1 : in out Vstring; Vstr2 : Character; Copies : S_Natural; Resize_Amount : S_Positive := 256) is ----Just line Append except that Vstr1 is resized upwards if necessary to -- hold all of Vstr1&Vstr2. Ns : S_Natural; begin Ns := Vstr1.Length + Copies; if Vstr1.Maximum_Length < Ns then Ns := Ns + Resize_Amount - 1; Ns := Ns - Ns rem Resize_Amount; Resize_Vstring (Vstr1, Ns); end if; Vstr1.Chars (Vstr1.Length + 1 .. Vstr1.Length + Copies) := (others => Vstr2); Vstr1.Length := Vstr1.Length + Copies; end Append_Resize; --\x0c procedure Append_Resize (Vstr1 : in out Vstring; Vstr2 : Vstring_Data; Resize_Amount : S_Positive := 256) is ----Just line Append except that Vstr1 is resized upwards if necessary to -- hold all of Vstr1&Vstr2. Ns : S_Natural; begin Ns := Vstr1.Length + Vstr2.Length; if Vstr1.Maximum_Length < Ns then Ns := Ns + Resize_Amount - 1; Ns := Ns - Ns rem Resize_Amount; Resize_Vstring (Vstr1, Ns); end if; Vstr1.Chars (Vstr1.Length + 1 .. Vstr1.Length + Vstr2.Length) := Vstr2.Chars (1 .. Vstr2.Length); Vstr1.Length := Vstr1.Length + Vstr2.Length; end Append_Resize; --\x0c procedure Append_Resize (Vstr1 : in out Vstring; Vstr2 : Vstring; Resize_Amount : S_Positive := 256) is ----Just line Append except that Vstr1 is resized upwards if necessary to -- hold all of Vstr1&Vstr2. Ns : S_Natural; begin Ns := Vstr1.Length + Vstr2.Length; if Vstr1.Maximum_Length < Ns then Ns := Ns + Resize_Amount - 1; Ns := Ns - Ns rem Resize_Amount; Resize_Vstring (Vstr1, Ns); end if; Vstr1.Chars (Vstr1.Length + 1 .. Vstr1.Length + Vstr2.Length) := Vstr2.Chars (1 .. Vstr2.Length); Vstr1.Length := Vstr1.Length + Vstr2.Length; end Append_Resize; --\x0c procedure Prepend (Vstr1 : in out Vstring_Data; Vstr2 : Vstring_Data) is Left : S_Natural := Vstr1.Maximum_Length - Vstr1.Length; Right : S_Natural; begin if Left >= Vstr2.Length then ----Come here if 1&2 will both fit in 1. Vstr1.Chars (Vstr2.Length + 1 .. Vstr2.Length + Vstr1.Length) := Vstr1.Chars (1 .. Vstr1.Length); Vstr1.Chars (1 .. Vstr2.Length) := Vstr2.Chars (1 .. Vstr2.Length); Vstr1.Length := Vstr1.Length + Vstr2.Length; elsif Vstr2.ength > Vstr1.Maximum_Length then ----Come here if 2 is longer than 1 can hold. Vstr1.Chars := Vstr2.Chars (1 .. Vstr1.Maximum_Length); Vstr1.Length := Vstr1.Maximum_Length; else ----Come here if 1 must be truncated in order to fit in 2. Vstr1.Chars (Vstr2.Length + 1 .. Vstr1.Maximum_Length) := Vstr1.Chars (1 .. Vstr1.Maximum_Length - Right); Vstr1.Chars (1 .. Vstr2.Length) := Vstr2.Chars (1 .. Vstr2.Length); Vstr1.Length := Vstr1.Maximum_Length; end if; end Prepend; --\x0c procedure Prepend (Vstr1 : in out Vstring_Data; Vstr2 : Vstring) is Left : S_Natural := Vstr1.Maximum_Length - Vstr1.Length; Right : S_Natural; begin if Left >= Vstr2.Length then ----Come here if 1&2 will both fit in 1. Vstr1.Chars (Vstr2.Length + 1 .. Vstr2.Length + Vstr1.Length) := Vstr1.Chars (1 .. Vstr1.Length); Vstr1.Chars (1 .. Vstr2.Length) := Vstr2.Chars (1 .. Vstr2.Length); Vstr1.Length := Vstr1.Length + Vstr2.Length; elsif Vstr2.Length > Vstr1.Maximum_Length then ----Come here if 2 is longer than 1 can hold. Vstr1.Chars := Vstr2.Chars (1 .. Vstr1.Maximum_Length); Vstr1.Length := Vstr1.Maximum_Length; else ----Come here if 1 must be truncated in order to fit in 2. Vstr1.Chars (Vstr2.Length + 1 .. Vstr1.Maximum_Length) := Vstr1.Chars (1 .. Vstr1.Maximum_Length - Right); Vstr1.Chars (1 .. Vstr2.Length) := Vstr2.Chars (1 .. Vstr2.Length); Vstr1.Length := Vstr1.Maximum_Length; end if; end Prepend; --\x0c procedure Prepend (Vstr1 : in out Vstring_Data; Vstr2 : E_String) is Left : S_Natural := Vstr1.Maximum_Length - Vstr1.Length; Right : S_Natural; Vstr2_Length : S_Natural := Vstr2'Length; begin if Left >= Vstr2_Length then ----Come here if 1&2 will both fit in 1. Vstr1.Chars (Vstr2_Length + 1 .. Vstr2_Length + Vstr1.Length) := Vstr1.Chars (1 .. Vstr1.Length); Vstr1.Chars (1 .. Vstr2_Length) := Vstr2 (1 .. Vstr2_Length); Vstr1.Length := Vstr1.Length + Vstr2_Length; elsif Vstr2_Length > Vstr1.Maximum_Length then ----Come here if 2 is longer than 1 can hold. Vstr1.Chars := Vstr2 (Vstr2'First .. Vstr2'First + Vstr1.Maximum_Length - 1); Vstr1.Length := Vstr1.Maximum_Length; else ----Come here if 1 must be truncated in order to fit in 2. Vstr1.Chars (Vstr2_Length + 1 .. Vstr1.Maximum_Length) := Vstr1.Chars (1 .. Vstr1.Maximum_Length - Right); Vstr1.Chars (1 .. Vstr2_Length) := Vstr2; Vstr1.Length := Vstr1.Maximum_Length; end if; end Prepend; --\x0c procedure Prepend (Vstr1 : in out Vstring_Data; Vstr2 : Character) is Left : S_Natural := Vstr1.Maximum_Length - Vstr1.Length; Right : S_Natural; begin if Left >= 1 then ----Come here if 1&2 will both fit in 1. Vstr1.Chars (1 + 1 .. 1 + Vstr1.Length) := Vstr1.Chars (1 .. Vstr1.Length); Vstr1.Chars (1) := Vstr2; Vstr1.Length := Vstr1.Length + 1; elsif 1 > Vstr1.Maximum_Length then ----Come here if 2 is longer than 1 can hold. null; else ----Come here if 1 must be truncated in order to fit in 2. Vstr1.Chars (1 + 1 .. Vstr1.Maximum_Length) := Vstr1.Chars (1 .. Vstr1.Maximum_Length - 1); Vstr1.Chars (1) := Vstr2; end if; end Prepend; --\x0c procedur Prepend (Vstr1 : in out Vstring_Data; Vstr2 : Character; Copies : S_Natural) is Left : S_Natural := Vstr1.Maximum_Length - Vstr1.Length; Right : S_Natural; begin if Left >= Copies then ----Come here if 1&2 will both fit in 1. Vstr1.Chars (Copies + 1 .. Copies + Vstr1.Length) := Vstr1.Chars (1 .. Vstr1.Length); Vstr1.Chars (1 .. Copies) := (others => Vstr2); Vstr1.Length := Vstr1.Length + Copies; elsif Copies > Vstr1.Maximum_Length then ----Come here if 2 is longer than 1 can hold. Vstr1.Chars := (others => Vstr2); Vstr1.Length := Vstr1.Maximum_Length; else ----Come here if 1 must be truncated in order to fit in 2. Vstr1.Chars (Copies + 1 .. Vstr1.Maximum_Length) := Vstr1.Chars (1 .. Vstr1.Maximum_Length - Right); Vstr1.Chars (1 .. Copies) := (others => Vstr2); Vstr1.Length := Vstr1.Maximum_Length; end if; end Prepend; --\x0c procedure Prepend (Vstr1 : Vstring; Vstr2 : Vstring_Data) is Left : S_Natural := Vstr1.Maximum_Length - Vstr1.Length; Right : S_Natural; begin if Left >= Vstr2.Length then ----Come here if 1&2 will both fit in 1. Vstr1.Chars (Vstr2.Length + 1 .. Vstr2.Length + Vstr1.Length) := Vstr1.Chars (1 .. Vstr1.Length); Vstr1.Chars (1 .. Vstr2.Length) := Vstr2.Chars (1 .. Vstr2.Length); Vstr1.Length := Vstr1.Length + Vstr2.Length; elsif Vstr2.Length > Vstr1.Maximum_Length then ----Come here if 2 is longer than 1 can hold. Vstr1.Chars := Vstr2.Chars (1 .. Vstr1.Maximum_Length); Vstr1.Length := Vstr1.Maximum_Length; else ----Come here if 1 must be truncated in order to fit in 2. Vstr1.Chars (Vstr2.Length + 1 .. Vstr1.Maximum_Length) := Vstr1.Chars (1 .. Vstr1.Maximum_Length - Right); Vstr1.Chars (1 .. Vstr2.Length) := Vstr2.Chars (1 .. Vstr2.Length); Vstr1.Length := Vstr1.Maximum_Length; end if; end Prepend; --\x0c procedure Prepend (Vstr1 : Vstring; Vstr2 : Vstring) is Left : S_Natural := Vstr1.Maximum_Length - Vstr1.Length; Right : S_Natural; begin if Left >= Vstr2.Length then ----Come here if 1&2 will both fit in 1. Vstr1.Chars (Vstr2.Length + 1 .. Vstr2.Length + Vstr1.Length) := Vstr1.Chars (1 .. Vstr1.Length); Vstr1.Chars (1 .. Vstr2.Length) := Vstr2.Chars (1 .. Vstr2.Length); Vstr1.Length := Vstr1.Length + Vstr2.Length; elsif Vstr2.Length > Vstr1.Maximum_Length then ----Come here if 2 is longer than 1 cn hold. Vstr1.Chars := Vstr2.Chars (1 .. Vstr1.Maximum_Length); Vstr1.Length := Vstr1.Maximum_Length; else ----Come here if 1 must be truncated in order to fit in 2. Vstr1.Chars (Vstr2.Length + 1 .. Vstr1.Maximum_Length) := Vstr1.Chars (1 .. Vstr1.Maximum_Length - Right); Vstr1.Chars (1 .. Vstr2.Length) := Vstr2.Chars (1 .. Vstr2.Length); Vstr1.Length := Vstr1.Maximum_Length; end if; end Prepend; --\x0c procedure Prepend (Vstr1 : Vstring; Vstr2 : E_String) is Left : S_Natural := Vstr1.Maximum_Length - Vstr1.Length; Right : S_Natural; Vstr2_Length : S_Natural := Vstr2'Length; begin if Left >= Vstr2_Length then ----Come here if 1&2 will both fit in 1. Vstr1.Chars (Vstr2_Length + 1 .. Vstr2_Length + Vstr1.Length) := Vstr1.Chars (1 .. Vstr1.Length); Vstr1.Chars (1 .. Vstr2_Length) := Vstr2; Vstr1.Length := Vstr1.Length + Vstr2_Length; elsif Vstr2_Length > Vstr1.Maximum_Length then ----Come here if 2 is longer than 1 can hold. Vstr1.Chars := Vstr2 (Vstr2'First .. Vstr2'First + Vstr1.Maximum_Length - 1); Vstr1.Length := Vstr1.Maximum_Length; else ----Come here if 1 must be truncated in order to fit in 2. Vstr1.Chars (Vstr2_Length + 1 .. Vstr1.Maximum_Length) := Vstr1.Chars (1 .. Vstr1.Maximum_Length - Right); Vstr1.Chars (1 .. Vstr2_Length) := Vstr2; Vstr1.Length := Vstr1.Maximum_Length; end if; end Prepend; --\x0c procedure Prepend (Vstr1 : Vstring; Vstr2 : Character) is Left : S_Natural := Vstr1.Maximum_Length - Vstr1.Length; Right : S_Natural; begin if Left >= 1 then ----Come here if 1&2 will both fit in 1. Vstr1.Chars (1 + 1 .. 1 + Vstr1.Length) := Vstr1.Chars (1 .. Vstr1.Length); Vstr1.Chars (1) := Vstr2; Vstr1.Length := Vstr1.Length + 1; elsif 1 > Vstr1.Maximum_Length then ----Come here if 2 is longer than 1 can hold. null; else ----Come here if 1 must be truncated in order to fit in 2. Vstr1.Chars (1 + 1 .. Vstr1.Maximum_Length) := Vstr1.Chars (1 .. Vstr1.Maximum_Length - 1); Vstr1.Chars (1) := Vstr2; end if; end Prepend; --\x0c procedure Prepend (Vstr1 : Vstring; Vstr2 : Character; Copies : S_Natural) is Left : S_Natural := Vstr1.Maximum_Length - Vstr1.Length; Right : S_Natural; begin if Left >= Copies then ----Come here if 1&2 will both fit in 1. Vstr1.Chars (Copies + 1 .. Copies + Vstr1.Length) := Vstr1.Chars (1 .. Vstr1.Length); Vstr1.Chars (1 .. Copies) := (others => Vstr2); Vstr1.Length := Vstr1.Length + Copies; elsif Copies > Vstr1.Maximum_Length then ----Come here if 2 is longer than 1 can hold. Vstr1.Chars := (others => Vstr2); Vstr1.Length := Vstr1.Maximum_Length; else ----Come here if 1 must be truncated in order to fit in 2. Vstr1.Chars (Copies + 1 .. Vstr1.Maximum_Length) := Vstr1.Chars (1 .. Vstr1.Maximum_Length - Right); Vstr1.Chars (1 .. Copies) := (others => Vstr2); Vstr1.Length := Vstr1.Maximum_Length; end if; end Prepend; --\x0c end Vstring_Assign;
nblk1=34 nid=0 hdr6=68 [0x00] rec0=19 rec1=00 rec2=01 rec3=008 [0x01] rec0=18 rec1=00 rec2=02 rec3=00c [0x02] rec0=00 rec1=00 rec2=34 rec3=016 [0x03] rec0=20 rec1=00 rec2=03 rec3=05c [0x04] rec0=01 rec1=00 rec2=33 rec3=024 [0x05] rec0=1f rec1=00 rec2=04 rec3=010 [0x06] rec0=00 rec1=00 rec2=32 rec3=032 [0x07] rec0=22 rec1=00 rec2=05 rec3=02a [0x08] rec0=00 rec1=00 rec2=31 rec3=032 [0x09] rec0=1c rec1=00 rec2=06 rec3=008 [0x0a] rec0=01 rec1=00 rec2=30 rec3=036 [0x0b] rec0=19 rec1=00 rec2=07 rec3=008 [0x0c] rec0=03 rec1=00 rec2=2f rec3=004 [0x0d] rec0=18 rec1=00 rec2=08 rec3=026 [0x0e] rec0=00 rec1=00 rec2=2e rec3=048 [0x0f] rec0=20 rec1=00 rec2=09 rec3=03c [0x10] rec0=02 rec1=00 rec2=2d rec3=008 [0x11] rec0=1e rec1=00 rec2=0a rec3=034 [0x12] rec0=00 rec1=00 rec2=2c rec3=01a [0x13] rec0=1b rec1=00 rec2=0b rec3=03e [0x14] rec0=00 rec1=00 rec2=2b rec3=024 [0x15] rec0=1f rec1=00 rec2=0c rec3=03c [0x16] rec0=1e rec1=00 rec2=0d rec3=052 [0x17] rec0=01 rec1=00 rec2=2a rec3=020 [0x18] rec0=19 rec1=00 rec2=0e rec3=01c [0x19] rec0=00 rec1=00 rec2=29 rec3=008 [0x1a] rec0=1a rec1=00 rec2=0f rec3=038 [0x1b] rec0=00 rec1=00 rec2=28 rec3=024 [0x1c] rec0=16 rec1=00 rec2=10 rec3=092 [0x1d] rec0=18 rec1=00 rec2=11 rec3=04e [0x1e] rec0=17 rec1=00 rec2=12 rec3=028 [0x1f] rec0=00 rec1=00 rec2=27 rec3=002 [0x20] rec0=16 rec1=00 rec2=13 rec3=004 [0x21] rec0=00 rec1=00 rec2=26 rec3=004 [0x22] rec0=13 rec1=00 rec2=14 rec3=090 [0x23] rec0=01 rec1=00 rec2=25 rec3=012 [0x24] rec0=13 rec1=00 rec2=15 rec3=00a [0x25] rec0=00 rec1=00 rec2=24 rec3=010 [0x26] rec0=1c rec1=00 rec2=16 rec3=018 [0x27] rec0=00 rec1=00 rec2=23 rec3=002 [0x28] rec0=14 rec1=00 rec2=17 rec3=006 [0x29] rec0=00 rec1=00 rec2=22 rec3=004 [0x2a] rec0=16 rec1=00 rec2=18 rec3=050 [0x2b] rec0=00 rec1=00 rec2=21 rec3=004 [0x2c] rec0=15 rec1=00 rec2=19 rec3=062 [0x2d] rec0=00 rec1=00 rec2=20 rec3=002 [0x2e] rec0=16 rec1=00 rec2=1a rec3=050 [0x2f] rec0=01 rec1=00 rec2=1f rec3=00c [0x30] rec0=17 rec1=00 rec2=1b rec3=026 [0x31] rec0=00 rec1=00 rec2=1e rec3=004 [0x32] rec0=19 rec1=00 rec2=1c rec3=038 [0x33] rec0=13 rec1=00 rec2=1d rec3=000 tail 0x21500aeaa81978ef6af75 0x42a00088462063203