跳转到内容

Ada 编程/库/Ada.Strings.Wide_Maps

来自维基教科书,开放的书籍,开放的世界

Ada. Time-tested, safe and secure.
Ada. 经时间考验,安全可靠。

此语言特性从 Ada 95 开始可用。

Ada.Strings.Wide_Maps 是自 Ada 95 以来 预定义语言环境 的一个单元。

--                     Standard Ada library specification
--   Copyright (c) 2003-2018 Maxim Reznik <[email protected]>
--   Copyright (c) 2004-2016 AXE Consultants
--   Copyright (c) 2004, 2005, 2006 Ada-Europe
--   Copyright (c) 2000 The MITRE Corporation, Inc.
--   Copyright (c) 1992, 1993, 1994, 1995 Intermetrics, Inc.
--   SPDX-License-Identifier: BSD-3-Clause and LicenseRef-AdaReferenceManual
-- -------------------------------------------------------------------------

package Ada.Strings.Wide_Maps is
   pragma Preelaborate (Wide_Maps);

   --  Representation for a set of Wide_Character values:
   type Wide_Character_Set is private;
   pragma Preelaborable_Initialization (Wide_Character_Set);

   Null_Set : constant Wide_Character_Set;

   type Wide_Character_Range is
      record
         Low  : Wide_Character;
         High : Wide_Character;
      end record;
   --  Represents Wide_Character range Low..High

   type Wide_Character_Ranges is array (Positive range <>)
     of Wide_Character_Range;

   function To_Set    (Ranges : in Wide_Character_Ranges)
                      return Wide_Character_Set;

   function To_Set    (Span   : in Wide_Character_Range)
                      return Wide_Character_Set;

   function To_Ranges (Set    : in Wide_Character_Set)
                      return Wide_Character_Ranges;

   function "="   (Left, Right : in Wide_Character_Set) return Boolean;

   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;

   function Is_In (Element : in Wide_Character;
                   Set     : in Wide_Character_Set)
                  return Boolean;

   function Is_Subset (Elements : in Wide_Character_Set;
                       Set      : in Wide_Character_Set)
                      return Boolean;

   function "<=" (Left  : in Wide_Character_Set;
                  Right : in Wide_Character_Set)
                 return Boolean renames Is_Subset;

   --  Alternative representation for a set of Wide_Character values:
   subtype Wide_Character_Sequence is Wide_String;

   function To_Set (Sequence  : in Wide_Character_Sequence)
                   return Wide_Character_Set;

   function To_Set (Singleton : in Wide_Character)
                   return Wide_Character_Set;

   function To_Sequence (Set  : in Wide_Character_Set)
                        return Wide_Character_Sequence;

   --  Representation for a Wide_Character to Wide_Character mapping:
   type Wide_Character_Mapping is private;
   pragma Preelaborable_Initialization (Wide_Character_Mapping);

   function Value (Map     : in Wide_Character_Mapping;
                   Element : in Wide_Character)
                  return Wide_Character;

   Identity : constant Wide_Character_Mapping;

   function To_Mapping (From, To : in Wide_Character_Sequence)
                       return Wide_Character_Mapping;

   function To_Domain (Map : in Wide_Character_Mapping)
                      return Wide_Character_Sequence;

   function To_Range  (Map : in Wide_Character_Mapping)
                      return Wide_Character_Sequence;

   type Wide_Character_Mapping_Function is
     access function (From : in Wide_Character) return Wide_Character;

private

   pragma Import (Ada, Wide_Character_Set);
   pragma Import (Ada, Null_Set);
   pragma Import (Ada, Wide_Character_Mapping);
   pragma Import (Ada, Identity);

end Ada.Strings.Wide_Maps;



维基教科书

[编辑 | 编辑源代码]

外部示例

[编辑源代码]

Ada 参考手册

[编辑 | 编辑源代码]

开源实现

[编辑 | 编辑源代码]

FSF GNAT

drake

华夏公益教科书