Go to the first, previous, next, last section, table of contents.


A.4.7 Wide_String Handling

  1. Facilities for handling strings of Wide_Character elements are found in the packages Strings.Wide_Maps, Strings.Wide_Fixed, Strings.Wide_Bounded, Strings.Wide_Unbounded, and Strings.Wide_Maps.Wide_Constants. They provide the same string-handling operations as the corresponding packages for strings of Character elements.

    Static Semantics

  2. The package Strings.Wide_Maps has the following declaration.
  3. package Ada.Strings.Wide_Maps is
       pragma Preelaborate(Wide_Maps);
    
  4.    -- Representation for a set of Wide_Character values:
       type Wide_Character_Set is private;
    
  5.    Null_Set : constant Wide_Character_Set;
    
  6.    type Wide_Character_Range is
         record
             Low  : Wide_Character;
             High : Wide_Character;
         end record;
       -- Represents Wide_Character range Low..High
    
  7.    type Wide_Character_Ranges is array (Positive range <>)
         of Wide_Character_Range;
    
  8.    function To_Set (Ranges : in Wide_Character_Ranges)
         return Wide_Character_Set;
    
  9.    function To_Set (Span : in Wide_Character_Range)
         return Wide_Character_Set;
    
  10.    function To_Ranges (Set : in Wide_Character_Set)
         return Wide_Character_Ranges;
    
  11.    function "=" (Left, Right : in Wide_Character_Set) return Boolean;
    
  12.    function "not" (Right : in Wide_Character_Set)
         return Wide_Character_Set;
       function "and" (Left, Right : in Wide_Character_Set)
         return Wide_Character_Set;
       function "or"  (Left, Right : in Wide_Character_Set)
         return Wide_Character_Set;
       function "xor" (Left, Right : in Wide_Character_Set)
         return Wide_Character_Set;
       function "-"   (Left, Right : in Wide_Character_Set)
         return Wide_Character_Set;
    
  13.    function Is_In (Element : in Wide_Character;
                       Set     : in Wide_Character_Set)
          return Boolean;
    
  14.    function Is_Subset (Elements : in Wide_Character_Set;
                           Set      : in Wide_Character_Set)
          return Boolean;
    
  15.    function "<=" (Left  : in Wide_Character_Set;
                      Right : in Wide_Character_Set)
          return Boolean renames Is_Subset;
    
  16.    -- Alternative representation for a set of Wide_Character values:
       subtype Wide_Character_Sequence is Wide_String;
    
  17.    function To_Set (Sequence : in Wide_Character_Sequence)
         return Wide_Character_Set;
    
  18.    function To_Set (Singleton : in Wide_Character)
         return Wide_Character_Set;
    
  19.    function To_Sequence (Set : in Wide_Character_Set)
         return Wide_Character_Sequence;
    
  20.    -- Representation for a Wide_Character to Wide_Character mapping:
       type Wide_Character_Mapping is private;
    
  21.    function Value (Map     : in Wide_Character_Mapping;
                       Element : in Wide_Character)
          return Wide_Character;
    
  22.    Identity : constant Wide_Character_Mapping;
    
  23.    function To_Mapping (From, To : in Wide_Character_Sequence)
          return Wide_Character_Mapping;
    
  24.    function To_Domain (Map : in Wide_Character_Mapping)
          return Wide_Character_Sequence;
    
  25.    function To_Range  (Map : in Wide_Character_Mapping)
          return Wide_Character_Sequence;
    
  26.    type Wide_Character_Mapping_Function is access
          function (From : in Wide_Character) return Wide_Character;
    
  27. private
       ... -- not specified by the language
    end Ada.Strings.Wide_Maps;
    
  28. The context clause for each of the packages Strings.Wide_Fixed, Strings.Wide_Bounded, and Strings.Wide_Unbounded identifies Strings.Wide_Maps instead of Strings.Maps.
  29. For each of the packages Strings.Fixed, Strings.Bounded, Strings.Unbounded, and Strings.Maps.Constants the corresponding wide string package has the same contents except that
    1. Wide_Space replaces Space
    2. Wide_Character replaces Character
    3. Wide_String replaces String
    4. Wide_Character_Set replaces Character_Set
    5. Wide_Character_Mapping replaces Character_Mapping
    6. Wide_Character_Mapping_Function replaces Character_Mapping_Function
    7. Wide_Maps replaces Maps
    8. Bounded_Wide_String replaces Bounded_String
    9. Null_Bounded_Wide_String replaces Null_Bounded_String
    10. To_Bounded_Wide_String replaces To_Bounded_String
    11. To_Wide_String replaces To_String
    12. Unbounded_Wide_String replaces Unbounded_String
    13. Null_Unbounded_Wide_String replaces Null_Unbounded_String
    14. Wide_String_Access replaces String_Access
    15. To_Unbounded_Wide_String replaces To_Unbounded_String

  1. The following additional declaration is present in Strings.Wide_Maps.Wide_Constants:
  2. Character_Set : constant Wide_Maps.Wide_Character_Set;
    --  Contains each Wide_Character value WC such that
    --  Characters.Is_Character(WC) is True
    

    NOTES

  3. (12) If a null Wide_Character_Mapping_Function is passed to any of the Wide_String handling subprograms, Constraint_Error is propagated.
  4. (13) Each Wide_Character_Set constant in the package Strings.Wide_Maps.Wide_Constants contains no values outside the Character portion of Wide_Character. Similarly, each Wide_Character_Mapping constant in this package is the identity mapping when applied to any element outside the Character portion of Wide_Character.


Go to the first, previous, next, last section, table of contents.