A.3.4 The Package Characters.Conversions
Static Semantics
{
AI95-00395-01}
The library package Characters.Conversions has the following declaration:
{
AI12-0414-1}
package Ada.Characters.Conversions
with Pure
is
function Is_Character (Item :
in Wide_Character)
return Boolean;
function Is_String (Item :
in Wide_String)
return Boolean;
function Is_Character (Item :
in Wide_Wide_Character)
return Boolean;
function Is_String (Item :
in Wide_Wide_String)
return Boolean;
function Is_Wide_Character (Item :
in Wide_Wide_Character)
return Boolean;
function Is_Wide_String (Item :
in Wide_Wide_String)
return Boolean;
function To_Wide_Character (Item :
in Character)
return Wide_Character;
function To_Wide_String (Item :
in String)
return Wide_String;
function To_Wide_Wide_Character (Item :
in Character)
return Wide_Wide_Character;
function To_Wide_Wide_String (Item :
in String)
return Wide_Wide_String;
function To_Wide_Wide_Character (Item :
in Wide_Character)
return Wide_Wide_Character;
function To_Wide_Wide_String (Item :
in Wide_String)
return Wide_Wide_String;
function To_Character (Item :
in Wide_Character;
Substitute :
in Character := ' ')
return Character;
function To_String (Item :
in Wide_String;
Substitute :
in Character := ' ')
return String;
function To_Character (Item :
in Wide_Wide_Character;
Substitute :
in Character := ' ')
return Character;
function To_String (Item :
in Wide_Wide_String;
Substitute :
in Character := ' ')
return String;
function To_Wide_Character (Item :
in Wide_Wide_Character;
Substitute :
in Wide_Character := ' ')
return Wide_Character;
function To_Wide_String (Item :
in Wide_Wide_String;
Substitute :
in Wide_Character := ' ')
return Wide_String;
end Ada.Characters.Conversions;
{
AI95-00395-01}
The functions in package Characters.Conversions test Wide_Wide_Character
or Wide_Character values for membership in Wide_Character or Character,
or convert between corresponding characters of Wide_Wide_Character, Wide_Character,
and Character.
function Is_Character (Item : in Wide_Character) return Boolean;
{
AI95-00395-01}
Returns True if Wide_Character'Pos(Item) <= Character'Pos(Character'Last).
function Is_Character (Item : in Wide_Wide_Character) return Boolean;
{
AI95-00395-01}
Returns True if Wide_Wide_Character'Pos(Item) <= Character'Pos(Character'Last).
function Is_Wide_Character (Item : in Wide_Wide_Character) return Boolean;
{
AI95-00395-01}
Returns True if Wide_Wide_Character'Pos(Item) <= Wide_Character'Pos(Wide_Character'Last).
function Is_String (Item : in Wide_String) return Boolean;
function Is_String (Item : in Wide_Wide_String) return Boolean;
{
AI95-00395-01}
Returns True if Is_Character(Item(I)) is True for each I in Item'Range.
function Is_Wide_String (Item : in Wide_Wide_String) return Boolean;
{
AI95-00395-01}
Returns True if Is_Wide_Character(Item(I)) is True for each I in Item'Range.
function To_Character (Item : in Wide_Character;
Substitute : in Character := ' ') return Character;
function To_Character (Item : in Wide_Wide_Character;
Substitute : in Character := ' ') return Character;
{
AI95-00395-01}
Returns the Character corresponding to Item if Is_Character(Item), and
returns the Substitute Character otherwise.
function To_Wide_Character (Item : in Character) return Wide_Character;
{
AI95-00395-01}
Returns the Wide_Character X such that Character'Pos(Item) = Wide_Character'Pos
(X).
function To_Wide_Character (Item : in Wide_Wide_Character;
Substitute : in Wide_Character := ' ')
return Wide_Character;
{
AI95-00395-01}
Returns the Wide_Character corresponding to Item if Is_Wide_Character(Item),
and returns the Substitute Wide_Character otherwise.
function To_Wide_Wide_Character (Item : in Character)
return Wide_Wide_Character;
{
AI95-00395-01}
Returns the Wide_Wide_Character X such that Character'Pos(Item) = Wide_Wide_Character'Pos
(X).
function To_Wide_Wide_Character (Item : in Wide_Character)
return Wide_Wide_Character;
{
AI95-00395-01}
Returns the Wide_Wide_Character X such that Wide_Character'Pos(Item)
= Wide_Wide_Character'Pos (X).
function To_String (Item : in Wide_String;
Substitute : in Character := ' ') return String;
function To_String (Item : in Wide_Wide_String;
Substitute : in Character := ' ') return String;
{
AI95-00395-01}
Returns the String whose range is 1..Item'Length and each of whose elements
is given by To_Character of the corresponding element in Item.
function To_Wide_String (Item : in String) return Wide_String;
{
AI95-00395-01}
Returns the Wide_String whose range is 1..Item'Length and each of whose
elements is given by To_Wide_Character of the corresponding element in
Item.
function To_Wide_String (Item : in Wide_Wide_String;
Substitute : in Wide_Character := ' ')
return Wide_String;
{
AI95-00395-01}
Returns the Wide_String whose range is 1..Item'Length and each of whose
elements is given by To_Wide_Character of the corresponding element in
Item with the given Substitute Wide_Character.
function To_Wide_Wide_String (Item : in String) return Wide_Wide_String;
function To_Wide_Wide_String (Item : in Wide_String)
return Wide_Wide_String;
{
AI95-00395-01}
Returns the Wide_Wide_String whose range is 1..Item'Length and each of
whose elements is given by To_Wide_Wide_Character of the corresponding
element in Item.
Extensions to Ada 95
{
AI95-00395-01}
The package Characters.Conversions is new, replacing
functions previously found in Characters.Handling.
Ada 2005 and 2012 Editions sponsored in part by Ada-Europe