Prev | Up | Next | Back | Forward
TOC -- / --.-- / --.--.-- | Index | Search | Syntax | Help


A.3.2 The Package Characters.Handling

Static Semantics
(1)
The library package Characters.Handling has the following declaration:
(2)
       package Ada.Characters.Handling is
         pragma Preelaborate(Handling);
(3)
       --Character classification functions
(4)
         function Is_Control           (Item : in Character) return Boolean;
         function Is_Graphic           (Item : in Character) return Boolean;
         function Is_Letter            (Item : in Character) return Boolean;
         function Is_Lower             (Item : in Character) return Boolean;
         function Is_Upper             (Item : in Character) return Boolean;
         function Is_Basic             (Item : in Character) return Boolean;
         function Is_Digit             (Item : in Character) return Boolean;
         function Is_Decimal_Digit     (Item : in Character) return Boolean renames Is_Digit;
         function Is_Hexadecimal_Digit (Item : in Character) return Boolean;
         function Is_Alphanumeric      (Item : in Character) return Boolean;
         function Is_Special           (Item : in Character) return Boolean;
(5)
       --Conversion functions for Character and String
(6)
         function To_Lower (Item : in Character) return Character;
         function To_Upper (Item : in Character) return Character;
         function To_Basic (Item : in Character) return Character;
(7)
         function To_Lower (Item : in String) return String;
         function To_Upper (Item : in String) return String;
         function To_Basic (Item : in String) return String;
(8)
       --Classifications of and conversions between Character and ISO 646
(9)
         subtype ISO_646 is
           Character range Character'Val(0) .. Character'Val(127);
(10)
         function Is_ISO_646 (Item : in Character) return Boolean;
         function Is_ISO_646 (Item : in String)    return Boolean;
(11)
         function To_ISO_646 (Item       : in Character;
                              Substitute : in ISO_646 := ' ')
           return ISO_646;
(12)
         function To_ISO_646 (Item       : in String;
                              Substitute : in ISO_646 := ' ')
           return String;
(13)
       --Classifications of and conversions between Wide_Character and Character.
(14)
         function Is_Character (Item : in Wide_Character) return Boolean;
         function Is_String    (Item : in Wide_String)    return Boolean;
(15)
         function To_Character (Item       : in Wide_Character;
                                Substitute : in Character := ' ')
           return Character;
(16)
         function To_String    (Item       : in Wide_String;
                                Substitute : in Character := ' ')
           return String;
(17)
         function To_Wide_Character (Item : in Character) return Wide_Character;
(18)
         function To_Wide_String    (Item : in String)    return Wide_String;
(19)
       end Ada.Characters.Handling;
(20)
In the description below for each function that returns a Boolean result, the effect is described in terms of the conditions under which the value True is returned. If these conditions are not met, then the function returns False.
(21)
Each of the following classification functions has a formal Character parameter, Item, and returns a Boolean result.
(22)
Is_Control
(23)
Is_Graphic
(24)
Is_Letter
(25)
Is_Lower
(26)
Is_Upper
(27)
Is_Basic
(28)
Is_Digit
(29)
Is_Decimal_Digit
(30)
Is_Hexadecimal_Digit
(31)
Is_Alphanumeric
(32)
Is_Special
(33)
Each of the names To_Lower, To_Upper, and To_Basic refers to two functions: one that converts from Character to Character, and the other that converts from String to String. The result of each Character-to-Character function is described below, in terms of the conversion applied to Item, its formal Character parameter. The result of each String-to-String conversion is obtained by applying to each element of the function's String parameter the corresponding Character-to-Character conversion; the result is the null String if the value of the formal parameter is the null String. The lower bound of the result String is 1.
(34)
To_Lower
(35)
To_Upper
(36)
To_Basic
(37)
The following set of functions test for membership in the ISO 646 character range, or convert between ISO 646 and Character.
(38)
Is_ISO_646
(39)
Is_ISO_646
(40)
To_ISO_646
(41)
To_ISO_646
(42)
The following set of functions test Wide_Character values for membership in Character, or convert between corresponding characters of Wide_Character and Character.
(43)
Is_Character
(44)
Is_String
(45)
To_Character
(46)
To_String
(47)
To_Wide_Character
(48)
To_Wide_String
Implementation Advice
(49)
If an implementation provides a localized definition of Character or Wide_Character, then the effects of the subprograms in Characters.Handling should reflect the localizations. See also 3.5.2.

(50)
(51)
(52)
(53)
(54)
(55)
(56)
(57)
(58)
(59)

Prev | Up | Next | Back | Forward
TOC -- / --.-- / --.--.-- | Index | Search | Syntax | Help

Ada WWW Home -- Email comments, additions, corrections, gripes, kudos, etc. to:

Magnus Kempe -- Magnus.Kempe@di.epfl.ch
Copyright statement
Page last generated: 95-03-12