lace.text: Add an 'Element' function.

This commit is contained in:
Rod Kay
2022-08-16 14:29:29 +10:00
parent 953edb9604
commit 9f32667aaf
2 changed files with 16 additions and 0 deletions

View File

@@ -155,6 +155,19 @@ is
function Element (Self : in Item; Index : in Positive) return Character
is
begin
if Index > Self.Length
then
raise Error with "Index" & Index'Image & " exceeds length of" & Self.Length'Image;
end if;
return Self.Data (Index);
end Element;
procedure append (Self : in out Item; Extra : in String)
is
First : constant Positive := Self.Length + 1;

View File

@@ -124,6 +124,9 @@ is
function mono_Spaced (Self : in Item) return Item;
function Element (Self : in Item; Index : in Positive) return Character;
procedure append (Self : in out Item; Extra : in String);
--
-- Raises an Error if capacity is exceeded.