package body Ada.Wide_Wide_Characters.Handling is
+ ---------------------------
+ -- Character_Set_Version --
+ ---------------------------
+
+ function Character_Set_Version return String is
+ begin
+ return "Unicode 4.0";
+ end Character_Set_Version;
+
---------------------
-- Is_Alphanumeric --
---------------------
return Is_Letter (Item) or else Is_Digit (Item);
end Is_Alphanumeric;
+ --------------
+ -- Is_Basic --
+ --------------
+
+ function Is_Basic (Item : Wide_Wide_Character) return Boolean
+ renames Ada.Wide_Wide_Characters.Unicode.Is_Basic;
+
----------------
-- Is_Control --
----------------
return Result;
end To_Upper;
+ --------------
+ -- To_Basic --
+ --------------
+
+ function To_Basic (Item : Wide_Wide_Character) return Wide_Wide_Character
+ renames Ada.Wide_Wide_Characters.Unicode.To_Basic;
+
+ function To_Basic (Item : Wide_Wide_String) return Wide_Wide_String is
+ Result : Wide_Wide_String (Item'Range);
+
+ begin
+ for J in Result'Range loop
+ Result (J) := To_Basic (Item (J));
+ end loop;
+
+ return Result;
+ end To_Basic;
+
end Ada.Wide_Wide_Characters.Handling;
package Ada.Wide_Wide_Characters.Handling is
pragma Pure;
- -- This package is clearly intended to be Pure, by analogy with the
- -- base Ada.Characters.Handling package. The version in the RM does
- -- not yet have this pragma, but that is a clear omission. This will
- -- be fixed in a future version of AI05-0266-1.
+
+ function Character_Set_Version return String;
+ pragma Inline (Character_Set_Version);
+ -- Returns an implementation-defined identifier that identifies the version
+ -- of the character set standard that is used for categorizing characters
+ -- by the implementation. For GNAT this is "Unicode v.v".
function Is_Control (Item : Wide_Wide_Character) return Boolean;
pragma Inline (Is_Control);
-- Returns True if the Wide_Wide_Character designated by Item is
-- categorized as letter_uppercase, otherwise returns false.
+ function Is_Basic (Item : Wide_Wide_Character) return Boolean;
+ pragma Inline (Is_Basic);
+ -- Returns True if the Wide_Wide_Character designated by Item has no
+ -- Decomposition Mapping in the code charts of ISO/IEC 10646:2017,
+ -- otherwise returns False.
+
function Is_Digit (Item : Wide_Wide_Character) return Boolean;
pragma Inline (Is_Digit);
-- Returns True if the Wide_Wide_Character designated by Item is
-- designated by Item. The result is the null Wide_Wide_String if the value
-- of the formal parameter is the null Wide_Wide_String.
+ function To_Basic (Item : Wide_Wide_Character) return Wide_Wide_Character;
+ pragma Inline (To_Basic);
+ -- Returns the Wide_Wide_Character whose code point is given
+ -- by the first value of its Decomposition Mapping in the code charts
+ -- of ISO/IEC 10646:2017 if any, returns Item otherwise.
+
+ function To_Basic (Item : Wide_Wide_String) return Wide_Wide_String;
+ -- Returns the result of applying the To_Basic conversion to each
+ -- Wide_Wide_Character element of the Wide_Wide_String designated by Item.
+ -- The result is the null Wide_Wide_String if the value of the formal
+ -- parameter is the null Wide_Wide_String. The lower bound of the result
+ -- Wide_Wide_String is 1.
+
end Ada.Wide_Wide_Characters.Handling;
-- in the list of categories above. This means that these characters can
-- be included in character and string literals.
+ function Is_Basic (U : Wide_Wide_Character) return Boolean;
+ pragma Inline (Is_Basic);
+ -- Returns True if the Wide_Wide_Character designated by Item has no
+ -- Decomposition Mapping in the code charts of ISO/IEC 10646:2017,
+ -- otherwise returns False.
+
+ function To_Basic (U : Wide_Wide_Character) return Wide_Wide_Character;
+ pragma Inline (To_Basic);
+ -- Returns the Wide_Wide_Character whose code point is given by the first
+ -- value of its Decomposition Mapping in the code charts of
+ -- ISO/IEC 10646:2017 if any, returns Item otherwise.
+
-- The following function is used to fold to upper case, as required by
-- the Ada 2005 standard rules for identifier case folding. Two
-- identifiers are equivalent if they are identical after folding all