--  Ada.Strings.Wide_Maps.Wide_Constants (RM A.4.8): Ada.Strings.Maps.Constants' sets and mappings
--  as wide ones, holding and moving only the Latin-1 characters (every other wide character is
--  in none of the sets, and each mapping takes it to itself), and Character_Set, the Latin-1
--  characters themselves.
with Ada.Characters.Handling;

package Ada.Strings.Wide_Maps.Wide_Constants is
   Character_Set : constant Wide_Maps.Wide_Character_Set;

   Control_Set : constant Wide_Character_Set;
   Graphic_Set : constant Wide_Character_Set;
   Letter_Set : constant Wide_Character_Set;
   Lower_Set : constant Wide_Character_Set;
   Upper_Set : constant Wide_Character_Set;
   Basic_Set : constant Wide_Character_Set;
   Decimal_Digit_Set : constant Wide_Character_Set;
   Hexadecimal_Digit_Set : constant Wide_Character_Set;
   Alphanumeric_Set : constant Wide_Character_Set;
   Special_Set : constant Wide_Character_Set;
   ISO_646_Set : constant Wide_Character_Set;

   Lower_Case_Map : constant Wide_Character_Mapping;
   Upper_Case_Map : constant Wide_Character_Mapping;
   Basic_Map : constant Wide_Character_Mapping;
private
   package Handling renames Ada.Characters.Handling;

   Character_Set : constant Wide_Maps.Wide_Character_Set := Make ([for I in 1 .. Size => Bit (I <= 256)]);

   Control_Set : constant Wide_Character_Set :=
     Make ([for I in 1 .. Size => Bit (I <= 256 and then Handling.Is_Control (Character'Val (I - 1)))]);
   Graphic_Set : constant Wide_Character_Set :=
     Make ([for I in 1 .. Size => Bit (I <= 256 and then Handling.Is_Graphic (Character'Val (I - 1)))]);
   Letter_Set : constant Wide_Character_Set :=
     Make ([for I in 1 .. Size => Bit (I <= 256 and then Handling.Is_Letter (Character'Val (I - 1)))]);
   Lower_Set : constant Wide_Character_Set :=
     Make ([for I in 1 .. Size => Bit (I <= 256 and then Handling.Is_Lower (Character'Val (I - 1)))]);
   Upper_Set : constant Wide_Character_Set :=
     Make ([for I in 1 .. Size => Bit (I <= 256 and then Handling.Is_Upper (Character'Val (I - 1)))]);
   Basic_Set : constant Wide_Character_Set :=
     Make ([for I in 1 .. Size => Bit (I <= 256 and then Handling.Is_Basic (Character'Val (I - 1)))]);
   Decimal_Digit_Set : constant Wide_Character_Set :=
     Make ([for I in 1 .. Size => Bit (I <= 256 and then Handling.Is_Decimal_Digit (Character'Val (I - 1)))]);
   Hexadecimal_Digit_Set : constant Wide_Character_Set :=
     Make ([for I in 1 .. Size => Bit (I <= 256 and then Handling.Is_Hexadecimal_Digit (Character'Val (I - 1)))]);
   Alphanumeric_Set : constant Wide_Character_Set :=
     Make ([for I in 1 .. Size => Bit (I <= 256 and then Handling.Is_Alphanumeric (Character'Val (I - 1)))]);
   Special_Set : constant Wide_Character_Set :=
     Make ([for I in 1 .. Size => Bit (I <= 256 and then Handling.Is_Special (Character'Val (I - 1)))]);
   ISO_646_Set : constant Wide_Character_Set :=
     Make ([for I in 1 .. Size => Bit (I <= 256 and then Handling.Is_ISO_646 (Character'Val (I - 1)))]);
   Lower_Case_Map : constant Wide_Character_Mapping :=
     Make_Mapping ([for I in 1 .. Size => Wide_Wide_Character'Val (if I <= 256 then Character'Pos (Handling.To_Lower (Character'Val (I - 1))) else I - 1)]);
   Upper_Case_Map : constant Wide_Character_Mapping :=
     Make_Mapping ([for I in 1 .. Size => Wide_Wide_Character'Val (if I <= 256 then Character'Pos (Handling.To_Upper (Character'Val (I - 1))) else I - 1)]);
   Basic_Map : constant Wide_Character_Mapping :=
     Make_Mapping ([for I in 1 .. Size => Wide_Wide_Character'Val (if I <= 256 then Character'Pos (Handling.To_Basic (Character'Val (I - 1))) else I - 1)]);
end Ada.Strings.Wide_Maps.Wide_Constants;
