DocAda(tm) is a productivity tool of KSCE

Prev | Up | Next | Back | Forward
About DocAda Light: Preface / Preliminary / Help / TOC / Copyright
DocAda Online at the Ada Home: Complete RM95 / Updates / News

A.3.2 The Package Characters.Handling

Static Semantics

The library package Characters.Handling has the following declaration:

   
       package Ada.Characters.Handling is
         pragma Preelaborate(Handling);

       --Character classification functions

         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;

       --Conversion functions for Character and String

         function To_Lower (Item : in Character) return Character;
         function To_Upper (Item : in Character) return Character;
         function To_Basic (Item : in Character) return Character;

         function To_Lower (Item : in String) return String;
         function To_Upper (Item : in String) return String;
         function To_Basic (Item : in String) return String;

       --Classifications of and conversions between Character and ISO 646

         subtype ISO_646 is
           Character range Character'Val(0) .. Character'Val(127);

         function Is_ISO_646 (Item : in Character) return Boolean;
         function Is_ISO_646 (Item : in String)    return Boolean;

         function To_ISO_646 (Item       : in Character;
                              Substitute : in ISO_646 := ' ')
           return ISO_646;

         function To_ISO_646 (Item       : in String;
                              Substitute : in ISO_646 := ' ')
           return String;

       --Classifications of and conversions between Wide_Character and Character.

         function Is_Character (Item : in Wide_Character) return Boolean;
         function Is_String    (Item : in Wide_String)    return Boolean;

         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_Wide_Character (Item : in Character) return Wide_Character;

         function To_Wide_String    (Item : in String)    return Wide_String;

       end Ada.Characters.Handling;

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.

Each of the following classification functions has a formal Character parameter, Item, and returns a Boolean result.

Is_Control

Is_Graphic

Is_Letter

Is_Lower

Is_Upper

Is_Basic

Is_Digit

Is_Decimal_Digit

Is_Hexadecimal_Digit

Is_Alphanumeric

Is_Special

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.

To_Lower

To_Upper

To_Basic

The following set of functions test for membership in the ISO 646 character range, or convert between ISO 646 and Character.

Is_ISO_646

Is_ISO_646

To_ISO_646

To_ISO_646

The following set of functions test Wide_Character values for membership in Character, or convert between corresponding characters of Wide_Character and Character.

Is_Character

Is_String

To_Character

To_String

To_Wide_Character

To_Wide_String

Implementation Advice

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.

About DocAda Light: Preface / Preliminary / Help / TOC / Copyright
DocAda Online at the Ada Home: Complete RM95 / Updates / News
Prev | Up | Next | Back | Forward


Copyright © 1994-1997 by Kempe Software Capital Enterprises. All Rights Reserved. For comments on this DocAda(tm) hypertext document, please write to KSCE, at docada@ksce.com