home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / adav313.zip / gnat-3_13p-os2-bin-20010916.zip / emx / gnatlib / a-stwiun.ads < prev    next >
Text File  |  2000-07-19  |  12KB  |  391 lines

  1. ------------------------------------------------------------------------------
  2. --                                                                          --
  3. --                         GNAT RUN-TIME COMPONENTS                         --
  4. --                                                                          --
  5. --           A D A . S T R I N G S . W I D E _ U N B O U N D E D            --
  6. --                                                                          --
  7. --                                 S p e c                                  --
  8. --                                                                          --
  9. --                            $Revision: 1.7 $                              --
  10. --                                                                          --
  11. --          Copyright (C) 1992-1997 Free Software Foundation, Inc.          --
  12. --                                                                          --
  13. -- This specification is derived from the Ada Reference Manual for use with --
  14. -- GNAT. The copyright notice above, and the license provisions that follow --
  15. -- apply solely to the  contents of the part following the private keyword. --
  16. --                                                                          --
  17. -- GNAT is free software;  you can  redistribute it  and/or modify it under --
  18. -- terms of the  GNU General Public License as published  by the Free Soft- --
  19. -- ware  Foundation;  either version 2,  or (at your option) any later ver- --
  20. -- sion.  GNAT is distributed in the hope that it will be useful, but WITH- --
  21. -- OUT ANY WARRANTY;  without even the  implied warranty of MERCHANTABILITY --
  22. -- or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License --
  23. -- for  more details.  You should have  received  a copy of the GNU General --
  24. -- Public License  distributed with GNAT;  see file COPYING.  If not, write --
  25. -- to  the Free Software Foundation,  59 Temple Place - Suite 330,  Boston, --
  26. -- MA 02111-1307, USA.                                                      --
  27. --                                                                          --
  28. -- As a special exception,  if other files  instantiate  generics from this --
  29. -- unit, or you link  this unit with other files  to produce an executable, --
  30. -- this  unit  does not  by itself cause  the resulting  executable  to  be --
  31. -- covered  by the  GNU  General  Public  License.  This exception does not --
  32. -- however invalidate  any other reasons why  the executable file  might be --
  33. -- covered by the  GNU Public License.                                      --
  34. --                                                                          --
  35. -- GNAT was originally developed  by the GNAT team at  New York University. --
  36. -- It is now maintained by Ada Core Technologies Inc (http://www.gnat.com). --
  37. --                                                                          --
  38. ------------------------------------------------------------------------------
  39.  
  40. with Ada.Strings.Wide_Maps;
  41.  
  42. package Ada.Strings.Wide_Unbounded is
  43. pragma Preelaborate (Wide_Unbounded);
  44.  
  45.    type Unbounded_Wide_String is private;
  46.  
  47.    Null_Unbounded_Wide_String : constant Unbounded_Wide_String;
  48.  
  49.    function Length (Source : Unbounded_Wide_String) return Natural;
  50.  
  51.    type Wide_String_Access is access all Wide_String;
  52.  
  53.    procedure Free (X : in out Wide_String_Access);
  54.  
  55.    --------------------------------------------------------
  56.    -- Conversion, Concatenation, and Selection Functions --
  57.    --------------------------------------------------------
  58.  
  59.    function To_Unbounded_Wide_String
  60.      (Source : Wide_String)
  61.       return   Unbounded_Wide_String;
  62.  
  63.    function To_Unbounded_Wide_String
  64.      (Length : in Natural)
  65.       return   Unbounded_Wide_String;
  66.  
  67.    function To_Wide_String
  68.      (Source : Unbounded_Wide_String)
  69.       return   Wide_String;
  70.  
  71.    procedure Append
  72.      (Source   : in out Unbounded_Wide_String;
  73.       New_Item : in Unbounded_Wide_String);
  74.  
  75.    procedure Append
  76.      (Source   : in out Unbounded_Wide_String;
  77.       New_Item : in Wide_String);
  78.  
  79.    procedure Append
  80.      (Source   : in out Unbounded_Wide_String;
  81.       New_Item : in Wide_Character);
  82.  
  83.    function "&"
  84.      (Left, Right : Unbounded_Wide_String)
  85.       return        Unbounded_Wide_String;
  86.  
  87.    function "&"
  88.      (Left  : in Unbounded_Wide_String;
  89.       Right : in Wide_String)
  90.       return  Unbounded_Wide_String;
  91.  
  92.    function "&"
  93.      (Left  : in Wide_String;
  94.       Right : in Unbounded_Wide_String)
  95.       return  Unbounded_Wide_String;
  96.  
  97.    function "&"
  98.      (Left  : in Unbounded_Wide_String;
  99.       Right : in Wide_Character)
  100.       return  Unbounded_Wide_String;
  101.  
  102.    function "&"
  103.      (Left  : in Wide_Character;
  104.       Right : in Unbounded_Wide_String)
  105.       return  Unbounded_Wide_String;
  106.  
  107.    function Element
  108.      (Source : in Unbounded_Wide_String;
  109.       Index  : in Positive)
  110.       return   Wide_Character;
  111.  
  112.    procedure Replace_Element
  113.      (Source : in out Unbounded_Wide_String;
  114.       Index  : in Positive;
  115.       By     : Wide_Character);
  116.  
  117.    function Slice
  118.      (Source : in Unbounded_Wide_String;
  119.       Low    : in Positive;
  120.       High   : in Natural)
  121.       return   Wide_String;
  122.  
  123.    function "="
  124.      (Left  : in Unbounded_Wide_String;
  125.       Right : in Unbounded_Wide_String)
  126.       return  Boolean;
  127.  
  128.    function "="
  129.      (Left  : in Unbounded_Wide_String;
  130.       Right : in Wide_String)
  131.       return  Boolean;
  132.  
  133.    function "="
  134.      (Left  : in Wide_String;
  135.       Right : in Unbounded_Wide_String)
  136.       return  Boolean;
  137.  
  138.    function "<"
  139.      (Left  : in Unbounded_Wide_String;
  140.       Right : in Unbounded_Wide_String)
  141.       return  Boolean;
  142.  
  143.    function "<"
  144.      (Left  : in Unbounded_Wide_String;
  145.       Right : in Wide_String)
  146.       return  Boolean;
  147.  
  148.    function "<"
  149.      (Left  : in Wide_String;
  150.       Right : in Unbounded_Wide_String)
  151.       return  Boolean;
  152.  
  153.    function "<="
  154.      (Left  : in Unbounded_Wide_String;
  155.       Right : in Unbounded_Wide_String)
  156.       return  Boolean;
  157.  
  158.    function "<="
  159.      (Left  : in Unbounded_Wide_String;
  160.       Right : in Wide_String)
  161.       return  Boolean;
  162.  
  163.    function "<="
  164.      (Left  : in Wide_String;
  165.       Right : in Unbounded_Wide_String)
  166.       return  Boolean;
  167.  
  168.    function ">"
  169.      (Left  : in Unbounded_Wide_String;
  170.       Right : in Unbounded_Wide_String)
  171.       return  Boolean;
  172.  
  173.    function ">"
  174.      (Left  : in Unbounded_Wide_String;
  175.       Right : in Wide_String)
  176.       return  Boolean;
  177.  
  178.    function ">"
  179.      (Left  : in Wide_String;
  180.       Right : in Unbounded_Wide_String)
  181.       return  Boolean;
  182.  
  183.    function ">="
  184.      (Left  : in Unbounded_Wide_String;
  185.       Right : in Unbounded_Wide_String)
  186.       return  Boolean;
  187.  
  188.    function ">="
  189.      (Left  : in Unbounded_Wide_String;
  190.       Right : in Wide_String)
  191.       return  Boolean;
  192.  
  193.    function ">="
  194.      (Left  : in Wide_String;
  195.       Right : in Unbounded_Wide_String)
  196.       return  Boolean;
  197.  
  198.    ------------------------
  199.    -- Search Subprograms --
  200.    ------------------------
  201.  
  202.    function Index
  203.      (Source   : in Unbounded_Wide_String;
  204.       Pattern  : in Wide_String;
  205.       Going    : in Direction := Forward;
  206.       Mapping  : in Wide_Maps.Wide_Character_Mapping := Wide_Maps.Identity)
  207.       return     Natural;
  208.  
  209.    function Index
  210.      (Source   : in Unbounded_Wide_String;
  211.       Pattern  : in Wide_String;
  212.       Going    : in Direction := Forward;
  213.       Mapping  : in Wide_Maps.Wide_Character_Mapping_Function)
  214.       return     Natural;
  215.  
  216.    function Index
  217.      (Source : in Unbounded_Wide_String;
  218.       Set    : in Wide_Maps.Wide_Character_Set;
  219.       Test   : in Membership := Inside;
  220.       Going  : in Direction  := Forward)
  221.       return   Natural;
  222.  
  223.    function Index_Non_Blank
  224.      (Source : in Unbounded_Wide_String;
  225.       Going  : in Direction := Forward)
  226.       return   Natural;
  227.  
  228.    function Count
  229.      (Source  : in Unbounded_Wide_String;
  230.       Pattern : in Wide_String;
  231.       Mapping : in Wide_Maps.Wide_Character_Mapping := Wide_Maps.Identity)
  232.       return    Natural;
  233.  
  234.    function Count
  235.      (Source   : in Unbounded_Wide_String;
  236.       Pattern  : in Wide_String;
  237.       Mapping  : in Wide_Maps.Wide_Character_Mapping_Function)
  238.       return     Natural;
  239.  
  240.    function Count
  241.      (Source : in Unbounded_Wide_String;
  242.       Set    : in Wide_Maps.Wide_Character_Set)
  243.       return   Natural;
  244.  
  245.    procedure Find_Token
  246.      (Source : in Unbounded_Wide_String;
  247.       Set    : in Wide_Maps.Wide_Character_Set;
  248.       Test   : in Membership;
  249.       First  : out Positive;
  250.       Last   : out Natural);
  251.  
  252.    ------------------------------------
  253.    -- Wide_String Translation Subprograms --
  254.    ------------------------------------
  255.  
  256.    function Translate
  257.      (Source  : in Unbounded_Wide_String;
  258.       Mapping : in Wide_Maps.Wide_Character_Mapping)
  259.       return    Unbounded_Wide_String;
  260.  
  261.    procedure Translate
  262.      (Source  : in out Unbounded_Wide_String;
  263.       Mapping : Wide_Maps.Wide_Character_Mapping);
  264.  
  265.    function Translate
  266.      (Source  : in Unbounded_Wide_String;
  267.       Mapping : in Wide_Maps.Wide_Character_Mapping_Function)
  268.       return    Unbounded_Wide_String;
  269.  
  270.    procedure Translate
  271.      (Source  : in out Unbounded_Wide_String;
  272.       Mapping : in Wide_Maps.Wide_Character_Mapping_Function);
  273.  
  274.    ---------------------------------------
  275.    -- Wide_String Transformation Subprograms --
  276.    ---------------------------------------
  277.  
  278.    function Replace_Slice
  279.      (Source : in Unbounded_Wide_String;
  280.       Low    : in Positive;
  281.       High   : in Natural;
  282.       By     : in Wide_String)
  283.       return   Unbounded_Wide_String;
  284.  
  285.    procedure Replace_Slice
  286.      (Source   : in out Unbounded_Wide_String;
  287.       Low      : in Positive;
  288.       High     : in Natural;
  289.       By       : in Wide_String);
  290.  
  291.    function Insert
  292.      (Source   : in Unbounded_Wide_String;
  293.       Before   : in Positive;
  294.       New_Item : in Wide_String)
  295.       return     Unbounded_Wide_String;
  296.  
  297.    procedure Insert
  298.      (Source   : in out Unbounded_Wide_String;
  299.       Before   : in Positive;
  300.       New_Item : in Wide_String);
  301.  
  302.    function Overwrite
  303.      (Source   : in Unbounded_Wide_String;
  304.       Position : in Positive;
  305.       New_Item : in Wide_String)
  306.       return     Unbounded_Wide_String;
  307.  
  308.    procedure Overwrite
  309.      (Source    : in out Unbounded_Wide_String;
  310.       Position  : in Positive;
  311.       New_Item  : in Wide_String);
  312.  
  313.    function Delete
  314.      (Source  : in Unbounded_Wide_String;
  315.       From    : in Positive;
  316.       Through : in Natural)
  317.       return    Unbounded_Wide_String;
  318.  
  319.    procedure Delete
  320.      (Source  : in out Unbounded_Wide_String;
  321.       From    : in Positive;
  322.       Through : in Natural);
  323.  
  324.    function Trim
  325.      (Source : in Unbounded_Wide_String;
  326.       Side   : in Trim_End)
  327.       return   Unbounded_Wide_String;
  328.  
  329.    procedure Trim
  330.      (Source : in out Unbounded_Wide_String;
  331.       Side   : in Trim_End);
  332.  
  333.    function Trim
  334.      (Source : in Unbounded_Wide_String;
  335.       Left   : in Wide_Maps.Wide_Character_Set;
  336.       Right  : in Wide_Maps.Wide_Character_Set)
  337.       return   Unbounded_Wide_String;
  338.  
  339.    procedure Trim
  340.      (Source : in out Unbounded_Wide_String;
  341.       Left   : in Wide_Maps.Wide_Character_Set;
  342.       Right  : in Wide_Maps.Wide_Character_Set);
  343.  
  344.    function Head
  345.      (Source : in Unbounded_Wide_String;
  346.       Count  : in Natural;
  347.       Pad    : in Wide_Character := Wide_Space)
  348.       return   Unbounded_Wide_String;
  349.  
  350.    procedure Head
  351.      (Source : in out Unbounded_Wide_String;
  352.       Count  : in Natural;
  353.       Pad    : in Wide_Character := Wide_Space);
  354.  
  355.    function Tail
  356.      (Source : in Unbounded_Wide_String;
  357.       Count  : in Natural;
  358.       Pad    : in Wide_Character := Wide_Space)
  359.       return   Unbounded_Wide_String;
  360.  
  361.    procedure Tail
  362.      (Source : in out Unbounded_Wide_String;
  363.       Count  : in Natural;
  364.       Pad    : in Wide_Character := Wide_Space);
  365.  
  366.    function "*"
  367.      (Left  : in Natural;
  368.       Right : in Wide_Character)
  369.       return  Unbounded_Wide_String;
  370.  
  371.    function "*"
  372.      (Left  : in Natural;
  373.       Right : in Wide_String)
  374.       return  Unbounded_Wide_String;
  375.  
  376.    function "*"
  377.      (Left  : in Natural;
  378.       Right : in Unbounded_Wide_String)
  379.       return  Unbounded_Wide_String;
  380.  
  381. private
  382.  
  383.    type Unbounded_Wide_String is record
  384.       Reference : Wide_String_Access := new Wide_String'("");
  385.    end record;
  386.  
  387.    Null_Unbounded_Wide_String : constant Unbounded_Wide_String :=
  388.                              (Reference => new Wide_String'(""));
  389.  
  390. end Ada.Strings.Wide_Unbounded;
  391.