-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2002 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
------------------------
function Index
- (Source : in String;
- Pattern : in String;
- Going : in Direction := Forward;
- Mapping : in Maps.Character_Mapping := Maps.Identity)
- return Natural
+ (Source : String;
+ Pattern : String;
+ Going : Direction := Forward;
+ Mapping : Maps.Character_Mapping := Maps.Identity) return Natural
renames Ada.Strings.Search.Index;
function Index
- (Source : in String;
- Pattern : in String;
- Going : in Direction := Forward;
- Mapping : in Maps.Character_Mapping_Function)
- return Natural
+ (Source : String;
+ Pattern : String;
+ Going : Direction := Forward;
+ Mapping : Maps.Character_Mapping_Function) return Natural
renames Ada.Strings.Search.Index;
function Index
- (Source : in String;
- Set : in Maps.Character_Set;
- Test : in Membership := Inside;
- Going : in Direction := Forward)
- return Natural
+ (Source : String;
+ Set : Maps.Character_Set;
+ Test : Membership := Inside;
+ Going : Direction := Forward) return Natural
renames Ada.Strings.Search.Index;
+ function Index
+ (Source : String;
+ Pattern : String;
+ From : Positive;
+ Going : Direction := Forward;
+ Mapping : Maps.Character_Mapping := Maps.Identity) return Natural
+ renames Ada.Strings.Search.Index;
+
+ function Index
+ (Source : String;
+ Pattern : String;
+ From : Positive;
+ Going : Direction := Forward;
+ Mapping : Maps.Character_Mapping_Function) return Natural
+ renames Ada.Strings.Search.Index;
+
+ function Index
+ (Source : String;
+ Set : Maps.Character_Set;
+ From : Positive;
+ Test : Membership := Inside;
+ Going : Direction := Forward) return Natural
+ renames Ada.Strings.Search.Index;
+
+ function Index_Non_Blank
+ (Source : String;
+ Going : Direction := Forward) return Natural
+ renames Ada.Strings.Search.Index_Non_Blank;
+
function Index_Non_Blank
- (Source : in String;
- Going : in Direction := Forward)
- return Natural
+ (Source : String;
+ From : Positive;
+ Going : Direction := Forward) return Natural
renames Ada.Strings.Search.Index_Non_Blank;
function Count
- (Source : in String;
- Pattern : in String;
- Mapping : in Maps.Character_Mapping := Maps.Identity)
- return Natural
+ (Source : String;
+ Pattern : String;
+ Mapping : Maps.Character_Mapping := Maps.Identity) return Natural
renames Ada.Strings.Search.Count;
function Count
- (Source : in String;
- Pattern : in String;
- Mapping : in Maps.Character_Mapping_Function)
- return Natural
+ (Source : String;
+ Pattern : String;
+ Mapping : Maps.Character_Mapping_Function) return Natural
renames Ada.Strings.Search.Count;
function Count
- (Source : in String;
- Set : in Maps.Character_Set)
- return Natural
+ (Source : String;
+ Set : Maps.Character_Set) return Natural
renames Ada.Strings.Search.Count;
procedure Find_Token
- (Source : in String;
- Set : in Maps.Character_Set;
- Test : in Membership;
+ (Source : String;
+ Set : Maps.Character_Set;
+ Test : Membership;
First : out Positive;
Last : out Natural)
renames Ada.Strings.Search.Find_Token;
---------
function "*"
- (Left : in Natural;
- Right : in Character)
- return String
+ (Left : Natural;
+ Right : Character) return String
is
Result : String (1 .. Left);
end "*";
function "*"
- (Left : in Natural;
- Right : in String)
- return String
+ (Left : Natural;
+ Right : String) return String
is
Result : String (1 .. Left * Right'Length);
Ptr : Integer := 1;
------------
function Delete
- (Source : in String;
- From : in Positive;
- Through : in Natural)
- return String
+ (Source : String;
+ From : Positive;
+ Through : Natural) return String
is
begin
if From > Through then
procedure Delete
(Source : in out String;
- From : in Positive;
- Through : in Natural;
- Justify : in Alignment := Left;
- Pad : in Character := Space)
+ From : Positive;
+ Through : Natural;
+ Justify : Alignment := Left;
+ Pad : Character := Space)
is
begin
Move (Source => Delete (Source, From, Through),
----------
function Head
- (Source : in String;
- Count : in Natural;
- Pad : in Character := Space)
- return String
+ (Source : String;
+ Count : Natural;
+ Pad : Character := Space) return String
is
subtype Result_Type is String (1 .. Count);
procedure Head
(Source : in out String;
- Count : in Natural;
- Justify : in Alignment := Left;
- Pad : in Character := Space)
+ Count : Natural;
+ Justify : Alignment := Left;
+ Pad : Character := Space)
is
begin
Move (Source => Head (Source, Count, Pad),
------------
function Insert
- (Source : in String;
- Before : in Positive;
- New_Item : in String)
- return String
+ (Source : String;
+ Before : Positive;
+ New_Item : String) return String
is
Result : String (1 .. Source'Length + New_Item'Length);
Front : constant Integer := Before - Source'First;
procedure Insert
(Source : in out String;
- Before : in Positive;
- New_Item : in String;
- Drop : in Truncation := Error)
+ Before : Positive;
+ New_Item : String;
+ Drop : Truncation := Error)
is
begin
Move (Source => Insert (Source, Before, New_Item),
----------
procedure Move
- (Source : in String;
+ (Source : String;
Target : out String;
- Drop : in Truncation := Error;
- Justify : in Alignment := Left;
- Pad : in Character := Space)
+ Drop : Truncation := Error;
+ Justify : Alignment := Left;
+ Pad : Character := Space)
is
Sfirst : constant Integer := Source'First;
Slast : constant Integer := Source'Last;
---------------
function Overwrite
- (Source : in String;
- Position : in Positive;
- New_Item : in String)
- return String
+ (Source : String;
+ Position : Positive;
+ New_Item : String) return String
is
begin
if Position not in Source'First .. Source'Last + 1 then
procedure Overwrite
(Source : in out String;
- Position : in Positive;
- New_Item : in String;
- Drop : in Truncation := Right)
+ Position : Positive;
+ New_Item : String;
+ Drop : Truncation := Right)
is
begin
Move (Source => Overwrite (Source, Position, New_Item),
-------------------
function Replace_Slice
- (Source : in String;
- Low : in Positive;
- High : in Natural;
- By : in String)
- return String
+ (Source : String;
+ Low : Positive;
+ High : Natural;
+ By : String) return String
is
begin
if Low > Source'Last + 1 or High < Source'First - 1 then
procedure Replace_Slice
(Source : in out String;
- Low : in Positive;
- High : in Natural;
- By : in String;
- Drop : in Truncation := Error;
- Justify : in Alignment := Left;
- Pad : in Character := Space)
+ Low : Positive;
+ High : Natural;
+ By : String;
+ Drop : Truncation := Error;
+ Justify : Alignment := Left;
+ Pad : Character := Space)
is
begin
Move (Replace_Slice (Source, Low, High, By), Source, Drop, Justify, Pad);
----------
function Tail
- (Source : in String;
- Count : in Natural;
- Pad : in Character := Space)
- return String
+ (Source : String;
+ Count : Natural;
+ Pad : Character := Space) return String
is
subtype Result_Type is String (1 .. Count);
procedure Tail
(Source : in out String;
- Count : in Natural;
- Justify : in Alignment := Left;
- Pad : in Character := Space)
+ Count : Natural;
+ Justify : Alignment := Left;
+ Pad : Character := Space)
is
begin
Move (Source => Tail (Source, Count, Pad),
---------------
function Translate
- (Source : in String;
- Mapping : in Maps.Character_Mapping)
- return String
+ (Source : String;
+ Mapping : Maps.Character_Mapping) return String
is
Result : String (1 .. Source'Length);
procedure Translate
(Source : in out String;
- Mapping : in Maps.Character_Mapping)
+ Mapping : Maps.Character_Mapping)
is
begin
for J in Source'Range loop
end Translate;
function Translate
- (Source : in String;
- Mapping : in Maps.Character_Mapping_Function)
- return String
+ (Source : String;
+ Mapping : Maps.Character_Mapping_Function) return String
is
Result : String (1 .. Source'Length);
pragma Unsuppress (Access_Check);
procedure Translate
(Source : in out String;
- Mapping : in Maps.Character_Mapping_Function)
+ Mapping : Maps.Character_Mapping_Function)
is
pragma Unsuppress (Access_Check);
begin
----------
function Trim
- (Source : in String;
- Side : in Trim_End)
- return String
+ (Source : String;
+ Side : Trim_End) return String
is
Low, High : Integer;
procedure Trim
(Source : in out String;
- Side : in Trim_End;
- Justify : in Alignment := Left;
- Pad : in Character := Space)
+ Side : Trim_End;
+ Justify : Alignment := Left;
+ Pad : Character := Space)
is
begin
Move (Trim (Source, Side),
end Trim;
function Trim
- (Source : in String;
- Left : in Maps.Character_Set;
- Right : in Maps.Character_Set)
- return String
+ (Source : String;
+ Left : Maps.Character_Set;
+ Right : Maps.Character_Set) return String
is
High, Low : Integer;
procedure Trim
(Source : in out String;
- Left : in Maps.Character_Set;
- Right : in Maps.Character_Set;
- Justify : in Alignment := Strings.Left;
- Pad : in Character := Space)
+ Left : Maps.Character_Set;
+ Right : Maps.Character_Set;
+ Justify : Alignment := Strings.Left;
+ Pad : Character := Space)
is
begin
Move (Source => Trim (Source, Left, Right),
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-1997 Free Software Foundation, Inc. --
--- --
--- This specification is derived from the Ada Reference Manual for use with --
--- GNAT. The copyright notice above, and the license provisions that follow --
--- apply solely to the contents of the part following the private keyword. --
--- --
--- GNAT is free software; you can redistribute it and/or modify it under --
--- terms of the GNU General Public License as published by the Free Soft- --
--- ware Foundation; either version 2, or (at your option) any later ver- --
--- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
--- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
--- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
--- for more details. You should have received a copy of the GNU General --
--- Public License distributed with GNAT; see file COPYING. If not, write --
--- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, --
--- MA 02111-1307, USA. --
--- --
--- As a special exception, if other files instantiate generics from this --
--- unit, or you link this unit with other files to produce an executable, --
--- this unit does not by itself cause the resulting executable to be --
--- covered by the GNU General Public License. This exception does not --
--- however invalidate any other reasons why the executable file might be --
--- covered by the GNU Public License. --
--- --
--- GNAT was originally developed by the GNAT team at New York University. --
--- Extensive contributions were provided by Ada Core Technologies Inc. --
+-- This specification is adapted from the Ada Reference Manual for use with --
+-- GNAT. In accordance with the copyright of that document, you can freely --
+-- copy and modify this specification, provided that if you redistribute a --
+-- modified version, any changes that you have made are clearly indicated. --
-- --
------------------------------------------------------------------------------
--------------------------------------------------------------
procedure Move
- (Source : in String;
+ (Source : String;
Target : out String;
- Drop : in Truncation := Error;
- Justify : in Alignment := Left;
- Pad : in Character := Space);
+ Drop : Truncation := Error;
+ Justify : Alignment := Left;
+ Pad : Character := Space);
------------------------
-- Search Subprograms --
------------------------
function Index
- (Source : in String;
- Pattern : in String;
- Going : in Direction := Forward;
- Mapping : in Maps.Character_Mapping := Maps.Identity)
- return Natural;
+ (Source : String;
+ Pattern : String;
+ Going : Direction := Forward;
+ Mapping : Maps.Character_Mapping := Maps.Identity) return Natural;
+
+ function Index
+ (Source : String;
+ Pattern : String;
+ Going : Direction := Forward;
+ Mapping : Maps.Character_Mapping_Function) return Natural;
function Index
- (Source : in String;
- Pattern : in String;
- Going : in Direction := Forward;
- Mapping : in Maps.Character_Mapping_Function)
- return Natural;
+ (Source : String;
+ Set : Maps.Character_Set;
+ Test : Membership := Inside;
+ Going : Direction := Forward) return Natural;
function Index
- (Source : in String;
- Set : in Maps.Character_Set;
- Test : in Membership := Inside;
- Going : in Direction := Forward)
- return Natural;
+ (Source : String;
+ Pattern : String;
+ From : Positive;
+ Going : Direction := Forward;
+ Mapping : Maps.Character_Mapping := Maps.Identity) return Natural;
+ pragma Ada_05 (Index);
+
+ function Index
+ (Source : String;
+ Pattern : String;
+ From : Positive;
+ Going : Direction := Forward;
+ Mapping : Maps.Character_Mapping_Function) return Natural;
+ pragma Ada_05 (Index);
+
+ function Index
+ (Source : String;
+ Set : Maps.Character_Set;
+ From : Positive;
+ Test : Membership := Inside;
+ Going : Direction := Forward) return Natural;
+ pragma Ada_05 (Index);
+
+ function Index_Non_Blank
+ (Source : String;
+ Going : Direction := Forward) return Natural;
function Index_Non_Blank
- (Source : in String;
- Going : in Direction := Forward)
- return Natural;
+ (Source : String;
+ From : Positive;
+ Going : Direction := Forward) return Natural;
+ pragma Ada_05 (Index_Non_Blank);
function Count
- (Source : in String;
- Pattern : in String;
- Mapping : in Maps.Character_Mapping := Maps.Identity)
- return Natural;
+ (Source : String;
+ Pattern : String;
+ Mapping : Maps.Character_Mapping := Maps.Identity) return Natural;
function Count
- (Source : in String;
- Pattern : in String;
- Mapping : in Maps.Character_Mapping_Function)
- return Natural;
+ (Source : String;
+ Pattern : String;
+ Mapping : Maps.Character_Mapping_Function) return Natural;
function Count
- (Source : in String;
- Set : in Maps.Character_Set)
- return Natural;
+ (Source : String;
+ Set : Maps.Character_Set) return Natural;
procedure Find_Token
- (Source : in String;
- Set : in Maps.Character_Set;
- Test : in Membership;
+ (Source : String;
+ Set : Maps.Character_Set;
+ Test : Membership;
First : out Positive;
Last : out Natural);
------------------------------------
function Translate
- (Source : in String;
- Mapping : in Maps.Character_Mapping)
- return String;
+ (Source : String;
+ Mapping : Maps.Character_Mapping) return String;
procedure Translate
(Source : in out String;
- Mapping : in Maps.Character_Mapping);
+ Mapping : Maps.Character_Mapping);
function Translate
- (Source : in String;
- Mapping : in Maps.Character_Mapping_Function)
- return String;
+ (Source : String;
+ Mapping : Maps.Character_Mapping_Function) return String;
procedure Translate
(Source : in out String;
- Mapping : in Maps.Character_Mapping_Function);
+ Mapping : Maps.Character_Mapping_Function);
---------------------------------------
-- String Transformation Subprograms --
---------------------------------------
function Replace_Slice
- (Source : in String;
- Low : in Positive;
- High : in Natural;
- By : in String)
- return String;
+ (Source : String;
+ Low : Positive;
+ High : Natural;
+ By : String) return String;
procedure Replace_Slice
(Source : in out String;
- Low : in Positive;
- High : in Natural;
- By : in String;
- Drop : in Truncation := Error;
- Justify : in Alignment := Left;
- Pad : in Character := Space);
+ Low : Positive;
+ High : Natural;
+ By : String;
+ Drop : Truncation := Error;
+ Justify : Alignment := Left;
+ Pad : Character := Space);
function Insert
- (Source : in String;
- Before : in Positive;
- New_Item : in String)
- return String;
+ (Source : String;
+ Before : Positive;
+ New_Item : String) return String;
procedure Insert
(Source : in out String;
- Before : in Positive;
- New_Item : in String;
- Drop : in Truncation := Error);
+ Before : Positive;
+ New_Item : String;
+ Drop : Truncation := Error);
function Overwrite
- (Source : in String;
- Position : in Positive;
- New_Item : in String)
- return String;
+ (Source : String;
+ Position : Positive;
+ New_Item : String) return String;
procedure Overwrite
(Source : in out String;
- Position : in Positive;
- New_Item : in String;
- Drop : in Truncation := Right);
+ Position : Positive;
+ New_Item : String;
+ Drop : Truncation := Right);
function Delete
- (Source : in String;
- From : in Positive;
- Through : in Natural)
- return String;
+ (Source : String;
+ From : Positive;
+ Through : Natural) return String;
procedure Delete
(Source : in out String;
- From : in Positive;
- Through : in Natural;
- Justify : in Alignment := Left;
- Pad : in Character := Space);
+ From : Positive;
+ Through : Natural;
+ Justify : Alignment := Left;
+ Pad : Character := Space);
---------------------------------
-- String Selector Subprograms --
---------------------------------
function Trim
- (Source : in String;
- Side : in Trim_End)
- return String;
+ (Source : String;
+ Side : Trim_End) return String;
procedure Trim
(Source : in out String;
- Side : in Trim_End;
- Justify : in Alignment := Left;
- Pad : in Character := Space);
+ Side : Trim_End;
+ Justify : Alignment := Left;
+ Pad : Character := Space);
function Trim
- (Source : in String;
- Left : in Maps.Character_Set;
- Right : in Maps.Character_Set)
- return String;
+ (Source : String;
+ Left : Maps.Character_Set;
+ Right : Maps.Character_Set) return String;
procedure Trim
(Source : in out String;
- Left : in Maps.Character_Set;
- Right : in Maps.Character_Set;
- Justify : in Alignment := Strings.Left;
- Pad : in Character := Space);
+ Left : Maps.Character_Set;
+ Right : Maps.Character_Set;
+ Justify : Alignment := Strings.Left;
+ Pad : Character := Space);
function Head
- (Source : in String;
- Count : in Natural;
- Pad : in Character := Space)
- return String;
+ (Source : String;
+ Count : Natural;
+ Pad : Character := Space) return String;
procedure Head
(Source : in out String;
- Count : in Natural;
- Justify : in Alignment := Left;
- Pad : in Character := Space);
+ Count : Natural;
+ Justify : Alignment := Left;
+ Pad : Character := Space);
function Tail
- (Source : in String;
- Count : in Natural;
- Pad : in Character := Space)
- return String;
+ (Source : String;
+ Count : Natural;
+ Pad : Character := Space) return String;
procedure Tail
(Source : in out String;
- Count : in Natural;
- Justify : in Alignment := Left;
- Pad : in Character := Space);
+ Count : Natural;
+ Justify : Alignment := Left;
+ Pad : Character := Space);
----------------------------------
-- String Constructor Functions --
----------------------------------
function "*"
- (Left : in Natural;
- Right : in Character)
- return String;
+ (Left : Natural;
+ Right : Character) return String;
function "*"
- (Left : in Natural;
- Right : in String)
- return String;
+ (Left : Natural;
+ Right : String) return String;
end Ada.Strings.Fixed;
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2004 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2004 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 Free Software Foundation, Inc. --
-- --
-- This specification is derived from the Ada Reference Manual for use with --
-- GNAT. The copyright notice above, and the license provisions that follow --
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2004 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-----------
function Count
- (Source : String;
- Pattern : String;
- Mapping : Maps.Character_Mapping := Maps.Identity) return Natural
+ (Source : String;
+ Pattern : String;
+ Mapping : Maps.Character_Mapping := Maps.Identity) return Natural
is
N : Natural;
J : Natural;
end Count;
function Count
- (Source : String;
- Pattern : String;
- Mapping : Maps.Character_Mapping_Function) return Natural
+ (Source : String;
+ Pattern : String;
+ Mapping : Maps.Character_Mapping_Function) return Natural
is
Mapped_Source : String (Source'Range);
N : Natural;
declare
pragma Unsuppress (Access_Check);
-
begin
for J in Source'Range loop
Mapped_Source (J) := Mapping.all (Source (J));
return 0;
end Index;
+ function Index
+ (Source : String;
+ Pattern : String;
+ From : Positive;
+ Going : Direction := Forward;
+ Mapping : Maps.Character_Mapping := Maps.Identity) return Natural
+ is
+ begin
+ if Going = Forward then
+ if From < Source'First then
+ raise Index_Error;
+ end if;
+
+ return
+ Index (Source (From .. Source'Last), Pattern, Forward, Mapping);
+
+ else
+ if From > Source'Last then
+ raise Index_Error;
+ end if;
+
+ return
+ Index (Source (Source'First .. From), Pattern, Backward, Mapping);
+ end if;
+ end Index;
+
+ function Index
+ (Source : String;
+ Pattern : String;
+ From : Positive;
+ Going : Direction := Forward;
+ Mapping : Maps.Character_Mapping_Function) return Natural
+ is
+ begin
+ if Going = Forward then
+ if From < Source'First then
+ raise Index_Error;
+ end if;
+
+ return Index
+ (Source (From .. Source'Last), Pattern, Forward, Mapping);
+
+ else
+ if From > Source'Last then
+ raise Index_Error;
+ end if;
+
+ return Index
+ (Source (Source'First .. From), Pattern, Backward, Mapping);
+ end if;
+ end Index;
+
+ function Index
+ (Source : String;
+ Set : Maps.Character_Set;
+ From : Positive;
+ Test : Membership := Inside;
+ Going : Direction := Forward) return Natural
+ is
+ begin
+ if Going = Forward then
+ if From < Source'First then
+ raise Index_Error;
+ end if;
+
+ return
+ Index (Source (From .. Source'Last), Set, Test, Forward);
+
+ else
+ if From > Source'Last then
+ raise Index_Error;
+ end if;
+
+ return
+ Index (Source (Source'First .. From), Set, Test, Backward);
+ end if;
+ end Index;
+
---------------------
-- Index_Non_Blank --
---------------------
-- Fall through if no match
return 0;
+ end Index_Non_Blank;
+ function Index_Non_Blank
+ (Source : String;
+ From : Positive;
+ Going : Direction := Forward) return Natural
+ is
+ begin
+ if Going = Forward then
+ if From < Source'First then
+ raise Index_Error;
+ end if;
+
+ return
+ Index_Non_Blank (Source (From .. Source'Last), Forward);
+
+ else
+ if From > Source'Last then
+ raise Index_Error;
+ end if;
+
+ return
+ Index_Non_Blank (Source (Source'First .. From), Backward);
+ end if;
end Index_Non_Blank;
end Ada.Strings.Search;
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2004 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
Test : Membership := Inside;
Going : Direction := Forward) return Natural;
+ function Index
+ (Source : String;
+ Pattern : String;
+ From : Positive;
+ Going : Direction := Forward;
+ Mapping : Maps.Character_Mapping := Maps.Identity) return Natural;
+
+ function Index
+ (Source : String;
+ Pattern : String;
+ From : Positive;
+ Going : Direction := Forward;
+ Mapping : Maps.Character_Mapping_Function) return Natural;
+
+ function Index
+ (Source : String;
+ Set : Maps.Character_Set;
+ From : Positive;
+ Test : Membership := Inside;
+ Going : Direction := Forward) return Natural;
+
+ function Index_Non_Blank
+ (Source : String;
+ Going : Direction := Forward) return Natural;
+
function Index_Non_Blank
(Source : String;
+ From : Positive;
Going : Direction := Forward) return Natural;
function Count
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2002 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
Chunk_Size : Natural);
pragma Inline (Realloc_For_Chunk);
-- Adjust the size allocated for the string. Add at least Chunk_Size so it
- -- is safe to add a string of this size at the end of the current
- -- content. The real size allocated for the string is Chunk_Size + x %
- -- of the current string size. This buffered handling makes the Append
- -- unbounded string routines very fast.
+ -- is safe to add a string of this size at the end of the current content.
+ -- The real size allocated for the string is Chunk_Size + x of the current
+ -- string size. This buffered handling makes the Append unbounded string
+ -- routines very fast.
---------
-- "&" --
---------
- function "&" (Left, Right : Unbounded_String) return Unbounded_String is
+ function "&"
+ (Left : Unbounded_String;
+ Right : Unbounded_String) return Unbounded_String
+ is
L_Length : constant Natural := Left.Last;
R_Length : constant Natural := Right.Last;
Result : Unbounded_String;
function "&"
(Left : Unbounded_String;
- Right : String)
- return Unbounded_String
+ Right : String) return Unbounded_String
is
L_Length : constant Natural := Left.Last;
Result : Unbounded_String;
function "&"
(Left : String;
- Right : Unbounded_String)
- return Unbounded_String
+ Right : Unbounded_String) return Unbounded_String
is
R_Length : constant Natural := Right.Last;
Result : Unbounded_String;
function "&"
(Left : Unbounded_String;
- Right : Character)
- return Unbounded_String
+ Right : Character) return Unbounded_String
is
Result : Unbounded_String;
function "&"
(Left : Character;
- Right : Unbounded_String)
- return Unbounded_String
+ Right : Unbounded_String) return Unbounded_String
is
Result : Unbounded_String;
function "*"
(Left : Natural;
- Right : Character)
- return Unbounded_String
+ Right : Character) return Unbounded_String
is
Result : Unbounded_String;
function "*"
(Left : Natural;
- Right : String)
- return Unbounded_String
+ Right : String) return Unbounded_String
is
Len : constant Natural := Right'Length;
K : Positive;
function "*"
(Left : Natural;
- Right : Unbounded_String)
- return Unbounded_String
+ Right : Unbounded_String) return Unbounded_String
is
Len : constant Natural := Right.Last;
K : Positive;
-- "<" --
---------
- function "<" (Left, Right : Unbounded_String) return Boolean is
+ function "<"
+ (Left : Unbounded_String;
+ Right : Unbounded_String) return Boolean
+ is
begin
return
Left.Reference (1 .. Left.Last) < Right.Reference (1 .. Right.Last);
function "<"
(Left : Unbounded_String;
- Right : String)
- return Boolean
+ Right : String) return Boolean
is
begin
return Left.Reference (1 .. Left.Last) < Right;
function "<"
(Left : String;
- Right : Unbounded_String)
- return Boolean
+ Right : Unbounded_String) return Boolean
is
begin
return Left < Right.Reference (1 .. Right.Last);
-- "<=" --
----------
- function "<=" (Left, Right : Unbounded_String) return Boolean is
+ function "<="
+ (Left : Unbounded_String;
+ Right : Unbounded_String) return Boolean
+ is
begin
return
Left.Reference (1 .. Left.Last) <= Right.Reference (1 .. Right.Last);
function "<="
(Left : Unbounded_String;
- Right : String)
- return Boolean
+ Right : String) return Boolean
is
begin
return Left.Reference (1 .. Left.Last) <= Right;
function "<="
(Left : String;
- Right : Unbounded_String)
- return Boolean
+ Right : Unbounded_String) return Boolean
is
begin
return Left <= Right.Reference (1 .. Right.Last);
-- "=" --
---------
- function "=" (Left, Right : Unbounded_String) return Boolean is
+ function "="
+ (Left : Unbounded_String;
+ Right : Unbounded_String) return Boolean
+ is
begin
return
Left.Reference (1 .. Left.Last) = Right.Reference (1 .. Right.Last);
function "="
(Left : Unbounded_String;
- Right : String)
- return Boolean
+ Right : String) return Boolean
is
begin
return Left.Reference (1 .. Left.Last) = Right;
function "="
(Left : String;
- Right : Unbounded_String)
- return Boolean
+ Right : Unbounded_String) return Boolean
is
begin
return Left = Right.Reference (1 .. Right.Last);
-- ">" --
---------
- function ">" (Left, Right : Unbounded_String) return Boolean is
+ function ">"
+ (Left : Unbounded_String;
+ Right : Unbounded_String) return Boolean
+ is
begin
return
Left.Reference (1 .. Left.Last) > Right.Reference (1 .. Right.Last);
function ">"
(Left : Unbounded_String;
- Right : String)
- return Boolean
+ Right : String) return Boolean
is
begin
return Left.Reference (1 .. Left.Last) > Right;
function ">"
(Left : String;
- Right : Unbounded_String)
- return Boolean
+ Right : Unbounded_String) return Boolean
is
begin
return Left > Right.Reference (1 .. Right.Last);
-- ">=" --
----------
- function ">=" (Left, Right : Unbounded_String) return Boolean is
+ function ">="
+ (Left : Unbounded_String;
+ Right : Unbounded_String) return Boolean
+ is
begin
return
Left.Reference (1 .. Left.Last) >= Right.Reference (1 .. Right.Last);
function ">="
(Left : Unbounded_String;
- Right : String)
- return Boolean
+ Right : String) return Boolean
is
begin
return Left.Reference (1 .. Left.Last) >= Right;
function ">="
(Left : String;
- Right : Unbounded_String)
- return Boolean
+ Right : Unbounded_String) return Boolean
is
begin
return Left >= Right.Reference (1 .. Right.Last);
procedure Adjust (Object : in out Unbounded_String) is
begin
-- Copy string, except we do not copy the statically allocated null
- -- string, since it can never be deallocated.
- -- Note that we do not copy extra string room here to avoid dragging
- -- unused allocated memory.
+ -- string, since it can never be deallocated. Note that we do not copy
+ -- extra string room here to avoid dragging unused allocated memory.
if Object.Reference /= Null_String'Access then
Object.Reference := new String'(Object.Reference (1 .. Object.Last));
-----------
function Count
- (Source : Unbounded_String;
- Pattern : String;
- Mapping : Maps.Character_Mapping := Maps.Identity)
- return Natural
+ (Source : Unbounded_String;
+ Pattern : String;
+ Mapping : Maps.Character_Mapping := Maps.Identity) return Natural
is
begin
return
end Count;
function Count
- (Source : Unbounded_String;
- Pattern : String;
- Mapping : Maps.Character_Mapping_Function)
- return Natural
+ (Source : Unbounded_String;
+ Pattern : String;
+ Mapping : Maps.Character_Mapping_Function) return Natural
is
begin
return
end Count;
function Count
- (Source : Unbounded_String;
- Set : Maps.Character_Set)
- return Natural
+ (Source : Unbounded_String;
+ Set : Maps.Character_Set) return Natural
is
begin
return Search.Count (Source.Reference (1 .. Source.Last), Set);
function Delete
(Source : Unbounded_String;
From : Positive;
- Through : Natural)
- return Unbounded_String
+ Through : Natural) return Unbounded_String
is
begin
return
function Element
(Source : Unbounded_String;
- Index : Positive)
- return Character
+ Index : Positive) return Character
is
begin
if Index <= Source.Last then
function Head
(Source : Unbounded_String;
Count : Natural;
- Pad : Character := Space)
- return Unbounded_String
+ Pad : Character := Space) return Unbounded_String
is
begin
return To_Unbounded_String
Pad : Character := Space)
is
Old : String_Access := Source.Reference;
-
begin
Source.Reference :=
new String'(Fixed.Head (Source.Reference (1 .. Source.Last),
-----------
function Index
- (Source : Unbounded_String;
- Pattern : String;
- Going : Strings.Direction := Strings.Forward;
- Mapping : Maps.Character_Mapping := Maps.Identity)
- return Natural
+ (Source : Unbounded_String;
+ Pattern : String;
+ Going : Strings.Direction := Strings.Forward;
+ Mapping : Maps.Character_Mapping := Maps.Identity) return Natural
is
begin
return Search.Index
end Index;
function Index
- (Source : Unbounded_String;
- Pattern : String;
- Going : Direction := Forward;
- Mapping : Maps.Character_Mapping_Function)
- return Natural
+ (Source : Unbounded_String;
+ Pattern : String;
+ Going : Direction := Forward;
+ Mapping : Maps.Character_Mapping_Function) return Natural
is
begin
return Search.Index
(Source : Unbounded_String;
Set : Maps.Character_Set;
Test : Strings.Membership := Strings.Inside;
- Going : Strings.Direction := Strings.Forward)
- return Natural
+ Going : Strings.Direction := Strings.Forward) return Natural
is
begin
return Search.Index
(Source.Reference (1 .. Source.Last), Set, Test, Going);
end Index;
+ function Index
+ (Source : Unbounded_String;
+ Pattern : String;
+ From : Positive;
+ Going : Direction := Forward;
+ Mapping : Maps.Character_Mapping := Maps.Identity) return Natural
+ is
+ begin
+ return Search.Index
+ (Source.Reference (1 .. Source.Last), Pattern, From, Going, Mapping);
+ end Index;
+
+ function Index
+ (Source : Unbounded_String;
+ Pattern : String;
+ From : Positive;
+ Going : Direction := Forward;
+ Mapping : Maps.Character_Mapping_Function) return Natural
+ is
+ begin
+ return Search.Index
+ (Source.Reference (1 .. Source.Last), Pattern, From, Going, Mapping);
+ end Index;
+
+
+ function Index
+ (Source : Unbounded_String;
+ Set : Maps.Character_Set;
+ From : Positive;
+ Test : Membership := Inside;
+ Going : Direction := Forward) return Natural
+ is
+ begin
+ return Search.Index
+ (Source.Reference (1 .. Source.Last), Set, From, Test, Going);
+ end Index;
+
+ function Index_Non_Blank
+ (Source : Unbounded_String;
+ Going : Strings.Direction := Strings.Forward) return Natural
+ is
+ begin
+ return
+ Search.Index_Non_Blank
+ (Source.Reference (1 .. Source.Last), Going);
+ end Index_Non_Blank;
+
function Index_Non_Blank
(Source : Unbounded_String;
- Going : Strings.Direction := Strings.Forward)
- return Natural
+ From : Positive;
+ Going : Direction := Forward) return Natural
is
begin
return
- Search.Index_Non_Blank (Source.Reference (1 .. Source.Last), Going);
+ Search.Index_Non_Blank
+ (Source.Reference (1 .. Source.Last), From, Going);
end Index_Non_Blank;
----------------
function Insert
(Source : Unbounded_String;
Before : Positive;
- New_Item : String)
- return Unbounded_String
+ New_Item : String) return Unbounded_String
is
begin
return To_Unbounded_String
---------------
function Overwrite
- (Source : Unbounded_String;
- Position : Positive;
- New_Item : String)
- return Unbounded_String is
-
+ (Source : Unbounded_String;
+ Position : Positive;
+ New_Item : String) return Unbounded_String
+ is
begin
return To_Unbounded_String
(Fixed.Overwrite
New_Item : String)
is
NL : constant Natural := New_Item'Length;
-
begin
if Position <= Source.Last - NL + 1 then
Source.Reference (Position .. Position + NL - 1) := New_Item;
-
else
declare
Old : String_Access := Source.Reference;
-
begin
Source.Reference := new String'
(Fixed.Overwrite
Alloc_Chunk_Size : constant Positive :=
Chunk_Size + (S_Length / Growth_Factor);
Tmp : String_Access;
-
begin
Tmp := new String (1 .. S_Length + Alloc_Chunk_Size);
Tmp (1 .. Source.Last) := Source.Reference (1 .. Source.Last);
-------------------
function Replace_Slice
- (Source : Unbounded_String;
- Low : Positive;
- High : Natural;
- By : String)
- return Unbounded_String
+ (Source : Unbounded_String;
+ Low : Positive;
+ High : Natural;
+ By : String) return Unbounded_String
is
begin
return To_Unbounded_String
end Replace_Slice;
procedure Replace_Slice
- (Source : in out Unbounded_String;
- Low : Positive;
- High : Natural;
- By : String)
+ (Source : in out Unbounded_String;
+ Low : Positive;
+ High : Natural;
+ By : String)
is
Old : String_Access := Source.Reference;
-
begin
Source.Reference := new String'
(Fixed.Replace_Slice
Free (Old);
end Replace_Slice;
+ --------------------------
+ -- Set_Unbounded_String --
+ --------------------------
+
+ procedure Set_Unbounded_String
+ (Target : out Unbounded_String;
+ Source : String)
+ is
+ begin
+ Target.Last := Source'Length;
+ Target.Reference := new String (1 .. Source'Length);
+ Target.Reference.all := Source;
+ end Set_Unbounded_String;
+
-----------
-- Slice --
-----------
function Slice
(Source : Unbounded_String;
Low : Positive;
- High : Natural)
- return String
+ High : Natural) return String
is
begin
-- Note: test of High > Length is in accordance with AI95-00128
function Tail
(Source : Unbounded_String;
Count : Natural;
- Pad : Character := Space)
- return Unbounded_String is
-
+ Pad : Character := Space) return Unbounded_String is
begin
return To_Unbounded_String
(Fixed.Tail (Source.Reference (1 .. Source.Last), Count, Pad));
Pad : Character := Space)
is
Old : String_Access := Source.Reference;
-
begin
Source.Reference := new String'
(Fixed.Tail (Source.Reference (1 .. Source.Last), Count, Pad));
function To_Unbounded_String (Source : String) return Unbounded_String is
Result : Unbounded_String;
-
begin
Result.Last := Source'Length;
Result.Reference := new String (1 .. Source'Length);
end To_Unbounded_String;
function To_Unbounded_String
- (Length : Natural)
- return Unbounded_String
+ (Length : Natural) return Unbounded_String
is
Result : Unbounded_String;
-
begin
Result.Last := Length;
Result.Reference := new String (1 .. Length);
function Translate
(Source : Unbounded_String;
- Mapping : Maps.Character_Mapping)
- return Unbounded_String
+ Mapping : Maps.Character_Mapping) return Unbounded_String
is
begin
return To_Unbounded_String
function Translate
(Source : Unbounded_String;
- Mapping : Maps.Character_Mapping_Function)
- return Unbounded_String
+ Mapping : Maps.Character_Mapping_Function) return Unbounded_String
is
begin
return To_Unbounded_String
function Trim
(Source : Unbounded_String;
- Side : Trim_End)
- return Unbounded_String
+ Side : Trim_End) return Unbounded_String
is
begin
return To_Unbounded_String
Side : Trim_End)
is
Old : String_Access := Source.Reference;
-
begin
Source.Reference := new String'
(Fixed.Trim (Source.Reference (1 .. Source.Last), Side));
function Trim
(Source : Unbounded_String;
Left : Maps.Character_Set;
- Right : Maps.Character_Set)
- return Unbounded_String
+ Right : Maps.Character_Set) return Unbounded_String
is
begin
return To_Unbounded_String
Right : Maps.Character_Set)
is
Old : String_Access := Source.Reference;
-
begin
Source.Reference := new String'
(Fixed.Trim (Source.Reference (1 .. Source.Last), Left, Right));
Free (Old);
end Trim;
+ ---------------------
+ -- Unbounded_Slice --
+ ---------------------
+
+ function Unbounded_Slice
+ (Source : Unbounded_String;
+ Low : Positive;
+ High : Natural) return Unbounded_String
+ is
+ begin
+ if Low > Source.Last + 1 or else High > Source.Last then
+ raise Index_Error;
+ else
+ return To_Unbounded_String (Source.Reference.all (Low .. High));
+ end if;
+ end Unbounded_Slice;
+
+ procedure Unbounded_Slice
+ (Source : Unbounded_String;
+ Target : out Unbounded_String;
+ Low : Positive;
+ High : Natural)
+ is
+ begin
+ if Low > Source.Last + 1 or else High > Source.Last then
+ raise Index_Error;
+ else
+ Target := To_Unbounded_String (Source.Reference.all (Low .. High));
+ end if;
+ end Unbounded_Slice;
+
end Ada.Strings.Unbounded;
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2002 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 Free Software Foundation, Inc. --
-- --
-- This specification is derived from the Ada Reference Manual for use with --
-- GNAT. The copyright notice above, and the license provisions that follow --
-- Conversion, Concatenation, and Selection Functions --
--------------------------------------------------------
- function To_Unbounded_String (Source : String) return Unbounded_String;
- function To_Unbounded_String (Length : in Natural) return Unbounded_String;
+ function To_Unbounded_String
+ (Source : String) return Unbounded_String;
+
+ function To_Unbounded_String
+ (Length : Natural) return Unbounded_String;
function To_String (Source : Unbounded_String) return String;
+ procedure Set_Unbounded_String
+ (Target : out Unbounded_String;
+ Source : String);
+ pragma Ada_05 (Set_Unbounded_String);
+
procedure Append
(Source : in out Unbounded_String;
- New_Item : in Unbounded_String);
+ New_Item : Unbounded_String);
procedure Append
(Source : in out Unbounded_String;
- New_Item : in String);
+ New_Item : String);
procedure Append
(Source : in out Unbounded_String;
- New_Item : in Character);
+ New_Item : Character);
- function "&" (Left, Right : Unbounded_String) return Unbounded_String;
+ function "&"
+ (Left : Unbounded_String;
+ Right : Unbounded_String) return Unbounded_String;
function "&"
- (Left : in Unbounded_String;
- Right : in String)
- return Unbounded_String;
+ (Left : Unbounded_String;
+ Right : String) return Unbounded_String;
function "&"
- (Left : in String;
- Right : in Unbounded_String)
- return Unbounded_String;
+ (Left : String;
+ Right : Unbounded_String) return Unbounded_String;
function "&"
- (Left : in Unbounded_String;
- Right : in Character)
- return Unbounded_String;
+ (Left : Unbounded_String;
+ Right : Character) return Unbounded_String;
function "&"
- (Left : in Character;
- Right : in Unbounded_String)
- return Unbounded_String;
+ (Left : Character;
+ Right : Unbounded_String) return Unbounded_String;
function Element
- (Source : in Unbounded_String;
- Index : in Positive)
- return Character;
+ (Source : Unbounded_String;
+ Index : Positive) return Character;
procedure Replace_Element
(Source : in out Unbounded_String;
- Index : in Positive;
+ Index : Positive;
By : Character);
function Slice
- (Source : in Unbounded_String;
- Low : in Positive;
- High : in Natural)
- return String;
+ (Source : Unbounded_String;
+ Low : Positive;
+ High : Natural) return String;
+
+ function Unbounded_Slice
+ (Source : Unbounded_String;
+ Low : Positive;
+ High : Natural) return Unbounded_String;
+ pragma Ada_05 (Unbounded_Slice);
+
+ procedure Unbounded_Slice
+ (Source : Unbounded_String;
+ Target : out Unbounded_String;
+ Low : Positive;
+ High : Natural);
+ pragma Ada_05 (Unbounded_Slice);
- function "=" (Left, Right : in Unbounded_String) return Boolean;
+ function "="
+ (Left : Unbounded_String;
+ Right : Unbounded_String) return Boolean;
function "="
- (Left : in Unbounded_String;
- Right : in String)
- return Boolean;
+ (Left : Unbounded_String;
+ Right : String) return Boolean;
function "="
- (Left : in String;
- Right : in Unbounded_String)
- return Boolean;
+ (Left : String;
+ Right : Unbounded_String) return Boolean;
- function "<" (Left, Right : in Unbounded_String) return Boolean;
+ function "<"
+ (Left : Unbounded_String;
+ Right : Unbounded_String) return Boolean;
function "<"
- (Left : in Unbounded_String;
- Right : in String)
- return Boolean;
+ (Left : Unbounded_String;
+ Right : String) return Boolean;
function "<"
- (Left : in String;
- Right : in Unbounded_String)
- return Boolean;
+ (Left : String;
+ Right : Unbounded_String) return Boolean;
- function "<=" (Left, Right : in Unbounded_String) return Boolean;
+ function "<="
+ (Left : Unbounded_String;
+ Right : Unbounded_String) return Boolean;
function "<="
- (Left : in Unbounded_String;
- Right : in String)
- return Boolean;
+ (Left : Unbounded_String;
+ Right : String) return Boolean;
function "<="
- (Left : in String;
- Right : in Unbounded_String)
- return Boolean;
+ (Left : String;
+ Right : Unbounded_String) return Boolean;
- function ">" (Left, Right : in Unbounded_String) return Boolean;
+ function ">"
+ (Left : Unbounded_String;
+ Right : Unbounded_String) return Boolean;
function ">"
- (Left : in Unbounded_String;
- Right : in String)
- return Boolean;
+ (Left : Unbounded_String;
+ Right : String) return Boolean;
function ">"
- (Left : in String;
- Right : in Unbounded_String)
- return Boolean;
+ (Left : String;
+ Right : Unbounded_String) return Boolean;
- function ">=" (Left, Right : in Unbounded_String) return Boolean;
+ function ">="
+ (Left : Unbounded_String;
+ Right : Unbounded_String) return Boolean;
function ">="
- (Left : in Unbounded_String;
- Right : in String)
- return Boolean;
+ (Left : Unbounded_String;
+ Right : String) return Boolean;
function ">="
- (Left : in String;
- Right : in Unbounded_String)
- return Boolean;
+ (Left : String;
+ Right : Unbounded_String) return Boolean;
------------------------
-- Search Subprograms --
------------------------
function Index
- (Source : in Unbounded_String;
- Pattern : in String;
- Going : in Direction := Forward;
- Mapping : in Maps.Character_Mapping := Maps.Identity)
- return Natural;
+ (Source : Unbounded_String;
+ Pattern : String;
+ Going : Direction := Forward;
+ Mapping : Maps.Character_Mapping := Maps.Identity) return Natural;
+
+ function Index
+ (Source : Unbounded_String;
+ Pattern : String;
+ Going : Direction := Forward;
+ Mapping : Maps.Character_Mapping_Function) return Natural;
function Index
- (Source : in Unbounded_String;
- Pattern : in String;
- Going : in Direction := Forward;
- Mapping : in Maps.Character_Mapping_Function)
- return Natural;
+ (Source : Unbounded_String;
+ Set : Maps.Character_Set;
+ Test : Membership := Inside;
+ Going : Direction := Forward) return Natural;
function Index
- (Source : in Unbounded_String;
- Set : in Maps.Character_Set;
- Test : in Membership := Inside;
- Going : in Direction := Forward)
- return Natural;
+ (Source : Unbounded_String;
+ Pattern : String;
+ From : Positive;
+ Going : Direction := Forward;
+ Mapping : Maps.Character_Mapping := Maps.Identity) return Natural;
+ pragma Ada_05 (Index);
+
+ function Index
+ (Source : Unbounded_String;
+ Pattern : String;
+ From : Positive;
+ Going : Direction := Forward;
+ Mapping : Maps.Character_Mapping_Function) return Natural;
+ pragma Ada_05 (Index);
+
+ function Index
+ (Source : Unbounded_String;
+ Set : Maps.Character_Set;
+ From : Positive;
+ Test : Membership := Inside;
+ Going : Direction := Forward) return Natural;
+ pragma Ada_05 (Index);
function Index_Non_Blank
- (Source : in Unbounded_String;
- Going : in Direction := Forward)
- return Natural;
+ (Source : Unbounded_String;
+ Going : Direction := Forward) return Natural;
+
+ function Index_Non_Blank
+ (Source : Unbounded_String;
+ From : Positive;
+ Going : Direction := Forward) return Natural;
+ pragma Ada_05 (Index_Non_Blank);
function Count
- (Source : in Unbounded_String;
- Pattern : in String;
- Mapping : in Maps.Character_Mapping := Maps.Identity)
- return Natural;
+ (Source : Unbounded_String;
+ Pattern : String;
+ Mapping : Maps.Character_Mapping := Maps.Identity) return Natural;
function Count
- (Source : in Unbounded_String;
- Pattern : in String;
- Mapping : in Maps.Character_Mapping_Function)
- return Natural;
+ (Source : Unbounded_String;
+ Pattern : String;
+ Mapping : Maps.Character_Mapping_Function) return Natural;
function Count
- (Source : in Unbounded_String;
- Set : in Maps.Character_Set)
- return Natural;
+ (Source : Unbounded_String;
+ Set : Maps.Character_Set) return Natural;
procedure Find_Token
- (Source : in Unbounded_String;
- Set : in Maps.Character_Set;
- Test : in Membership;
+ (Source : Unbounded_String;
+ Set : Maps.Character_Set;
+ Test : Membership;
First : out Positive;
Last : out Natural);
------------------------------------
function Translate
- (Source : in Unbounded_String;
- Mapping : in Maps.Character_Mapping)
- return Unbounded_String;
+ (Source : Unbounded_String;
+ Mapping : Maps.Character_Mapping) return Unbounded_String;
procedure Translate
(Source : in out Unbounded_String;
Mapping : Maps.Character_Mapping);
function Translate
- (Source : in Unbounded_String;
- Mapping : in Maps.Character_Mapping_Function)
- return Unbounded_String;
+ (Source : Unbounded_String;
+ Mapping : Maps.Character_Mapping_Function) return Unbounded_String;
procedure Translate
(Source : in out Unbounded_String;
- Mapping : in Maps.Character_Mapping_Function);
+ Mapping : Maps.Character_Mapping_Function);
---------------------------------------
-- String Transformation Subprograms --
---------------------------------------
function Replace_Slice
- (Source : in Unbounded_String;
- Low : in Positive;
- High : in Natural;
- By : in String)
- return Unbounded_String;
+ (Source : Unbounded_String;
+ Low : Positive;
+ High : Natural;
+ By : String) return Unbounded_String;
procedure Replace_Slice
- (Source : in out Unbounded_String;
- Low : in Positive;
- High : in Natural;
- By : in String);
+ (Source : in out Unbounded_String;
+ Low : Positive;
+ High : Natural;
+ By : String);
function Insert
- (Source : in Unbounded_String;
- Before : in Positive;
- New_Item : in String)
- return Unbounded_String;
+ (Source : Unbounded_String;
+ Before : Positive;
+ New_Item : String) return Unbounded_String;
procedure Insert
(Source : in out Unbounded_String;
- Before : in Positive;
- New_Item : in String);
+ Before : Positive;
+ New_Item : String);
function Overwrite
- (Source : in Unbounded_String;
- Position : in Positive;
- New_Item : in String)
- return Unbounded_String;
+ (Source : Unbounded_String;
+ Position : Positive;
+ New_Item : String) return Unbounded_String;
procedure Overwrite
- (Source : in out Unbounded_String;
- Position : in Positive;
- New_Item : in String);
+ (Source : in out Unbounded_String;
+ Position : Positive;
+ New_Item : String);
function Delete
- (Source : in Unbounded_String;
- From : in Positive;
- Through : in Natural)
- return Unbounded_String;
+ (Source : Unbounded_String;
+ From : Positive;
+ Through : Natural) return Unbounded_String;
procedure Delete
(Source : in out Unbounded_String;
- From : in Positive;
- Through : in Natural);
+ From : Positive;
+ Through : Natural);
function Trim
- (Source : in Unbounded_String;
- Side : in Trim_End)
- return Unbounded_String;
+ (Source : Unbounded_String;
+ Side : Trim_End) return Unbounded_String;
procedure Trim
(Source : in out Unbounded_String;
- Side : in Trim_End);
+ Side : Trim_End);
function Trim
- (Source : in Unbounded_String;
- Left : in Maps.Character_Set;
- Right : in Maps.Character_Set)
- return Unbounded_String;
+ (Source : Unbounded_String;
+ Left : Maps.Character_Set;
+ Right : Maps.Character_Set) return Unbounded_String;
procedure Trim
(Source : in out Unbounded_String;
- Left : in Maps.Character_Set;
- Right : in Maps.Character_Set);
+ Left : Maps.Character_Set;
+ Right : Maps.Character_Set);
function Head
- (Source : in Unbounded_String;
- Count : in Natural;
- Pad : in Character := Space)
- return Unbounded_String;
+ (Source : Unbounded_String;
+ Count : Natural;
+ Pad : Character := Space) return Unbounded_String;
procedure Head
(Source : in out Unbounded_String;
- Count : in Natural;
- Pad : in Character := Space);
+ Count : Natural;
+ Pad : Character := Space);
function Tail
- (Source : in Unbounded_String;
- Count : in Natural;
- Pad : in Character := Space)
- return Unbounded_String;
+ (Source : Unbounded_String;
+ Count : Natural;
+ Pad : Character := Space) return Unbounded_String;
procedure Tail
(Source : in out Unbounded_String;
- Count : in Natural;
- Pad : in Character := Space);
+ Count : Natural;
+ Pad : Character := Space);
function "*"
- (Left : in Natural;
- Right : in Character)
- return Unbounded_String;
+ (Left : Natural;
+ Right : Character) return Unbounded_String;
function "*"
- (Left : in Natural;
- Right : in String)
- return Unbounded_String;
+ (Left : Natural;
+ Right : String) return Unbounded_String;
function "*"
- (Left : in Natural;
- Right : in Unbounded_String)
- return Unbounded_String;
+ (Left : Natural;
+ Right : Unbounded_String) return Unbounded_String;
private
pragma Inline (Length);
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2002 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
------------------------
function Index
- (Source : in Wide_String;
- Pattern : in Wide_String;
- Going : in Direction := Forward;
- Mapping : in Wide_Maps.Wide_Character_Mapping := Wide_Maps.Identity)
- return Natural
+ (Source : Wide_String;
+ Pattern : Wide_String;
+ Going : Direction := Forward;
+ Mapping : Wide_Maps.Wide_Character_Mapping := Wide_Maps.Identity)
+ return Natural
renames Ada.Strings.Wide_Search.Index;
function Index
- (Source : in Wide_String;
- Pattern : in Wide_String;
- Going : in Direction := Forward;
- Mapping : in Wide_Maps.Wide_Character_Mapping_Function)
- return Natural
+ (Source : Wide_String;
+ Pattern : Wide_String;
+ Going : Direction := Forward;
+ Mapping : Wide_Maps.Wide_Character_Mapping_Function) return Natural
renames Ada.Strings.Wide_Search.Index;
function Index
- (Source : in Wide_String;
- Set : in Wide_Maps.Wide_Character_Set;
- Test : in Membership := Inside;
- Going : in Direction := Forward)
- return Natural
+ (Source : Wide_String;
+ Set : Wide_Maps.Wide_Character_Set;
+ Test : Membership := Inside;
+ Going : Direction := Forward) return Natural
renames Ada.Strings.Wide_Search.Index;
+ function Index
+ (Source : Wide_String;
+ Pattern : Wide_String;
+ From : Positive;
+ Going : Direction := Forward;
+ Mapping : Wide_Maps.Wide_Character_Mapping := Wide_Maps.Identity)
+ return Natural
+ renames Ada.Strings.Wide_Search.Index;
+
+ function Index
+ (Source : Wide_String;
+ Pattern : Wide_String;
+ From : Positive;
+ Going : Direction := Forward;
+ Mapping : Wide_Maps.Wide_Character_Mapping_Function) return Natural
+ renames Ada.Strings.Wide_Search.Index;
+
+ function Index
+ (Source : Wide_String;
+ Set : Wide_Maps.Wide_Character_Set;
+ From : Positive;
+ Test : Membership := Inside;
+ Going : Direction := Forward) return Natural
+ renames Ada.Strings.Wide_Search.Index;
+
+ function Index_Non_Blank
+ (Source : Wide_String;
+ Going : Direction := Forward) return Natural
+ renames Ada.Strings.Wide_Search.Index_Non_Blank;
+
function Index_Non_Blank
- (Source : in Wide_String;
- Going : in Direction := Forward)
- return Natural
+ (Source : Wide_String;
+ From : Positive;
+ Going : Direction := Forward) return Natural
renames Ada.Strings.Wide_Search.Index_Non_Blank;
function Count
- (Source : in Wide_String;
- Pattern : in Wide_String;
- Mapping : in Wide_Maps.Wide_Character_Mapping := Wide_Maps.Identity)
- return Natural
+ (Source : Wide_String;
+ Pattern : Wide_String;
+ Mapping : Wide_Maps.Wide_Character_Mapping := Wide_Maps.Identity)
+ return Natural
renames Ada.Strings.Wide_Search.Count;
function Count
- (Source : in Wide_String;
- Pattern : in Wide_String;
- Mapping : in Wide_Maps.Wide_Character_Mapping_Function)
- return Natural
+ (Source : Wide_String;
+ Pattern : Wide_String;
+ Mapping : Wide_Maps.Wide_Character_Mapping_Function) return Natural
renames Ada.Strings.Wide_Search.Count;
function Count
- (Source : in Wide_String;
- Set : in Wide_Maps.Wide_Character_Set)
- return Natural
+ (Source : Wide_String;
+ Set : Wide_Maps.Wide_Character_Set) return Natural
renames Ada.Strings.Wide_Search.Count;
procedure Find_Token
- (Source : in Wide_String;
- Set : in Wide_Maps.Wide_Character_Set;
- Test : in Membership;
+ (Source : Wide_String;
+ Set : Wide_Maps.Wide_Character_Set;
+ Test : Membership;
First : out Positive;
Last : out Natural)
renames Ada.Strings.Wide_Search.Find_Token;
---------
function "*"
- (Left : in Natural;
- Right : in Wide_Character)
- return Wide_String
+ (Left : Natural;
+ Right : Wide_Character) return Wide_String
is
Result : Wide_String (1 .. Left);
end "*";
function "*"
- (Left : in Natural;
- Right : in Wide_String)
- return Wide_String
+ (Left : Natural;
+ Right : Wide_String) return Wide_String
is
Result : Wide_String (1 .. Left * Right'Length);
Ptr : Integer := 1;
------------
function Delete
- (Source : in Wide_String;
- From : in Positive;
- Through : in Natural)
- return Wide_String
+ (Source : Wide_String;
+ From : Positive;
+ Through : Natural) return Wide_String
is
begin
if From not in Source'Range
procedure Delete
(Source : in out Wide_String;
- From : in Positive;
- Through : in Natural;
- Justify : in Alignment := Left;
- Pad : in Wide_Character := Wide_Space)
+ From : Positive;
+ Through : Natural;
+ Justify : Alignment := Left;
+ Pad : Wide_Character := Wide_Space)
is
begin
Move (Source => Delete (Source, From, Through),
----------
function Head
- (Source : in Wide_String;
- Count : in Natural;
- Pad : in Wide_Character := Wide_Space)
- return Wide_String
+ (Source : Wide_String;
+ Count : Natural;
+ Pad : Wide_Character := Wide_Space) return Wide_String
is
Result : Wide_String (1 .. Count);
procedure Head
(Source : in out Wide_String;
- Count : in Natural;
- Justify : in Alignment := Left;
- Pad : in Wide_Character := Ada.Strings.Wide_Space)
+ Count : Natural;
+ Justify : Alignment := Left;
+ Pad : Wide_Character := Ada.Strings.Wide_Space)
is
begin
Move (Source => Head (Source, Count, Pad),
------------
function Insert
- (Source : in Wide_String;
- Before : in Positive;
- New_Item : in Wide_String)
- return Wide_String
+ (Source : Wide_String;
+ Before : Positive;
+ New_Item : Wide_String) return Wide_String
is
Result : Wide_String (1 .. Source'Length + New_Item'Length);
procedure Insert
(Source : in out Wide_String;
- Before : in Positive;
- New_Item : in Wide_String;
- Drop : in Truncation := Error)
+ Before : Positive;
+ New_Item : Wide_String;
+ Drop : Truncation := Error)
is
begin
Move (Source => Insert (Source, Before, New_Item),
----------
procedure Move
- (Source : in Wide_String;
+ (Source : Wide_String;
Target : out Wide_String;
- Drop : in Truncation := Error;
- Justify : in Alignment := Left;
- Pad : in Wide_Character := Wide_Space)
+ Drop : Truncation := Error;
+ Justify : Alignment := Left;
+ Pad : Wide_Character := Wide_Space)
is
Sfirst : constant Integer := Source'First;
Slast : constant Integer := Source'Last;
---------------
function Overwrite
- (Source : in Wide_String;
- Position : in Positive;
- New_Item : in Wide_String)
- return Wide_String
+ (Source : Wide_String;
+ Position : Positive;
+ New_Item : Wide_String) return Wide_String
is
begin
if Position not in Source'First .. Source'Last + 1 then
procedure Overwrite
(Source : in out Wide_String;
- Position : in Positive;
- New_Item : in Wide_String;
- Drop : in Truncation := Right)
+ Position : Positive;
+ New_Item : Wide_String;
+ Drop : Truncation := Right)
is
begin
Move (Source => Overwrite (Source, Position, New_Item),
-------------------
function Replace_Slice
- (Source : in Wide_String;
- Low : in Positive;
- High : in Natural;
- By : in Wide_String)
- return Wide_String
+ (Source : Wide_String;
+ Low : Positive;
+ High : Natural;
+ By : Wide_String) return Wide_String
is
Result_Length : Natural;
procedure Replace_Slice
(Source : in out Wide_String;
- Low : in Positive;
- High : in Natural;
- By : in Wide_String;
- Drop : in Truncation := Error;
- Justify : in Alignment := Left;
- Pad : in Wide_Character := Wide_Space)
+ Low : Positive;
+ High : Natural;
+ By : Wide_String;
+ Drop : Truncation := Error;
+ Justify : Alignment := Left;
+ Pad : Wide_Character := Wide_Space)
is
begin
Move (Replace_Slice (Source, Low, High, By), Source, Drop, Justify, Pad);
----------
function Tail
- (Source : in Wide_String;
- Count : in Natural;
- Pad : in Wide_Character := Wide_Space)
- return Wide_String
+ (Source : Wide_String;
+ Count : Natural;
+ Pad : Wide_Character := Wide_Space) return Wide_String
is
Result : Wide_String (1 .. Count);
procedure Tail
(Source : in out Wide_String;
- Count : in Natural;
- Justify : in Alignment := Left;
- Pad : in Wide_Character := Ada.Strings.Wide_Space)
+ Count : Natural;
+ Justify : Alignment := Left;
+ Pad : Wide_Character := Ada.Strings.Wide_Space)
is
begin
Move (Source => Tail (Source, Count, Pad),
---------------
function Translate
- (Source : in Wide_String;
- Mapping : in Wide_Maps.Wide_Character_Mapping)
- return Wide_String
+ (Source : Wide_String;
+ Mapping : Wide_Maps.Wide_Character_Mapping) return Wide_String
is
Result : Wide_String (1 .. Source'Length);
procedure Translate
(Source : in out Wide_String;
- Mapping : in Wide_Maps.Wide_Character_Mapping)
+ Mapping : Wide_Maps.Wide_Character_Mapping)
is
begin
for J in Source'Range loop
end Translate;
function Translate
- (Source : in Wide_String;
- Mapping : in Wide_Maps.Wide_Character_Mapping_Function)
- return Wide_String
+ (Source : Wide_String;
+ Mapping : Wide_Maps.Wide_Character_Mapping_Function) return Wide_String
is
Result : Wide_String (1 .. Source'Length);
procedure Translate
(Source : in out Wide_String;
- Mapping : in Wide_Maps.Wide_Character_Mapping_Function)
+ Mapping : Wide_Maps.Wide_Character_Mapping_Function)
is
begin
for J in Source'Range loop
----------
function Trim
- (Source : in Wide_String;
- Side : in Trim_End)
- return Wide_String
+ (Source : Wide_String;
+ Side : Trim_End) return Wide_String
is
Low : Natural := Source'First;
High : Natural := Source'Last;
procedure Trim
(Source : in out Wide_String;
- Side : in Trim_End;
- Justify : in Alignment := Left;
- Pad : in Wide_Character := Wide_Space)
+ Side : Trim_End;
+ Justify : Alignment := Left;
+ Pad : Wide_Character := Wide_Space)
is
begin
Move (Source => Trim (Source, Side),
end Trim;
function Trim
- (Source : in Wide_String;
- Left : in Wide_Maps.Wide_Character_Set;
- Right : in Wide_Maps.Wide_Character_Set)
- return Wide_String
+ (Source : Wide_String;
+ Left : Wide_Maps.Wide_Character_Set;
+ Right : Wide_Maps.Wide_Character_Set) return Wide_String
is
Low : Natural := Source'First;
High : Natural := Source'Last;
procedure Trim
(Source : in out Wide_String;
- Left : in Wide_Maps.Wide_Character_Set;
- Right : in Wide_Maps.Wide_Character_Set;
- Justify : in Alignment := Strings.Left;
- Pad : in Wide_Character := Wide_Space)
+ Left : Wide_Maps.Wide_Character_Set;
+ Right : Wide_Maps.Wide_Character_Set;
+ Justify : Alignment := Strings.Left;
+ Pad : Wide_Character := Wide_Space)
is
begin
Move (Source => Trim (Source, Left, Right),
-------------------------------------------------------------------
procedure Move
- (Source : in Wide_String;
+ (Source : Wide_String;
Target : out Wide_String;
- Drop : in Truncation := Error;
- Justify : in Alignment := Left;
- Pad : in Wide_Character := Ada.Strings.Wide_Space);
+ Drop : Truncation := Error;
+ Justify : Alignment := Left;
+ Pad : Wide_Character := Ada.Strings.Wide_Space);
------------------------
-- Search Subprograms --
------------------------
function Index
- (Source : in Wide_String;
- Pattern : in Wide_String;
- Going : in Direction := Forward;
- Mapping : in Wide_Maps.Wide_Character_Mapping := Wide_Maps.Identity)
- return Natural;
+ (Source : Wide_String;
+ Pattern : Wide_String;
+ Going : Direction := Forward;
+ Mapping : Wide_Maps.Wide_Character_Mapping := Wide_Maps.Identity)
+ return Natural;
function Index
- (Source : in Wide_String;
- Pattern : in Wide_String;
- Going : in Direction := Forward;
- Mapping : in Wide_Maps.Wide_Character_Mapping_Function)
- return Natural;
+ (Source : Wide_String;
+ Pattern : Wide_String;
+ Going : Direction := Forward;
+ Mapping : Wide_Maps.Wide_Character_Mapping_Function) return Natural;
function Index
- (Source : in Wide_String;
- Set : in Wide_Maps.Wide_Character_Set;
- Test : in Membership := Inside;
- Going : in Direction := Forward)
- return Natural;
+ (Source : Wide_String;
+ Set : Wide_Maps.Wide_Character_Set;
+ Test : Membership := Inside;
+ Going : Direction := Forward) return Natural;
+
+ function Index
+ (Source : Wide_String;
+ Pattern : Wide_String;
+ From : Positive;
+ Going : Direction := Forward;
+ Mapping : Wide_Maps.Wide_Character_Mapping := Wide_Maps.Identity)
+ return Natural;
+ pragma Ada_05 (Index);
+
+ function Index
+ (Source : Wide_String;
+ Pattern : Wide_String;
+ From : Positive;
+ Going : Direction := Forward;
+ Mapping : Wide_Maps.Wide_Character_Mapping_Function) return Natural;
+ pragma Ada_05 (Index);
+
+ function Index
+ (Source : Wide_String;
+ Set : Wide_Maps.Wide_Character_Set;
+ From : Positive;
+ Test : Membership := Inside;
+ Going : Direction := Forward) return Natural;
+ pragma Ada_05 (Index);
+
+ function Index_Non_Blank
+ (Source : Wide_String;
+ Going : Direction := Forward) return Natural;
function Index_Non_Blank
- (Source : in Wide_String;
- Going : in Direction := Forward)
- return Natural;
+ (Source : Wide_String;
+ From : Positive;
+ Going : Direction := Forward) return Natural;
+ pragma Ada_05 (Index_Non_Blank);
function Count
- (Source : in Wide_String;
- Pattern : in Wide_String;
- Mapping : in Wide_Maps.Wide_Character_Mapping := Wide_Maps.Identity)
- return Natural;
+ (Source : Wide_String;
+ Pattern : Wide_String;
+ Mapping : Wide_Maps.Wide_Character_Mapping := Wide_Maps.Identity)
+ return Natural;
function Count
- (Source : in Wide_String;
- Pattern : in Wide_String;
- Mapping : in Wide_Maps.Wide_Character_Mapping_Function)
- return Natural;
+ (Source : Wide_String;
+ Pattern : Wide_String;
+ Mapping : Wide_Maps.Wide_Character_Mapping_Function) return Natural;
function Count
- (Source : in Wide_String;
- Set : in Wide_Maps.Wide_Character_Set)
- return Natural;
+ (Source : Wide_String;
+ Set : Wide_Maps.Wide_Character_Set) return Natural;
procedure Find_Token
- (Source : in Wide_String;
- Set : in Wide_Maps.Wide_Character_Set;
- Test : in Membership;
+ (Source : Wide_String;
+ Set : Wide_Maps.Wide_Character_Set;
+ Test : Membership;
First : out Positive;
Last : out Natural);
-----------------------------------------
function Translate
- (Source : in Wide_String;
- Mapping : in Wide_Maps.Wide_Character_Mapping)
- return Wide_String;
+ (Source : Wide_String;
+ Mapping : Wide_Maps.Wide_Character_Mapping) return Wide_String;
procedure Translate
(Source : in out Wide_String;
- Mapping : in Wide_Maps.Wide_Character_Mapping);
+ Mapping : Wide_Maps.Wide_Character_Mapping);
function Translate
- (Source : in Wide_String;
- Mapping : in Wide_Maps.Wide_Character_Mapping_Function)
- return Wide_String;
+ (Source : Wide_String;
+ Mapping : Wide_Maps.Wide_Character_Mapping_Function) return Wide_String;
procedure Translate
(Source : in out Wide_String;
- Mapping : in Wide_Maps.Wide_Character_Mapping_Function);
+ Mapping : Wide_Maps.Wide_Character_Mapping_Function);
--------------------------------------------
-- Wide_String Transformation Subprograms --
--------------------------------------------
function Replace_Slice
- (Source : in Wide_String;
- Low : in Positive;
- High : in Natural;
- By : in Wide_String)
- return Wide_String;
+ (Source : Wide_String;
+ Low : Positive;
+ High : Natural;
+ By : Wide_String) return Wide_String;
procedure Replace_Slice
(Source : in out Wide_String;
- Low : in Positive;
- High : in Natural;
- By : in Wide_String;
- Drop : in Truncation := Error;
- Justify : in Alignment := Left;
- Pad : in Wide_Character := Ada.Strings.Wide_Space);
+ Low : Positive;
+ High : Natural;
+ By : Wide_String;
+ Drop : Truncation := Error;
+ Justify : Alignment := Left;
+ Pad : Wide_Character := Ada.Strings.Wide_Space);
function Insert
- (Source : in Wide_String;
- Before : in Positive;
- New_Item : in Wide_String)
- return Wide_String;
+ (Source : Wide_String;
+ Before : Positive;
+ New_Item : Wide_String) return Wide_String;
procedure Insert
(Source : in out Wide_String;
- Before : in Positive;
- New_Item : in Wide_String;
- Drop : in Truncation := Error);
+ Before : Positive;
+ New_Item : Wide_String;
+ Drop : Truncation := Error);
function Overwrite
- (Source : in Wide_String;
- Position : in Positive;
- New_Item : in Wide_String)
- return Wide_String;
+ (Source : Wide_String;
+ Position : Positive;
+ New_Item : Wide_String) return Wide_String;
procedure Overwrite
(Source : in out Wide_String;
- Position : in Positive;
- New_Item : in Wide_String;
- Drop : in Truncation := Right);
+ Position : Positive;
+ New_Item : Wide_String;
+ Drop : Truncation := Right);
function Delete
- (Source : in Wide_String;
- From : in Positive;
- Through : in Natural)
- return Wide_String;
+ (Source : Wide_String;
+ From : Positive;
+ Through : Natural) return Wide_String;
procedure Delete
(Source : in out Wide_String;
- From : in Positive;
- Through : in Natural;
- Justify : in Alignment := Left;
- Pad : in Wide_Character := Ada.Strings.Wide_Space);
+ From : Positive;
+ Through : Natural;
+ Justify : Alignment := Left;
+ Pad : Wide_Character := Ada.Strings.Wide_Space);
--------------------------------------
-- Wide_String Selector Subprograms --
--------------------------------------
function Trim
- (Source : in Wide_String;
- Side : in Trim_End)
- return Wide_String;
+ (Source : Wide_String;
+ Side : Trim_End) return Wide_String;
procedure Trim
(Source : in out Wide_String;
- Side : in Trim_End;
- Justify : in Alignment := Left;
- Pad : in Wide_Character := Wide_Space);
+ Side : Trim_End;
+ Justify : Alignment := Left;
+ Pad : Wide_Character := Wide_Space);
function Trim
- (Source : in Wide_String;
- Left : in Wide_Maps.Wide_Character_Set;
- Right : in Wide_Maps.Wide_Character_Set)
- return Wide_String;
+ (Source : Wide_String;
+ Left : Wide_Maps.Wide_Character_Set;
+ Right : Wide_Maps.Wide_Character_Set) return Wide_String;
procedure Trim
(Source : in out Wide_String;
- Left : in Wide_Maps.Wide_Character_Set;
- Right : in Wide_Maps.Wide_Character_Set;
- Justify : in Alignment := Ada.Strings.Left;
- Pad : in Wide_Character := Ada.Strings.Wide_Space);
+ Left : Wide_Maps.Wide_Character_Set;
+ Right : Wide_Maps.Wide_Character_Set;
+ Justify : Alignment := Ada.Strings.Left;
+ Pad : Wide_Character := Ada.Strings.Wide_Space);
function Head
- (Source : in Wide_String;
- Count : in Natural;
- Pad : in Wide_Character := Ada.Strings.Wide_Space)
- return Wide_String;
+ (Source : Wide_String;
+ Count : Natural;
+ Pad : Wide_Character := Ada.Strings.Wide_Space) return Wide_String;
procedure Head
(Source : in out Wide_String;
- Count : in Natural;
- Justify : in Alignment := Left;
- Pad : in Wide_Character := Ada.Strings.Wide_Space);
+ Count : Natural;
+ Justify : Alignment := Left;
+ Pad : Wide_Character := Ada.Strings.Wide_Space);
function Tail
- (Source : in Wide_String;
- Count : in Natural;
- Pad : in Wide_Character := Ada.Strings.Wide_Space)
- return Wide_String;
+ (Source : Wide_String;
+ Count : Natural;
+ Pad : Wide_Character := Ada.Strings.Wide_Space) return Wide_String;
procedure Tail
(Source : in out Wide_String;
- Count : in Natural;
- Justify : in Alignment := Left;
- Pad : in Wide_Character := Ada.Strings.Wide_Space);
+ Count : Natural;
+ Justify : Alignment := Left;
+ Pad : Wide_Character := Ada.Strings.Wide_Space);
---------------------------------------
-- Wide_String Constructor Functions --
---------------------------------------
function "*"
- (Left : in Natural;
- Right : in Wide_Character)
- return Wide_String;
+ (Left : Natural;
+ Right : Wide_Character) return Wide_String;
function "*"
- (Left : in Natural;
- Right : in Wide_String)
- return Wide_String;
+ (Left : Natural;
+ Right : Wide_String) return Wide_String;
end Ada.Strings.Wide_Fixed;
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2002 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
---------
function "-"
- (Left, Right : in Wide_Character_Set)
- return Wide_Character_Set
+ (Left, Right : Wide_Character_Set) return Wide_Character_Set
is
LS : constant Wide_Character_Ranges_Access := Left.Set;
RS : constant Wide_Character_Ranges_Access := Right.Set;
-----------
function "and"
- (Left, Right : in Wide_Character_Set)
- return Wide_Character_Set
+ (Left, Right : Wide_Character_Set) return Wide_Character_Set
is
LS : constant Wide_Character_Ranges_Access := Left.Set;
RS : constant Wide_Character_Ranges_Access := Right.Set;
-----------
function "not"
- (Right : in Wide_Character_Set)
- return Wide_Character_Set
+ (Right : Wide_Character_Set) return Wide_Character_Set
is
RS : constant Wide_Character_Ranges_Access := Right.Set;
----------
function "or"
- (Left, Right : in Wide_Character_Set)
- return Wide_Character_Set
+ (Left, Right : Wide_Character_Set) return Wide_Character_Set
is
LS : constant Wide_Character_Ranges_Access := Left.Set;
RS : constant Wide_Character_Ranges_Access := Right.Set;
-----------
function "xor"
- (Left, Right : in Wide_Character_Set)
- return Wide_Character_Set
+ (Left, Right : Wide_Character_Set) return Wide_Character_Set
is
begin
return (Left or Right) - (Left and Right);
-----------
function Is_In
- (Element : in Wide_Character;
- Set : in Wide_Character_Set)
- return Boolean
+ (Element : Wide_Character;
+ Set : Wide_Character_Set) return Boolean
is
L, R, M : Natural;
SS : constant Wide_Character_Ranges_Access := Set.Set;
---------------
function Is_Subset
- (Elements : in Wide_Character_Set;
- Set : in Wide_Character_Set)
- return Boolean
+ (Elements : Wide_Character_Set;
+ Set : Wide_Character_Set) return Boolean
is
ES : constant Wide_Character_Ranges_Access := Elements.Set;
SS : constant Wide_Character_Ranges_Access := Set.Set;
---------------
function To_Domain
- (Map : in Wide_Character_Mapping)
- return Wide_Character_Sequence
+ (Map : Wide_Character_Mapping) return Wide_Character_Sequence
is
begin
return Map.Map.Domain;
----------------
function To_Mapping
- (From, To : in Wide_Character_Sequence)
- return Wide_Character_Mapping
+ (From, To : Wide_Character_Sequence) return Wide_Character_Mapping
is
Domain : Wide_Character_Sequence (1 .. From'Length);
Rangev : Wide_Character_Sequence (1 .. To'Length);
--------------
function To_Range
- (Map : in Wide_Character_Mapping)
- return Wide_Character_Sequence
+ (Map : Wide_Character_Mapping) return Wide_Character_Sequence
is
begin
return Map.Map.Rangev;
---------------
function To_Ranges
- (Set : in Wide_Character_Set)
- return Wide_Character_Ranges
+ (Set : in Wide_Character_Set) return Wide_Character_Ranges
is
begin
return Set.Set.all;
-----------------
function To_Sequence
- (Set : in Wide_Character_Set)
- return Wide_Character_Sequence
+ (Set : Wide_Character_Set) return Wide_Character_Sequence
is
SS : constant Wide_Character_Ranges_Access := Set.Set;
-- Case of multiple range input
function To_Set
- (Ranges : in Wide_Character_Ranges)
- return Wide_Character_Set
+ (Ranges : Wide_Character_Ranges) return Wide_Character_Set
is
Result : Wide_Character_Ranges (Ranges'Range);
N : Natural := 0;
-- Case of single range input
function To_Set
- (Span : in Wide_Character_Range)
- return Wide_Character_Set
+ (Span : Wide_Character_Range) return Wide_Character_Set
is
begin
if Span.Low > Span.High then
-- Case of wide string input
function To_Set
- (Sequence : in Wide_Character_Sequence)
- return Wide_Character_Set
+ (Sequence : Wide_Character_Sequence) return Wide_Character_Set
is
R : Wide_Character_Ranges (1 .. Sequence'Length);
-- Case of single wide character input
function To_Set
- (Singleton : in Wide_Character)
- return Wide_Character_Set
+ (Singleton : Wide_Character) return Wide_Character_Set
is
begin
return
-----------
function Value
- (Map : in Wide_Character_Mapping;
- Element : in Wide_Character)
- return Wide_Character
+ (Map : Wide_Character_Mapping;
+ Element : Wide_Character) return Wide_Character
is
L, R, M : Natural;
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-1998 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 Free Software Foundation, Inc. --
-- --
-- This specification is derived from the Ada Reference Manual for use with --
-- GNAT. The copyright notice above, and the license provisions that follow --
array (Positive range <>) of Wide_Character_Range;
function To_Set
- (Ranges : in Wide_Character_Ranges)
- return Wide_Character_Set;
+ (Ranges : Wide_Character_Ranges) return Wide_Character_Set;
function To_Set
- (Span : in Wide_Character_Range)
- return Wide_Character_Set;
+ (Span : Wide_Character_Range) return Wide_Character_Set;
function To_Ranges
- (Set : in Wide_Character_Set)
- return Wide_Character_Ranges;
+ (Set : in Wide_Character_Set) return Wide_Character_Ranges;
---------------------------------------
-- Operations on Wide Character Sets --
function "=" (Left, Right : in Wide_Character_Set) return Boolean;
function "not"
- (Right : in Wide_Character_Set)
- return Wide_Character_Set;
+ (Right : Wide_Character_Set) return Wide_Character_Set;
function "and"
- (Left, Right : in Wide_Character_Set)
- return Wide_Character_Set;
+ (Left, Right : Wide_Character_Set) return Wide_Character_Set;
function "or"
- (Left, Right : in Wide_Character_Set)
- return Wide_Character_Set;
+ (Left, Right : Wide_Character_Set) return Wide_Character_Set;
function "xor"
- (Left, Right : in Wide_Character_Set)
- return Wide_Character_Set;
+ (Left, Right : Wide_Character_Set) return Wide_Character_Set;
function "-"
- (Left, Right : in Wide_Character_Set)
- return Wide_Character_Set;
+ (Left, Right : Wide_Character_Set) return Wide_Character_Set;
function Is_In
- (Element : in Wide_Character;
- Set : in Wide_Character_Set)
- return Boolean;
+ (Element : Wide_Character;
+ Set : Wide_Character_Set) return Boolean;
function Is_Subset
- (Elements : in Wide_Character_Set;
- Set : in Wide_Character_Set)
- return Boolean;
+ (Elements : Wide_Character_Set;
+ Set : Wide_Character_Set) return Boolean;
function "<="
- (Left : in Wide_Character_Set;
- Right : in Wide_Character_Set)
- return Boolean
+ (Left : Wide_Character_Set;
+ Right : Wide_Character_Set) return Boolean
renames Is_Subset;
subtype Wide_Character_Sequence is Wide_String;
-- Alternative representation for a set of character values
function To_Set
- (Sequence : in Wide_Character_Sequence)
- return Wide_Character_Set;
+ (Sequence : Wide_Character_Sequence) return Wide_Character_Set;
function To_Set
- (Singleton : in Wide_Character)
- return Wide_Character_Set;
+ (Singleton : Wide_Character) return Wide_Character_Set;
function To_Sequence
- (Set : in Wide_Character_Set)
- return Wide_Character_Sequence;
+ (Set : Wide_Character_Set) return Wide_Character_Sequence;
-----------------------------------------
-- Wide Character Mapping Declarations --
-- Representation for a wide character to wide character mapping:
function Value
- (Map : in Wide_Character_Mapping;
- Element : in Wide_Character)
- return Wide_Character;
+ (Map : Wide_Character_Mapping;
+ Element : Wide_Character) return Wide_Character;
Identity : constant Wide_Character_Mapping;
---------------------------------
function To_Mapping
- (From, To : in Wide_Character_Sequence)
- return Wide_Character_Mapping;
+ (From, To : Wide_Character_Sequence) return Wide_Character_Mapping;
function To_Domain
- (Map : in Wide_Character_Mapping)
- return Wide_Character_Sequence;
+ (Map : Wide_Character_Mapping) return Wide_Character_Sequence;
function To_Range
- (Map : in Wide_Character_Mapping)
- return Wide_Character_Sequence;
+ (Map : Wide_Character_Mapping) return Wide_Character_Sequence;
type Wide_Character_Mapping_Function is
- access function (From : in Wide_Character) return Wide_Character;
+ access function (From : Wide_Character) return Wide_Character;
private
package AF renames Ada.Finalization;
-- --
-- B o d y --
-- --
--- Copyright (C) 1992,1993,1994 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
function Belongs
(Element : Wide_Character;
Set : Wide_Maps.Wide_Character_Set;
- Test : Membership)
- return Boolean;
+ Test : Membership) return Boolean;
pragma Inline (Belongs);
-- Determines if the given element is in (Test = Inside) or not in
-- (Test = Outside) the given character set.
function Belongs
(Element : Wide_Character;
Set : Wide_Maps.Wide_Character_Set;
- Test : Membership)
- return Boolean is
-
+ Test : Membership) return Boolean
+ is
begin
if Test = Inside then
return Is_In (Element, Set);
-----------
function Count
- (Source : in Wide_String;
- Pattern : in Wide_String;
- Mapping : in Wide_Maps.Wide_Character_Mapping := Wide_Maps.Identity)
- return Natural
+ (Source : Wide_String;
+ Pattern : Wide_String;
+ Mapping : Wide_Maps.Wide_Character_Mapping := Wide_Maps.Identity)
+ return Natural
is
N : Natural;
J : Natural;
end Count;
function Count
- (Source : in Wide_String;
- Pattern : in Wide_String;
- Mapping : in Wide_Maps.Wide_Character_Mapping_Function)
- return Natural
+ (Source : Wide_String;
+ Pattern : Wide_String;
+ Mapping : Wide_Maps.Wide_Character_Mapping_Function) return Natural
is
Mapped_Source : Wide_String (Source'Range);
return Count (Mapped_Source, Pattern);
end Count;
- function Count (Source : in Wide_String;
- Set : in Wide_Maps.Wide_Character_Set)
- return Natural
+ function Count
+ (Source : in Wide_String;
+ Set : Wide_Maps.Wide_Character_Set) return Natural
is
N : Natural := 0;
----------------
procedure Find_Token
- (Source : in Wide_String;
- Set : in Wide_Maps.Wide_Character_Set;
- Test : in Membership;
+ (Source : Wide_String;
+ Set : Wide_Maps.Wide_Character_Set;
+ Test : Membership;
First : out Positive;
Last : out Natural)
is
-----------
function Index
- (Source : in Wide_String;
- Pattern : in Wide_String;
- Going : in Direction := Forward;
- Mapping : in Wide_Maps.Wide_Character_Mapping := Wide_Maps.Identity)
- return Natural
+ (Source : Wide_String;
+ Pattern : Wide_String;
+ Going : Direction := Forward;
+ Mapping : Wide_Maps.Wide_Character_Mapping := Wide_Maps.Identity)
+ return Natural
is
begin
if Pattern = "" then
return 0;
end Index;
- -----------
- -- Index --
- -----------
-
function Index
- (Source : in Wide_String;
- Pattern : in Wide_String;
- Going : in Direction := Forward;
- Mapping : in Wide_Maps.Wide_Character_Mapping_Function)
- return Natural
+ (Source : Wide_String;
+ Pattern : Wide_String;
+ Going : Direction := Forward;
+ Mapping : Wide_Maps.Wide_Character_Mapping_Function) return Natural
is
Mapped_Source : Wide_String (Source'Range);
end Index;
function Index
- (Source : in Wide_String;
- Set : in Wide_Maps.Wide_Character_Set;
- Test : in Membership := Inside;
- Going : in Direction := Forward)
- return Natural
+ (Source : Wide_String;
+ Set : Wide_Maps.Wide_Character_Set;
+ Test : Membership := Inside;
+ Going : Direction := Forward) return Natural
is
begin
if Going = Forward then
return 0;
end Index;
+ function Index
+ (Source : Wide_String;
+ Pattern : Wide_String;
+ From : Positive;
+ Going : Direction := Forward;
+ Mapping : Wide_Maps.Wide_Character_Mapping := Wide_Maps.Identity)
+ return Natural
+ is
+ begin
+ if Going = Forward then
+ if From < Source'First then
+ raise Index_Error;
+ end if;
+
+ return
+ Index (Source (From .. Source'Last), Pattern, Forward, Mapping);
+
+ else
+ if From > Source'Last then
+ raise Index_Error;
+ end if;
+
+ return
+ Index (Source (Source'First .. From), Pattern, Backward, Mapping);
+ end if;
+ end Index;
+
+ function Index
+ (Source : Wide_String;
+ Pattern : Wide_String;
+ From : Positive;
+ Going : Direction := Forward;
+ Mapping : Wide_Maps.Wide_Character_Mapping_Function) return Natural
+ is
+ begin
+ if Going = Forward then
+ if From < Source'First then
+ raise Index_Error;
+ end if;
+
+ return Index
+ (Source (From .. Source'Last), Pattern, Forward, Mapping);
+
+ else
+ if From > Source'Last then
+ raise Index_Error;
+ end if;
+
+ return Index
+ (Source (Source'First .. From), Pattern, Backward, Mapping);
+ end if;
+ end Index;
+
+ function Index
+ (Source : Wide_String;
+ Set : Wide_Maps.Wide_Character_Set;
+ From : Positive;
+ Test : Membership := Inside;
+ Going : Direction := Forward) return Natural
+ is
+ begin
+ if Going = Forward then
+ if From < Source'First then
+ raise Index_Error;
+ end if;
+
+ return
+ Index (Source (From .. Source'Last), Set, Test, Forward);
+
+ else
+ if From > Source'Last then
+ raise Index_Error;
+ end if;
+
+ return
+ Index (Source (Source'First .. From), Set, Test, Backward);
+ end if;
+ end Index;
+
---------------------
-- Index_Non_Blank --
---------------------
function Index_Non_Blank
- (Source : in Wide_String;
- Going : in Direction := Forward)
- return Natural
+ (Source : Wide_String;
+ Going : Direction := Forward) return Natural
is
begin
if Going = Forward then
-- Fall through if no match
return 0;
+ end Index_Non_Blank;
+ function Index_Non_Blank
+ (Source : Wide_String;
+ From : Positive;
+ Going : Direction := Forward) return Natural
+ is
+ begin
+ if Going = Forward then
+ if From < Source'First then
+ raise Index_Error;
+ end if;
+
+ return
+ Index_Non_Blank (Source (From .. Source'Last), Forward);
+
+ else
+ if From > Source'Last then
+ raise Index_Error;
+ end if;
+
+ return
+ Index_Non_Blank (Source (Source'First .. From), Backward);
+ end if;
end Index_Non_Blank;
end Ada.Strings.Wide_Search;
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-1997 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
private package Ada.Strings.Wide_Search is
pragma Preelaborate (Wide_Search);
- function Index (Source : in Wide_String;
- Pattern : in Wide_String;
- Going : in Direction := Forward;
- Mapping : in Wide_Maps.Wide_Character_Mapping :=
- Wide_Maps.Identity)
- return Natural;
+ function Index
+ (Source : Wide_String;
+ Pattern : Wide_String;
+ Going : Direction := Forward;
+ Mapping : Wide_Maps.Wide_Character_Mapping :=
+ Wide_Maps.Identity) return Natural;
- function Index (Source : in Wide_String;
- Pattern : in Wide_String;
- Going : in Direction := Forward;
- Mapping : in Wide_Maps.Wide_Character_Mapping_Function)
- return Natural;
+ function Index
+ (Source : Wide_String;
+ Pattern : Wide_String;
+ Going : Direction := Forward;
+ Mapping : Wide_Maps.Wide_Character_Mapping_Function) return Natural;
- function Index (Source : in Wide_String;
- Set : in Wide_Maps.Wide_Character_Set;
- Test : in Membership := Inside;
- Going : in Direction := Forward)
- return Natural;
+ function Index
+ (Source : Wide_String;
+ Set : Wide_Maps.Wide_Character_Set;
+ Test : Membership := Inside;
+ Going : Direction := Forward) return Natural;
- function Index_Non_Blank (Source : in Wide_String;
- Going : in Direction := Forward)
+ function Index
+ (Source : Wide_String;
+ Pattern : Wide_String;
+ From : Positive;
+ Going : Direction := Forward;
+ Mapping : Wide_Maps.Wide_Character_Mapping := Wide_Maps.Identity)
return Natural;
- function Count (Source : in Wide_String;
- Pattern : in Wide_String;
- Mapping : in Wide_Maps.Wide_Character_Mapping :=
- Wide_Maps.Identity)
- return Natural;
+ function Index
+ (Source : Wide_String;
+ Pattern : Wide_String;
+ From : Positive;
+ Going : Direction := Forward;
+ Mapping : Wide_Maps.Wide_Character_Mapping_Function) return Natural;
- function Count (Source : in Wide_String;
- Pattern : in Wide_String;
- Mapping : in Wide_Maps.Wide_Character_Mapping_Function)
- return Natural;
+ function Index
+ (Source : Wide_String;
+ Set : Wide_Maps.Wide_Character_Set;
+ From : Positive;
+ Test : Membership := Inside;
+ Going : Direction := Forward) return Natural;
+
+ function Index_Non_Blank
+ (Source : Wide_String;
+ Going : Direction := Forward) return Natural;
- function Count (Source : in Wide_String;
- Set : in Wide_Maps.Wide_Character_Set)
+ function Index_Non_Blank
+ (Source : Wide_String;
+ From : Positive;
+ Going : Direction := Forward) return Natural;
+
+ function Count
+ (Source : Wide_String;
+ Pattern : Wide_String;
+ Mapping : Wide_Maps.Wide_Character_Mapping := Wide_Maps.Identity)
return Natural;
+ function Count
+ (Source : Wide_String;
+ Pattern : Wide_String;
+ Mapping : Wide_Maps.Wide_Character_Mapping_Function) return Natural;
+
+ function Count
+ (Source : Wide_String;
+ Set : Wide_Maps.Wide_Character_Set) return Natural;
- procedure Find_Token (Source : in Wide_String;
- Set : in Wide_Maps.Wide_Character_Set;
- Test : in Membership;
- First : out Positive;
- Last : out Natural);
+ procedure Find_Token
+ (Source : Wide_String;
+ Set : Wide_Maps.Wide_Character_Set;
+ Test : Membership;
+ First : out Positive;
+ Last : out Natural);
end Ada.Strings.Wide_Search;
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2004 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
function AFCB_Allocate (Control_Block : Text_AFCB) return FCB.AFCB_Ptr is
pragma Unreferenced (Control_Block);
-
begin
return new Text_AFCB;
end AFCB_Allocate;
-- to exceed the value of Count'Last, i.e. no check is required for
-- overflow raising layout error.
- function Col (File : in File_Type) return Positive_Count is
+ function Col (File : File_Type) return Positive_Count is
begin
FIO.Check_File_Open (AP (File));
return File.Col;
procedure Create
(File : in out File_Type;
- Mode : in File_Mode := Out_File;
- Name : in String := "";
- Form : in String := "")
+ Mode : File_Mode := Out_File;
+ Name : String := "";
+ Form : String := "")
is
Dummy_File_Control_Block : Text_AFCB;
pragma Warnings (Off, Dummy_File_Control_Block);
-- End_Of_File --
-----------------
- function End_Of_File (File : in File_Type) return Boolean is
- ch : int;
+ function End_Of_File (File : File_Type) return Boolean is
+ ch : int;
begin
FIO.Check_Read_Status (AP (File));
-- End_Of_Line --
-----------------
- function End_Of_Line (File : in File_Type) return Boolean is
+ function End_Of_Line (File : File_Type) return Boolean is
ch : int;
begin
-- End_Of_Page --
-----------------
- function End_Of_Page (File : in File_Type) return Boolean is
+ function End_Of_Page (File : File_Type) return Boolean is
ch : int;
begin
-- Flush --
-----------
- procedure Flush (File : in File_Type) is
+ procedure Flush (File : File_Type) is
begin
FIO.Flush (AP (File));
end Flush;
-- Form --
----------
- function Form (File : in File_Type) return String is
+ function Form (File : File_Type) return String is
begin
return FIO.Form (AP (File));
end Form;
---------
procedure Get
- (File : in File_Type;
+ (File : File_Type;
Item : out Character)
is
ch : int;
end Get;
procedure Get
- (File : in File_Type;
+ (File : File_Type;
Item : out String)
is
ch : int;
-- More work required here ???
procedure Get_Immediate
- (File : in File_Type;
+ (File : File_Type;
Item : out Character)
is
ch : int;
end Get_Immediate;
procedure Get_Immediate
- (File : in File_Type;
+ (File : File_Type;
Item : out Character;
Available : out Boolean)
is
--------------
procedure Get_Line
- (File : in File_Type;
+ (File : File_Type;
Item : out String;
Last : out Natural)
is
Get_Line (Current_In, Item, Last);
end Get_Line;
+ function Get_Line (File : File_Type) return String is
+ Buffer : String (1 .. 500);
+ Last : Natural;
+
+ function Get_Rest (S : String) return String;
+ -- This is a recursive function that reads the rest of the line and
+ -- returns it. S is the part read so far.
+
+ --------------
+ -- Get_Rest --
+ --------------
+
+ function Get_Rest (S : String) return String is
+
+ -- Each time we allocate a buffer the same size as what we have
+ -- read so far. This limits us to a logarithmic number of calls
+ -- to Get_Rest and also ensures only a linear use of stack space.
+
+ Buffer : String (1 .. S'Length);
+ Last : Natural;
+
+ begin
+ Get_Line (File, Buffer, Last);
+
+ declare
+ R : constant String := S & Buffer (1 .. Last);
+ begin
+ if Last < Buffer'Last then
+ return R;
+ else
+ return Get_Rest (R);
+ end if;
+ end;
+ end Get_Rest;
+
+ -- Start of processing for Get_Line
+
+ begin
+ Get_Line (File, Buffer, Last);
+
+ if Last < Buffer'Last then
+ return Buffer (1 .. Last);
+ else
+ return Get_Rest (Buffer (1 .. Last));
+ end if;
+ end Get_Line;
+
+ function Get_Line return String is
+ begin
+ return Get_Line (Current_In);
+ end Get_Line;
+
----------
-- Getc --
----------
-- Is_Open --
-------------
- function Is_Open (File : in File_Type) return Boolean is
+ function Is_Open (File : File_Type) return Boolean is
begin
return FIO.Is_Open (AP (File));
end Is_Open;
-- to exceed the value of Count'Last, i.e. no check is required for
-- overflow raising layout error.
- function Line (File : in File_Type) return Positive_Count is
+ function Line (File : File_Type) return Positive_Count is
begin
FIO.Check_File_Open (AP (File));
return File.Line;
-- Line_Length --
-----------------
- function Line_Length (File : in File_Type) return Count is
+ function Line_Length (File : File_Type) return Count is
begin
FIO.Check_Write_Status (AP (File));
return File.Line_Length;
----------------
procedure Look_Ahead
- (File : in File_Type;
+ (File : File_Type;
Item : out Character;
End_Of_Line : out Boolean)
is
-- Mode --
----------
- function Mode (File : in File_Type) return File_Mode is
+ function Mode (File : File_Type) return File_Mode is
begin
return To_TIO (FIO.Mode (AP (File)));
end Mode;
-- Name --
----------
- function Name (File : in File_Type) return String is
+ function Name (File : File_Type) return String is
begin
return FIO.Name (AP (File));
end Name;
--------------
procedure New_Line
- (File : in File_Type;
- Spacing : in Positive_Count := 1)
+ (File : File_Type;
+ Spacing : Positive_Count := 1)
is
begin
-- Raise Constraint_Error if out of range value. The reason for this
File.Col := 1;
end New_Line;
- procedure New_Line (Spacing : in Positive_Count := 1) is
+ procedure New_Line (Spacing : Positive_Count := 1) is
begin
New_Line (Current_Out, Spacing);
end New_Line;
-- New_Page --
--------------
- procedure New_Page (File : in File_Type) is
+ procedure New_Page (File : File_Type) is
begin
FIO.Check_Write_Status (AP (File));
procedure Open
(File : in out File_Type;
- Mode : in File_Mode;
- Name : in String;
- Form : in String := "")
+ Mode : File_Mode;
+ Name : String;
+ Form : String := "")
is
Dummy_File_Control_Block : Text_AFCB;
pragma Warnings (Off, Dummy_File_Control_Block);
-- to exceed the value of Count'Last, i.e. no check is required for
-- overflow raising layout error.
- function Page (File : in File_Type) return Positive_Count is
+ function Page (File : File_Type) return Positive_Count is
begin
FIO.Check_File_Open (AP (File));
return File.Page;
-- Page_Length --
-----------------
- function Page_Length (File : in File_Type) return Count is
+ function Page_Length (File : File_Type) return Count is
begin
FIO.Check_Write_Status (AP (File));
return File.Page_Length;
---------
procedure Put
- (File : in File_Type;
- Item : in Character)
+ (File : File_Type;
+ Item : Character)
is
begin
FIO.Check_Write_Status (AP (File));
File.Col := File.Col + 1;
end Put;
- procedure Put (Item : in Character) is
+ procedure Put (Item : Character) is
begin
FIO.Check_Write_Status (AP (Current_Out));
---------
procedure Put
- (File : in File_Type;
- Item : in String)
+ (File : File_Type;
+ Item : String)
is
begin
FIO.Check_Write_Status (AP (File));
end if;
end Put;
- procedure Put (Item : in String) is
+ procedure Put (Item : String) is
begin
Put (Current_Out, Item);
end Put;
--------------
procedure Put_Line
- (File : in File_Type;
- Item : in String)
+ (File : File_Type;
+ Item : String)
is
Ilen : Natural := Item'Length;
Istart : Natural := Item'First;
end;
end Put_Line;
- procedure Put_Line (Item : in String) is
+ procedure Put_Line (Item : String) is
begin
Put_Line (Current_Out, Item);
end Put_Line;
procedure Reset
(File : in out File_Type;
- Mode : in File_Mode)
+ Mode : File_Mode)
is
begin
-- Don't allow change of mode for current file (RM A.10.2(5))
-------------
procedure Set_Col
- (File : in File_Type;
- To : in Positive_Count)
+ (File : File_Type;
+ To : Positive_Count)
is
ch : int;
end if;
end Set_Col;
- procedure Set_Col (To : in Positive_Count) is
+ procedure Set_Col (To : Positive_Count) is
begin
Set_Col (Current_Out, To);
end Set_Col;
-- Set_Error --
---------------
- procedure Set_Error (File : in File_Type) is
+ procedure Set_Error (File : File_Type) is
begin
FIO.Check_Write_Status (AP (File));
Current_Err := File;
-- Set_Input --
---------------
- procedure Set_Input (File : in File_Type) is
+ procedure Set_Input (File : File_Type) is
begin
FIO.Check_Read_Status (AP (File));
Current_In := File;
--------------
procedure Set_Line
- (File : in File_Type;
- To : in Positive_Count)
+ (File : File_Type;
+ To : Positive_Count)
is
begin
-- Raise Constraint_Error if out of range value. The reason for this
end if;
end Set_Line;
- procedure Set_Line (To : in Positive_Count) is
+ procedure Set_Line (To : Positive_Count) is
begin
Set_Line (Current_Out, To);
end Set_Line;
-- Set_Line_Length --
---------------------
- procedure Set_Line_Length (File : in File_Type; To : in Count) is
+ procedure Set_Line_Length (File : File_Type; To : Count) is
begin
-- Raise Constraint_Error if out of range value. The reason for this
-- explicit test is that we don't want junk values around, even if
File.Line_Length := To;
end Set_Line_Length;
- procedure Set_Line_Length (To : in Count) is
+ procedure Set_Line_Length (To : Count) is
begin
Set_Line_Length (Current_Out, To);
end Set_Line_Length;
-- Set_Output --
----------------
- procedure Set_Output (File : in File_Type) is
+ procedure Set_Output (File : File_Type) is
begin
FIO.Check_Write_Status (AP (File));
Current_Out := File;
-- Set_Page_Length --
---------------------
- procedure Set_Page_Length (File : in File_Type; To : in Count) is
+ procedure Set_Page_Length (File : File_Type; To : Count) is
begin
-- Raise Constraint_Error if out of range value. The reason for this
-- explicit test is that we don't want junk values around, even if
File.Page_Length := To;
end Set_Page_Length;
- procedure Set_Page_Length (To : in Count) is
+ procedure Set_Page_Length (To : Count) is
begin
Set_Page_Length (Current_Out, To);
end Set_Page_Length;
---------------
procedure Skip_Line
- (File : in File_Type;
- Spacing : in Positive_Count := 1)
+ (File : File_Type;
+ Spacing : Positive_Count := 1)
is
ch : int;
end loop;
end Skip_Line;
- procedure Skip_Line (Spacing : in Positive_Count := 1) is
+ procedure Skip_Line (Spacing : Positive_Count := 1) is
begin
Skip_Line (Current_In, Spacing);
end Skip_Line;
-- Skip_Page --
---------------
- procedure Skip_Page (File : in File_Type) is
+ procedure Skip_Page (File : File_Type) is
ch : int;
begin
procedure Write
(File : in out Text_AFCB;
- Item : in Stream_Element_Array)
+ Item : Stream_Element_Array)
is
function Has_Translated_Characters return Boolean;
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2002 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 Free Software Foundation, Inc. --
-- --
-- This specification is derived from the Ada Reference Manual for use with --
-- GNAT. The copyright notice above, and the license provisions that follow --
procedure Create
(File : in out File_Type;
- Mode : in File_Mode := Out_File;
- Name : in String := "";
- Form : in String := "");
+ Mode : File_Mode := Out_File;
+ Name : String := "";
+ Form : String := "");
procedure Open
(File : in out File_Type;
- Mode : in File_Mode;
- Name : in String;
- Form : in String := "");
+ Mode : File_Mode;
+ Name : String;
+ Form : String := "");
procedure Close (File : in out File_Type);
procedure Delete (File : in out File_Type);
- procedure Reset (File : in out File_Type; Mode : in File_Mode);
+ procedure Reset (File : in out File_Type; Mode : File_Mode);
procedure Reset (File : in out File_Type);
- function Mode (File : in File_Type) return File_Mode;
- function Name (File : in File_Type) return String;
- function Form (File : in File_Type) return String;
+ function Mode (File : File_Type) return File_Mode;
+ function Name (File : File_Type) return String;
+ function Form (File : File_Type) return String;
- function Is_Open (File : in File_Type) return Boolean;
+ function Is_Open (File : File_Type) return Boolean;
------------------------------------------------------
-- Control of default input, output and error files --
------------------------------------------------------
- procedure Set_Input (File : in File_Type);
- procedure Set_Output (File : in File_Type);
- procedure Set_Error (File : in File_Type);
+ procedure Set_Input (File : File_Type);
+ procedure Set_Output (File : File_Type);
+ procedure Set_Error (File : File_Type);
function Standard_Input return File_Type;
function Standard_Output return File_Type;
-- Note: The parameter file is IN OUT in the RM, but this is clearly
-- an oversight, and was intended to be IN, see AI95-00057.
- procedure Flush (File : in File_Type);
+ procedure Flush (File : File_Type);
procedure Flush;
--------------------------------------------
-- Specification of line and page lengths --
--------------------------------------------
- procedure Set_Line_Length (File : in File_Type; To : in Count);
- procedure Set_Line_Length (To : in Count);
+ procedure Set_Line_Length (File : File_Type; To : Count);
+ procedure Set_Line_Length (To : Count);
- procedure Set_Page_Length (File : in File_Type; To : in Count);
- procedure Set_Page_Length (To : in Count);
+ procedure Set_Page_Length (File : File_Type; To : Count);
+ procedure Set_Page_Length (To : Count);
- function Line_Length (File : in File_Type) return Count;
+ function Line_Length (File : File_Type) return Count;
function Line_Length return Count;
- function Page_Length (File : in File_Type) return Count;
+ function Page_Length (File : File_Type) return Count;
function Page_Length return Count;
------------------------------------
-- Column, Line, and Page Control --
------------------------------------
- procedure New_Line (File : in File_Type; Spacing : in Positive_Count := 1);
- procedure New_Line (Spacing : in Positive_Count := 1);
+ procedure New_Line (File : File_Type; Spacing : Positive_Count := 1);
+ procedure New_Line (Spacing : Positive_Count := 1);
- procedure Skip_Line (File : in File_Type; Spacing : in Positive_Count := 1);
- procedure Skip_Line (Spacing : in Positive_Count := 1);
+ procedure Skip_Line (File : File_Type; Spacing : Positive_Count := 1);
+ procedure Skip_Line (Spacing : Positive_Count := 1);
- function End_Of_Line (File : in File_Type) return Boolean;
+ function End_Of_Line (File : File_Type) return Boolean;
function End_Of_Line return Boolean;
- procedure New_Page (File : in File_Type);
+ procedure New_Page (File : File_Type);
procedure New_Page;
- procedure Skip_Page (File : in File_Type);
+ procedure Skip_Page (File : File_Type);
procedure Skip_Page;
- function End_Of_Page (File : in File_Type) return Boolean;
+ function End_Of_Page (File : File_Type) return Boolean;
function End_Of_Page return Boolean;
- function End_Of_File (File : in File_Type) return Boolean;
+ function End_Of_File (File : File_Type) return Boolean;
function End_Of_File return Boolean;
- procedure Set_Col (File : in File_Type; To : in Positive_Count);
- procedure Set_Col (To : in Positive_Count);
+ procedure Set_Col (File : File_Type; To : Positive_Count);
+ procedure Set_Col (To : Positive_Count);
- procedure Set_Line (File : in File_Type; To : in Positive_Count);
- procedure Set_Line (To : in Positive_Count);
+ procedure Set_Line (File : File_Type; To : Positive_Count);
+ procedure Set_Line (To : Positive_Count);
- function Col (File : in File_Type) return Positive_Count;
+ function Col (File : File_Type) return Positive_Count;
function Col return Positive_Count;
- function Line (File : in File_Type) return Positive_Count;
+ function Line (File : File_Type) return Positive_Count;
function Line return Positive_Count;
- function Page (File : in File_Type) return Positive_Count;
+ function Page (File : File_Type) return Positive_Count;
function Page return Positive_Count;
----------------------------
-- Character Input-Output --
----------------------------
- procedure Get (File : in File_Type; Item : out Character);
+ procedure Get (File : File_Type; Item : out Character);
procedure Get (Item : out Character);
- procedure Put (File : in File_Type; Item : in Character);
- procedure Put (Item : in Character);
+ procedure Put (File : File_Type; Item : Character);
+ procedure Put (Item : Character);
procedure Look_Ahead
- (File : in File_Type;
+ (File : File_Type;
Item : out Character;
End_Of_Line : out Boolean);
End_Of_Line : out Boolean);
procedure Get_Immediate
- (File : in File_Type;
+ (File : File_Type;
Item : out Character);
procedure Get_Immediate
(Item : out Character);
procedure Get_Immediate
- (File : in File_Type;
+ (File : File_Type;
Item : out Character;
Available : out Boolean);
-- String Input-Output --
-------------------------
- procedure Get (File : in File_Type; Item : out String);
+ procedure Get (File : File_Type; Item : out String);
procedure Get (Item : out String);
- procedure Put (File : in File_Type; Item : in String);
- procedure Put (Item : in String);
+ procedure Put (File : File_Type; Item : String);
+ procedure Put (Item : String);
procedure Get_Line
- (File : in File_Type;
+ (File : File_Type;
Item : out String;
Last : out Natural);
(Item : out String;
Last : out Natural);
+ function Get_Line (File : File_Type) return String;
+ pragma Ada_05 (Get_Line);
+
+ function Get_Line return String;
+ pragma Ada_05 (Get_Line);
+
procedure Put_Line
- (File : in File_Type;
- Item : in String);
+ (File : File_Type;
+ Item : String);
procedure Put_Line
- (Item : in String);
+ (Item : String);
---------------------------------------
-- Generic packages for Input-Output --
procedure Write
(File : in out Text_AFCB;
- Item : in Ada.Streams.Stream_Element_Array);
+ Item : Ada.Streams.Stream_Element_Array);
-- Write operation used when Text_IO file is treated directly as Stream
------------------------
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2003 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
with System.File_IO;
with System.WCh_Cnv; use System.WCh_Cnv;
with System.WCh_Con; use System.WCh_Con;
+
with Unchecked_Conversion;
with Unchecked_Deallocation;
-- Local Subprograms --
-----------------------
- function Getc_Immed (File : in File_Type) return int;
+ function Getc_Immed (File : File_Type) return int;
-- This routine is identical to Getc, except that the read is done in
-- Get_Immediate mode (i.e. without waiting for a line return).
function Get_Wide_Char_Immed
(C : Character;
- File : File_Type)
- return Wide_Character;
+ File : File_Type) return Wide_Character;
-- This routine is identical to Get_Wide_Char, except that the reads are
-- done in Get_Immediate mode (i.e. without waiting for a line return).
-------------------
function AFCB_Allocate
- (Control_Block : Wide_Text_AFCB)
- return FCB.AFCB_Ptr
+ (Control_Block : Wide_Text_AFCB) return FCB.AFCB_Ptr
is
pragma Unreferenced (Control_Block);
-
begin
return new Wide_Text_AFCB;
end AFCB_Allocate;
-- to exceed the value of Count'Last, i.e. no check is required for
-- overflow raising layout error.
- function Col (File : in File_Type) return Positive_Count is
+ function Col (File : File_Type) return Positive_Count is
begin
FIO.Check_File_Open (AP (File));
return File.Col;
procedure Create
(File : in out File_Type;
- Mode : in File_Mode := Out_File;
- Name : in String := "";
- Form : in String := "")
+ Mode : File_Mode := Out_File;
+ Name : String := "";
+ Form : String := "")
is
Dummy_File_Control_Block : Wide_Text_AFCB;
pragma Warnings (Off, Dummy_File_Control_Block);
-- End_Of_File --
-----------------
- function End_Of_File (File : in File_Type) return Boolean is
+ function End_Of_File (File : File_Type) return Boolean is
ch : int;
begin
-- End_Of_Line --
-----------------
- function End_Of_Line (File : in File_Type) return Boolean is
+ function End_Of_Line (File : File_Type) return Boolean is
ch : int;
begin
-- End_Of_Page --
-----------------
- function End_Of_Page (File : in File_Type) return Boolean is
+ function End_Of_Page (File : File_Type) return Boolean is
ch : int;
begin
-- Flush --
-----------
- procedure Flush (File : in File_Type) is
+ procedure Flush (File : File_Type) is
begin
FIO.Flush (AP (File));
end Flush;
-- Form --
----------
- function Form (File : in File_Type) return String is
+ function Form (File : File_Type) return String is
begin
return FIO.Form (AP (File));
end Form;
---------
procedure Get
- (File : in File_Type;
+ (File : File_Type;
Item : out Wide_Character)
is
C : Character;
end Get;
procedure Get
- (File : in File_Type;
+ (File : File_Type;
Item : out Wide_String)
is
begin
-------------------
procedure Get_Character
- (File : in File_Type;
+ (File : File_Type;
Item : out Character)
is
ch : int;
-------------------
procedure Get_Immediate
- (File : in File_Type;
+ (File : File_Type;
Item : out Wide_Character)
is
ch : int;
end Get_Immediate;
procedure Get_Immediate
- (File : in File_Type;
+ (File : File_Type;
Item : out Wide_Character;
Available : out Boolean)
is
--------------
procedure Get_Line
- (File : in File_Type;
+ (File : File_Type;
Item : out Wide_String;
Last : out Natural)
is
Get_Line (Current_In, Item, Last);
end Get_Line;
+ function Get_Line (File : File_Type) return Wide_String is
+ Buffer : Wide_String (1 .. 500);
+ Last : Natural;
+
+ function Get_Rest (S : Wide_String) return Wide_String;
+ -- This is a recursive function that reads the rest of the line and
+ -- returns it. S is the part read so far.
+
+ --------------
+ -- Get_Rest --
+ --------------
+
+ function Get_Rest (S : Wide_String) return Wide_String is
+
+ -- Each time we allocate a buffer the same size as what we have
+ -- read so far. This limits us to a logarithmic number of calls
+ -- to Get_Rest and also ensures only a linear use of stack space.
+
+ Buffer : Wide_String (1 .. S'Length);
+ Last : Natural;
+
+ begin
+ Get_Line (File, Buffer, Last);
+
+ declare
+ R : constant Wide_String := S & Buffer (1 .. Last);
+ begin
+ if Last < Buffer'Last then
+ return R;
+ else
+ return Get_Rest (R);
+ end if;
+ end;
+ end Get_Rest;
+
+ -- Start of processing for Get_Line
+
+ begin
+ Get_Line (File, Buffer, Last);
+
+ if Last < Buffer'Last then
+ return Buffer (1 .. Last);
+ else
+ return Get_Rest (Buffer (1 .. Last));
+ end if;
+ end Get_Line;
+
+ function Get_Line return Wide_String is
+ begin
+ return Get_Line (Current_In);
+ end Get_Line;
+
-------------------
-- Get_Wide_Char --
-------------------
function Get_Wide_Char
(C : Character;
- File : File_Type)
- return Wide_Character
+ File : File_Type) return Wide_Character
is
function In_Char return Character;
-- Function used to obtain additional characters it the wide character
-- sequence is more than one character long.
+ function WC_In is new Char_Sequence_To_Wide_Char (In_Char);
+
+ -------------
+ -- In_Char --
+ -------------
+
function In_Char return Character is
ch : constant Integer := Getc (File);
-
begin
if ch = EOF then
raise End_Error;
end if;
end In_Char;
- function WC_In is new Char_Sequence_To_Wide_Char (In_Char);
+ -- Start of processing for In_Char
begin
return WC_In (C, File.WC_Method);
function Get_Wide_Char_Immed
(C : Character;
- File : File_Type)
- return Wide_Character
+ File : File_Type) return Wide_Character
is
function In_Char return Character;
-- Function used to obtain additional characters it the wide character
-- sequence is more than one character long.
+ function WC_In is new Char_Sequence_To_Wide_Char (In_Char);
+
+ -------------
+ -- In_Char --
+ -------------
+
function In_Char return Character is
ch : constant Integer := Getc_Immed (File);
-
begin
if ch = EOF then
raise End_Error;
end if;
end In_Char;
- function WC_In is new Char_Sequence_To_Wide_Char (In_Char);
+ -- Start of processing for Get_Wide_Char_Immed
begin
return WC_In (C, File.WC_Method);
-- Getc_Immed --
----------------
- function Getc_Immed (File : in File_Type) return int is
+ function Getc_Immed (File : File_Type) return int is
ch : int;
end_of_file : int;
-- Is_Open --
-------------
- function Is_Open (File : in File_Type) return Boolean is
+ function Is_Open (File : File_Type) return Boolean is
begin
return FIO.Is_Open (AP (File));
end Is_Open;
-- to exceed the value of Count'Last, i.e. no check is required for
-- overflow raising layout error.
- function Line (File : in File_Type) return Positive_Count is
+ function Line (File : File_Type) return Positive_Count is
begin
FIO.Check_File_Open (AP (File));
return File.Line;
-- Line_Length --
-----------------
- function Line_Length (File : in File_Type) return Count is
+ function Line_Length (File : File_Type) return Count is
begin
FIO.Check_Write_Status (AP (File));
return File.Line_Length;
----------------
procedure Look_Ahead
- (File : in File_Type;
+ (File : File_Type;
Item : out Wide_Character;
End_Of_Line : out Boolean)
is
-- Mode --
----------
- function Mode (File : in File_Type) return File_Mode is
+ function Mode (File : File_Type) return File_Mode is
begin
return To_TIO (FIO.Mode (AP (File)));
end Mode;
-- Name --
----------
- function Name (File : in File_Type) return String is
+ function Name (File : File_Type) return String is
begin
return FIO.Name (AP (File));
end Name;
--------------
procedure New_Line
- (File : in File_Type;
- Spacing : in Positive_Count := 1)
+ (File : File_Type;
+ Spacing : Positive_Count := 1)
is
begin
-- Raise Constraint_Error if out of range value. The reason for this
File.Col := 1;
end New_Line;
- procedure New_Line (Spacing : in Positive_Count := 1) is
+ procedure New_Line (Spacing : Positive_Count := 1) is
begin
New_Line (Current_Out, Spacing);
end New_Line;
-- New_Page --
--------------
- procedure New_Page (File : in File_Type) is
+ procedure New_Page (File : File_Type) is
begin
FIO.Check_Write_Status (AP (File));
procedure Open
(File : in out File_Type;
- Mode : in File_Mode;
- Name : in String;
- Form : in String := "")
+ Mode : File_Mode;
+ Name : String;
+ Form : String := "")
is
Dummy_File_Control_Block : Wide_Text_AFCB;
pragma Warnings (Off, Dummy_File_Control_Block);
-- to exceed the value of Count'Last, i.e. no check is required for
-- overflow raising layout error.
- function Page (File : in File_Type) return Positive_Count is
+ function Page (File : File_Type) return Positive_Count is
begin
FIO.Check_File_Open (AP (File));
return File.Page;
-- Page_Length --
-----------------
- function Page_Length (File : in File_Type) return Count is
+ function Page_Length (File : File_Type) return Count is
begin
FIO.Check_Write_Status (AP (File));
return File.Page_Length;
---------
procedure Put
- (File : in File_Type;
- Item : in Wide_Character)
+ (File : File_Type;
+ Item : Wide_Character)
is
procedure Out_Char (C : Character);
-- Procedure to output one character of a wide character sequence
+ procedure WC_Out is new Wide_Char_To_Char_Sequence (Out_Char);
+ --------------
+ -- Out_Char --
+ --------------
+
procedure Out_Char (C : Character) is
begin
Putc (Character'Pos (C), File);
end Out_Char;
- procedure WC_Out is new Wide_Char_To_Char_Sequence (Out_Char);
+ -- Start of processing for Put
begin
WC_Out (Item, File.WC_Method);
File.Col := File.Col + 1;
end Put;
- procedure Put (Item : in Wide_Character) is
+ procedure Put (Item : Wide_Character) is
begin
Put (Current_Out, Item);
end Put;
---------
procedure Put
- (File : in File_Type;
- Item : in Wide_String)
+ (File : File_Type;
+ Item : Wide_String)
is
begin
for J in Item'Range loop
end loop;
end Put;
- procedure Put (Item : in Wide_String) is
+ procedure Put (Item : Wide_String) is
begin
Put (Current_Out, Item);
end Put;
--------------
procedure Put_Line
- (File : in File_Type;
- Item : in Wide_String)
+ (File : File_Type;
+ Item : Wide_String)
is
begin
Put (File, Item);
New_Line (File);
end Put_Line;
- procedure Put_Line (Item : in Wide_String) is
+ procedure Put_Line (Item : Wide_String) is
begin
Put (Current_Out, Item);
New_Line (Current_Out);
procedure Reset
(File : in out File_Type;
- Mode : in File_Mode)
+ Mode : File_Mode)
is
begin
-- Don't allow change of mode for current file (RM A.10.2(5))
-------------
procedure Set_Col
- (File : in File_Type;
- To : in Positive_Count)
+ (File : File_Type;
+ To : Positive_Count)
is
ch : int;
end if;
end Set_Col;
- procedure Set_Col (To : in Positive_Count) is
+ procedure Set_Col (To : Positive_Count) is
begin
Set_Col (Current_Out, To);
end Set_Col;
-- Set_Error --
---------------
- procedure Set_Error (File : in File_Type) is
+ procedure Set_Error (File : File_Type) is
begin
FIO.Check_Write_Status (AP (File));
Current_Err := File;
-- Set_Input --
---------------
- procedure Set_Input (File : in File_Type) is
+ procedure Set_Input (File : File_Type) is
begin
FIO.Check_Read_Status (AP (File));
Current_In := File;
--------------
procedure Set_Line
- (File : in File_Type;
- To : in Positive_Count)
+ (File : File_Type;
+ To : Positive_Count)
is
begin
-- Raise Constraint_Error if out of range value. The reason for this
end if;
end Set_Line;
- procedure Set_Line (To : in Positive_Count) is
+ procedure Set_Line (To : Positive_Count) is
begin
Set_Line (Current_Out, To);
end Set_Line;
-- Set_Line_Length --
---------------------
- procedure Set_Line_Length (File : in File_Type; To : in Count) is
+ procedure Set_Line_Length (File : File_Type; To : Count) is
begin
-- Raise Constraint_Error if out of range value. The reason for this
-- explicit test is that we don't want junk values around, even if
File.Line_Length := To;
end Set_Line_Length;
- procedure Set_Line_Length (To : in Count) is
+ procedure Set_Line_Length (To : Count) is
begin
Set_Line_Length (Current_Out, To);
end Set_Line_Length;
-- Set_Output --
----------------
- procedure Set_Output (File : in File_Type) is
+ procedure Set_Output (File : File_Type) is
begin
FIO.Check_Write_Status (AP (File));
Current_Out := File;
-- Set_Page_Length --
---------------------
- procedure Set_Page_Length (File : in File_Type; To : in Count) is
+ procedure Set_Page_Length (File : File_Type; To : Count) is
begin
-- Raise Constraint_Error if out of range value. The reason for this
-- explicit test is that we don't want junk values around, even if
File.Page_Length := To;
end Set_Page_Length;
- procedure Set_Page_Length (To : in Count) is
+ procedure Set_Page_Length (To : Count) is
begin
Set_Page_Length (Current_Out, To);
end Set_Page_Length;
---------------
procedure Skip_Line
- (File : in File_Type;
- Spacing : in Positive_Count := 1)
+ (File : File_Type;
+ Spacing : Positive_Count := 1)
is
ch : int;
File.Before_Wide_Character := False;
end Skip_Line;
- procedure Skip_Line (Spacing : in Positive_Count := 1) is
+ procedure Skip_Line (Spacing : Positive_Count := 1) is
begin
Skip_Line (Current_In, Spacing);
end Skip_Line;
-- Skip_Page --
---------------
- procedure Skip_Page (File : in File_Type) is
+ procedure Skip_Page (File : File_Type) is
ch : int;
begin
procedure Write
(File : in out Wide_Text_AFCB;
- Item : in Stream_Element_Array)
+ Item : Stream_Element_Array)
is
Siz : constant size_t := Item'Length;
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2000 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 Free Software Foundation, Inc. --
-- --
-- This specification is derived from the Ada Reference Manual for use with --
-- GNAT. The copyright notice above, and the license provisions that follow --
procedure Create
(File : in out File_Type;
- Mode : in File_Mode := Out_File;
- Name : in String := "";
- Form : in String := "");
+ Mode : File_Mode := Out_File;
+ Name : String := "";
+ Form : String := "");
procedure Open
(File : in out File_Type;
- Mode : in File_Mode;
- Name : in String;
- Form : in String := "");
+ Mode : File_Mode;
+ Name : String;
+ Form : String := "");
procedure Close (File : in out File_Type);
procedure Delete (File : in out File_Type);
- procedure Reset (File : in out File_Type; Mode : in File_Mode);
+ procedure Reset (File : in out File_Type; Mode : File_Mode);
procedure Reset (File : in out File_Type);
- function Mode (File : in File_Type) return File_Mode;
- function Name (File : in File_Type) return String;
- function Form (File : in File_Type) return String;
+ function Mode (File : File_Type) return File_Mode;
+ function Name (File : File_Type) return String;
+ function Form (File : File_Type) return String;
- function Is_Open (File : in File_Type) return Boolean;
+ function Is_Open (File : File_Type) return Boolean;
------------------------------------------------------
-- Control of default input, output and error files --
------------------------------------------------------
- procedure Set_Input (File : in File_Type);
- procedure Set_Output (File : in File_Type);
- procedure Set_Error (File : in File_Type);
+ procedure Set_Input (File : File_Type);
+ procedure Set_Output (File : File_Type);
+ procedure Set_Error (File : File_Type);
function Standard_Input return File_Type;
function Standard_Output return File_Type;
-- Note: The paramter file is in out in the RM, but as pointed out
-- in <<95-5166.a Tucker Taft 95-6-23>> this is clearly an oversight.
- procedure Flush (File : in File_Type);
+ procedure Flush (File : File_Type);
procedure Flush;
--------------------------------------------
-- Specification of line and page lengths --
--------------------------------------------
- procedure Set_Line_Length (File : in File_Type; To : in Count);
- procedure Set_Line_Length (To : in Count);
+ procedure Set_Line_Length (File : File_Type; To : Count);
+ procedure Set_Line_Length (To : Count);
- procedure Set_Page_Length (File : in File_Type; To : in Count);
- procedure Set_Page_Length (To : in Count);
+ procedure Set_Page_Length (File : File_Type; To : Count);
+ procedure Set_Page_Length (To : Count);
- function Line_Length (File : in File_Type) return Count;
+ function Line_Length (File : File_Type) return Count;
function Line_Length return Count;
- function Page_Length (File : in File_Type) return Count;
+ function Page_Length (File : File_Type) return Count;
function Page_Length return Count;
------------------------------------
-- Column, Line, and Page Control --
------------------------------------
- procedure New_Line (File : in File_Type; Spacing : in Positive_Count := 1);
- procedure New_Line (Spacing : in Positive_Count := 1);
+ procedure New_Line (File : File_Type; Spacing : Positive_Count := 1);
+ procedure New_Line (Spacing : Positive_Count := 1);
- procedure Skip_Line (File : in File_Type; Spacing : in Positive_Count := 1);
- procedure Skip_Line (Spacing : in Positive_Count := 1);
+ procedure Skip_Line (File : File_Type; Spacing : Positive_Count := 1);
+ procedure Skip_Line (Spacing : Positive_Count := 1);
- function End_Of_Line (File : in File_Type) return Boolean;
+ function End_Of_Line (File : File_Type) return Boolean;
function End_Of_Line return Boolean;
- procedure New_Page (File : in File_Type);
+ procedure New_Page (File : File_Type);
procedure New_Page;
- procedure Skip_Page (File : in File_Type);
+ procedure Skip_Page (File : File_Type);
procedure Skip_Page;
- function End_Of_Page (File : in File_Type) return Boolean;
+ function End_Of_Page (File : File_Type) return Boolean;
function End_Of_Page return Boolean;
- function End_Of_File (File : in File_Type) return Boolean;
+ function End_Of_File (File : File_Type) return Boolean;
function End_Of_File return Boolean;
- procedure Set_Col (File : in File_Type; To : in Positive_Count);
- procedure Set_Col (To : in Positive_Count);
+ procedure Set_Col (File : File_Type; To : Positive_Count);
+ procedure Set_Col (To : Positive_Count);
- procedure Set_Line (File : in File_Type; To : in Positive_Count);
- procedure Set_Line (To : in Positive_Count);
+ procedure Set_Line (File : File_Type; To : Positive_Count);
+ procedure Set_Line (To : Positive_Count);
- function Col (File : in File_Type) return Positive_Count;
+ function Col (File : File_Type) return Positive_Count;
function Col return Positive_Count;
- function Line (File : in File_Type) return Positive_Count;
+ function Line (File : File_Type) return Positive_Count;
function Line return Positive_Count;
- function Page (File : in File_Type) return Positive_Count;
+ function Page (File : File_Type) return Positive_Count;
function Page return Positive_Count;
----------------------------
-- Character Input-Output --
----------------------------
- procedure Get (File : in File_Type; Item : out Wide_Character);
+ procedure Get (File : File_Type; Item : out Wide_Character);
procedure Get (Item : out Wide_Character);
- procedure Put (File : in File_Type; Item : in Wide_Character);
- procedure Put (Item : in Wide_Character);
+ procedure Put (File : File_Type; Item : Wide_Character);
+ procedure Put (Item : Wide_Character);
procedure Look_Ahead
- (File : in File_Type;
+ (File : File_Type;
Item : out Wide_Character;
End_Of_Line : out Boolean);
End_Of_Line : out Boolean);
procedure Get_Immediate
- (File : in File_Type;
+ (File : File_Type;
Item : out Wide_Character);
procedure Get_Immediate
(Item : out Wide_Character);
procedure Get_Immediate
- (File : in File_Type;
+ (File : File_Type;
Item : out Wide_Character;
Available : out Boolean);
-- String Input-Output --
-------------------------
- procedure Get (File : in File_Type; Item : out Wide_String);
+ procedure Get (File : File_Type; Item : out Wide_String);
procedure Get (Item : out Wide_String);
- procedure Put (File : in File_Type; Item : in Wide_String);
- procedure Put (Item : in Wide_String);
+ procedure Put (File : File_Type; Item : Wide_String);
+ procedure Put (Item : Wide_String);
procedure Get_Line
- (File : in File_Type;
+ (File : File_Type;
Item : out Wide_String;
Last : out Natural);
(Item : out Wide_String;
Last : out Natural);
+ function Get_Line (File : File_Type) return Wide_String;
+ pragma Ada_05 (Get_Line);
+
+ function Get_Line return Wide_String;
+ pragma Ada_05 (Get_Line);
+
procedure Put_Line
- (File : in File_Type;
- Item : in Wide_String);
+ (File : File_Type;
+ Item : Wide_String);
procedure Put_Line
- (Item : in Wide_String);
+ (Item : Wide_String);
---------------------------------------
-- Generic packages for Input-Output --
procedure Write
(File : in out Wide_Text_AFCB;
- Item : in Ada.Streams.Stream_Element_Array);
+ Item : Ada.Streams.Stream_Element_Array);
-- Write operation used when Wide_Text_IO file is treated as a Stream
------------------------
-- occurs. The result is EOF if the end of file was read.
procedure Get_Character
- (File : in File_Type;
+ (File : File_Type;
Item : out Character);
-- This is essentially a copy of the normal Get routine from Text_IO. It
-- obtains a single character from the input file File, and places it in
function Get_Wide_Char
(C : Character;
- File : File_Type)
- return Wide_Character;
+ File : File_Type) return Wide_Character;
-- This function is shared by Get and Get_Immediate to extract a wide
-- character value from the given File. The first byte has already been
-- read and is passed in C. The wide character value is returned as the
-- --
-- B o d y --
-- --
--- Copyright (C) 1992,1993,1994,1995,1996 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
---------
procedure Get
- (File : in File_Type;
+ (File : File_Type;
ItemR : out Long_Long_Float;
ItemI : out Long_Long_Float;
Width : Field)
----------
procedure Gets
- (From : in String;
+ (From : String;
ItemR : out Long_Long_Float;
ItemI : out Long_Long_Float;
Last : out Positive)
(To : out String;
ItemR : Long_Long_Float;
ItemI : Long_Long_Float;
- Aft : in Field;
- Exp : in Field)
+ Aft : Field;
+ Exp : Field)
is
I_String : String (1 .. 3 * Field'Last);
R_String : String (1 .. 3 * Field'Last);
-- --
-- S p e c --
-- --
--- Copyright (C) 1992,1993,1994,1995,1996 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
package Ada.Wide_Text_IO.Complex_Aux is
procedure Get
- (File : in File_Type;
+ (File : File_Type;
ItemR : out Long_Long_Float;
ItemI : out Long_Long_Float;
Width : Field);
-- --
-- B o d y --
-- --
--- Copyright (C) 1992,1993,1994,1995,1996 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
------------------------------------------------------------------------------
with Ada.Wide_Text_IO.Complex_Aux;
+
with System.WCh_Con; use System.WCh_Con;
with System.WCh_WtS; use System.WCh_WtS;
subtype LLF is Long_Long_Float;
-- Type used for calls to routines in Aux
--- subtype TFT is Ada.Wide_Text_IO.File_Type;
- -- File type required for calls to routines in Aux
-
function TFT is new
Ada.Unchecked_Conversion (File_Type, Ada.Wide_Text_IO.File_Type);
-- This unchecked conversion is to get around a visibility bug in
---------
procedure Get
- (File : in File_Type;
+ (File : File_Type;
Item : out Complex;
- Width : in Field := 0)
+ Width : Field := 0)
is
- Real_Item : Real'Base;
- Imag_Item : Real'Base;
+ Real_Item : Real'Base;
+ Imag_Item : Real'Base;
begin
Aux.Get (TFT (File), LLF (Real_Item), LLF (Imag_Item), Width);
procedure Get
(Item : out Complex;
- Width : in Field := 0)
+ Width : Field := 0)
is
begin
Get (Current_Input, Item, Width);
---------
procedure Get
- (From : in Wide_String;
+ (From : Wide_String;
Item : out Complex;
Last : out Positive)
is
---------
procedure Put
- (File : in File_Type;
- Item : in Complex;
- Fore : in Field := Default_Fore;
- Aft : in Field := Default_Aft;
- Exp : in Field := Default_Exp)
+ (File : File_Type;
+ Item : Complex;
+ Fore : Field := Default_Fore;
+ Aft : Field := Default_Aft;
+ Exp : Field := Default_Exp)
is
begin
Aux.Put (TFT (File), LLF (Re (Item)), LLF (Im (Item)), Fore, Aft, Exp);
---------
procedure Put
- (Item : in Complex;
- Fore : in Field := Default_Fore;
- Aft : in Field := Default_Aft;
- Exp : in Field := Default_Exp)
+ (Item : Complex;
+ Fore : Field := Default_Fore;
+ Aft : Field := Default_Aft;
+ Exp : Field := Default_Exp)
is
begin
Put (Current_Output, Item, Fore, Aft, Exp);
procedure Put
(To : out Wide_String;
- Item : in Complex;
- Aft : in Field := Default_Aft;
- Exp : in Field := Default_Exp)
+ Item : Complex;
+ Aft : Field := Default_Aft;
+ Exp : Field := Default_Exp)
is
S : String (To'First .. To'Last);
Default_Exp : Field := 3;
procedure Get
- (File : in File_Type;
+ (File : File_Type;
Item : out Complex;
- Width : in Field := 0);
+ Width : Field := 0);
procedure Get
(Item : out Complex;
- Width : in Field := 0);
+ Width : Field := 0);
procedure Put
- (File : in File_Type;
- Item : in Complex;
- Fore : in Field := Default_Fore;
- Aft : in Field := Default_Aft;
- Exp : in Field := Default_Exp);
+ (File : File_Type;
+ Item : Complex;
+ Fore : Field := Default_Fore;
+ Aft : Field := Default_Aft;
+ Exp : Field := Default_Exp);
procedure Put
- (Item : in Complex;
- Fore : in Field := Default_Fore;
- Aft : in Field := Default_Aft;
- Exp : in Field := Default_Exp);
+ (Item : Complex;
+ Fore : Field := Default_Fore;
+ Aft : Field := Default_Aft;
+ Exp : Field := Default_Exp);
procedure Get
- (From : in Wide_String;
+ (From : Wide_String;
Item : out Complex;
Last : out Positive);
procedure Put
(To : out Wide_String;
- Item : in Complex;
- Aft : in Field := Default_Aft;
- Exp : in Field := Default_Exp);
+ Item : Complex;
+ Aft : Field := Default_Aft;
+ Exp : Field := Default_Exp);
end Ada.Wide_Text_IO.Complex_IO;
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2002 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-----------
function Image
- (Item : in Num;
- Pic : in Picture;
- Currency : in Wide_String := Default_Currency;
- Fill : in Wide_Character := Default_Fill;
- Separator : in Wide_Character := Default_Separator;
- Radix_Mark : in Wide_Character := Default_Radix_Mark)
- return Wide_String
+ (Item : Num;
+ Pic : Picture;
+ Currency : Wide_String := Default_Currency;
+ Fill : Wide_Character := Default_Fill;
+ Separator : Wide_Character := Default_Separator;
+ Radix_Mark : Wide_Character := Default_Radix_Mark) return Wide_String
is
begin
return Format_Number
------------
function Length
- (Pic : in Picture;
- Currency : in Wide_String := Default_Currency)
- return Natural
+ (Pic : Picture;
+ Currency : Wide_String := Default_Currency) return Natural
is
Picstr : constant String := Pic_String (Pic);
V_Adjust : Integer := 0;
---------
procedure Put
- (File : in Wide_Text_IO.File_Type;
- Item : in Num;
- Pic : in Picture;
- Currency : in Wide_String := Default_Currency;
- Fill : in Wide_Character := Default_Fill;
- Separator : in Wide_Character := Default_Separator;
- Radix_Mark : in Wide_Character := Default_Radix_Mark)
+ (File : Wide_Text_IO.File_Type;
+ Item : Num;
+ Pic : Picture;
+ Currency : Wide_String := Default_Currency;
+ Fill : Wide_Character := Default_Fill;
+ Separator : Wide_Character := Default_Separator;
+ Radix_Mark : Wide_Character := Default_Radix_Mark)
is
begin
Wide_Text_IO.Put (File, Image (Item, Pic,
end Put;
procedure Put
- (Item : in Num;
- Pic : in Picture;
- Currency : in Wide_String := Default_Currency;
- Fill : in Wide_Character := Default_Fill;
- Separator : in Wide_Character := Default_Separator;
- Radix_Mark : in Wide_Character := Default_Radix_Mark)
+ (Item : Num;
+ Pic : Picture;
+ Currency : Wide_String := Default_Currency;
+ Fill : Wide_Character := Default_Fill;
+ Separator : Wide_Character := Default_Separator;
+ Radix_Mark : Wide_Character := Default_Radix_Mark)
is
begin
Wide_Text_IO.Put (Image (Item, Pic,
procedure Put
(To : out Wide_String;
- Item : in Num;
- Pic : in Picture;
- Currency : in Wide_String := Default_Currency;
- Fill : in Wide_Character := Default_Fill;
- Separator : in Wide_Character := Default_Separator;
- Radix_Mark : in Wide_Character := Default_Radix_Mark)
+ Item : Num;
+ Pic : Picture;
+ Currency : Wide_String := Default_Currency;
+ Fill : Wide_Character := Default_Fill;
+ Separator : Wide_Character := Default_Separator;
+ Radix_Mark : Wide_Character := Default_Radix_Mark)
is
Result : constant Wide_String :=
Image (Item, Pic, Currency, Fill, Separator, Radix_Mark);
function Valid
(Item : Num;
- Pic : in Picture;
- Currency : in Wide_String := Default_Currency)
- return Boolean
+ Pic : Picture;
+ Currency : Wide_String := Default_Currency) return Boolean
is
begin
declare
Temp : constant Wide_String := Image (Item, Pic, Currency);
pragma Warnings (Off, Temp);
-
begin
return True;
end;
when Layout_Error => return False;
end Valid;
-
end Decimal_Output;
------------
when '(' =>
- -- We now need to scan out the count after a left paren.
- -- In the non-wide version we used Integer_IO.Get, but
- -- that is not convenient here, since we don't want to
- -- drag in normal Text_IO just for this purpose. So we
- -- do the scan ourselves, with the normal validity checks.
+ -- We now need to scan out the count after a left paren. In
+ -- the non-wide version we used Integer_IO.Get, but that is
+ -- not convenient here, since we don't want to drag in normal
+ -- Text_IO just for this purpose. So we do the scan ourselves,
+ -- with the normal validity checks.
Last := Picture_Index + 1;
Count := 0;
end loop;
-- In what follows note that one copy of the repeated
- -- character has already been made, so a count of one is a
+ -- character has already been made, so a count of one is
-- no-op, and a count of zero erases a character.
for J in 2 .. Count loop
exception
when others =>
raise Picture_Error;
-
end Expand;
-------------------
Currency_Symbol : Wide_String;
Fill_Character : Wide_Character;
Separator_Character : Wide_Character;
- Radix_Point : Wide_Character)
- return Wide_String
+ Radix_Point : Wide_Character) return Wide_String
is
Attrs : Number_Attributes := Parse_Number_String (Number);
Position : Integer;
end loop;
-- The rounding may add a digit in front. Either the
- -- leading blank or the sign (already captured) can
- -- be overwritten.
+ -- leading blank or the sign (already captured) can be
+ -- overwritten.
if R_Pos = 1 then
Rounded (R_Pos) := '1';
for J in reverse Last .. Answer'Last loop
exit when J = Pic.Radix_Position;
- -- Do this test First, Separator_Character can equal Pic.Floater.
+ -- Do this test First, Separator_Character can equal Pic.Floater
if Answer (J) = Pic.Floater then
exit;
or else
Pic.Floater = '-'
then
- for J in Pic.End_Float .. Position loop -- May be null range.
+ for J in Pic.End_Float .. Position loop -- May be null range
if Answer (J) = '9' then
Answer (J) := '0';
elsif Pic.Floater = '$' then
- for J in Pic.End_Float .. Position loop -- May be null range.
+ for J in Pic.End_Float .. Position loop -- May be null range
if Answer (J) = '9' then
Answer (J) := '0';
elsif Answer (J) = '_' then
- Answer (J) := ' '; -- no separator before leftmost digit.
+ Answer (J) := ' '; -- no separator before leftmost digit
elsif Answer (J) = 'b' then
Answer (J) := ' ';
elsif Pic.Floater = '*' then
- for J in Pic.End_Float .. Position loop -- May be null range.
+ for J in Pic.End_Float .. Position loop -- May be null range
if Answer (J) = '9' then
Answer (J) := '0';
return Answer;
end if;
-
end Format_Number;
-------------------------
-- No significant (intger) digits needs a null range.
return Answer;
-
end Parse_Number_String;
----------------
----------------
function To_Picture
- (Pic_String : in String;
- Blank_When_Zero : in Boolean := False)
- return Picture
+ (Pic_String : String;
+ Blank_When_Zero : Boolean := False) return Picture
is
Result : Picture;
-----------
function Valid
- (Pic_String : in String;
- Blank_When_Zero : in Boolean := False)
- return Boolean
+ (Pic_String : String;
+ Blank_When_Zero : Boolean := False) return Boolean
is
begin
declare
exception
when others => return False;
-
end Valid;
end Ada.Wide_Text_IO.Editing;
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-1997 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 Free Software Foundation, Inc. --
-- --
-- This specification is derived from the Ada Reference Manual for use with --
-- GNAT. The copyright notice above, and the license provisions that follow --
type Picture is private;
function Valid
- (Pic_String : in String;
- Blank_When_Zero : in Boolean := False)
- return Boolean;
+ (Pic_String : String;
+ Blank_When_Zero : Boolean := False) return Boolean;
function To_Picture
- (Pic_String : in String;
- Blank_When_Zero : in Boolean := False)
- return Picture;
+ (Pic_String : String;
+ Blank_When_Zero : Boolean := False) return Picture;
function Pic_String (Pic : in Picture) return String;
function Blank_When_Zero (Pic : in Picture) return Boolean;
generic
type Num is delta <> digits <>;
- Default_Currency : in Wide_String :=
+ Default_Currency : Wide_String :=
Wide_Text_IO.Editing.Default_Currency;
- Default_Fill : in Wide_Character :=
+ Default_Fill : Wide_Character :=
Wide_Text_IO.Editing.Default_Fill;
- Default_Separator : in Wide_Character :=
+ Default_Separator : Wide_Character :=
Wide_Text_IO.Editing.Default_Separator;
- Default_Radix_Mark : in Wide_Character :=
+ Default_Radix_Mark : Wide_Character :=
Wide_Text_IO.Editing.Default_Radix_Mark;
package Decimal_Output is
function Length
- (Pic : in Picture;
- Currency : in Wide_String := Default_Currency)
- return Natural;
+ (Pic : Picture;
+ Currency : Wide_String := Default_Currency) return Natural;
function Valid
(Item : Num;
- Pic : in Picture;
- Currency : in Wide_String := Default_Currency)
- return Boolean;
+ Pic : Picture;
+ Currency : Wide_String := Default_Currency) return Boolean;
function Image
(Item : Num;
- Pic : in Picture;
- Currency : in Wide_String := Default_Currency;
- Fill : in Wide_Character := Default_Fill;
- Separator : in Wide_Character := Default_Separator;
- Radix_Mark : in Wide_Character := Default_Radix_Mark)
- return Wide_String;
+ Pic : Picture;
+ Currency : Wide_String := Default_Currency;
+ Fill : Wide_Character := Default_Fill;
+ Separator : Wide_Character := Default_Separator;
+ Radix_Mark : Wide_Character := Default_Radix_Mark) return Wide_String;
procedure Put
- (File : in File_Type;
+ (File : File_Type;
Item : Num;
- Pic : in Picture;
- Currency : in Wide_String := Default_Currency;
- Fill : in Wide_Character := Default_Fill;
- Separator : in Wide_Character := Default_Separator;
- Radix_Mark : in Wide_Character := Default_Radix_Mark);
+ Pic : Picture;
+ Currency : Wide_String := Default_Currency;
+ Fill : Wide_Character := Default_Fill;
+ Separator : Wide_Character := Default_Separator;
+ Radix_Mark : Wide_Character := Default_Radix_Mark);
procedure Put
(Item : Num;
- Pic : in Picture;
- Currency : in Wide_String := Default_Currency;
- Fill : in Wide_Character := Default_Fill;
- Separator : in Wide_Character := Default_Separator;
- Radix_Mark : in Wide_Character := Default_Radix_Mark);
+ Pic : Picture;
+ Currency : Wide_String := Default_Currency;
+ Fill : Wide_Character := Default_Fill;
+ Separator : Wide_Character := Default_Separator;
+ Radix_Mark : Wide_Character := Default_Radix_Mark);
procedure Put
(To : out Wide_String;
Item : Num;
- Pic : in Picture;
- Currency : in Wide_String := Default_Currency;
- Fill : in Wide_Character := Default_Fill;
- Separator : in Wide_Character := Default_Separator;
- Radix_Mark : in Wide_Character := Default_Radix_Mark);
+ Pic : Picture;
+ Currency : Wide_String := Default_Currency;
+ Fill : Wide_Character := Default_Fill;
+ Separator : Wide_Character := Default_Separator;
+ Radix_Mark : Wide_Character := Default_Radix_Mark);
end Decimal_Output;
Currency_Symbol : Wide_String;
Fill_Character : Wide_Character;
Separator_Character : Wide_Character;
- Radix_Point : Wide_Character)
- return Wide_String;
+ Radix_Point : Wide_Character) return Wide_String;
-- Formats number according to Pic
function Expand (Picture : in String) return String;
-- --
-- B o d y --
-- --
--- Copyright (C) 1992,1993,1994,1995,1996 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- Stream --
------------
- function Stream (File : in File_Type) return Stream_Access is
+ function Stream (File : File_Type) return Stream_Access is
begin
System.File_IO.Check_File_Open (FCB.AFCB_Ptr (File));
return Stream_Access (File);
type Stream_Access is access all Streams.Root_Stream_Type'Class;
- function Stream (File : in File_Type) return Stream_Access;
+ function Stream (File : File_Type) return Stream_Access;
end Ada.Wide_Text_IO.Text_Streams;