1------------------------------------------------------------------------------- 2-- 3-- This unit is part of the @Asis2@ ASIS secondary library. 4-- 5-- <STRONG>Copyright (c) 2002, 2003 by Thomas Wolf.</STRONG> 6-- <BLOCKQUOTE> 7-- AdaBrowse is free software; you can redistribute it and/or modify it 8-- under the terms of the GNU General Public License as published by the 9-- Free Software Foundation; either version 2, or (at your option) any 10-- later version. AdaBrowse is distributed in the hope that it will be 11-- useful, but <EM>without any warranty</EM>; without even the implied 12-- warranty of <EM>merchantability or fitness for a particular purpose.</EM> 13-- See the GNU General Public License for more details. You should have 14-- received a copy of the GNU General Public License with this distribution, 15-- see file "<A HREF="GPL.txt">GPL.txt</A>". If not, write to the Free 16-- Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, 17-- USA. 18-- </BLOCKQUOTE> 19-- <BLOCKQUOTE> 20-- As a special exception from the GPL, if other files instantiate generics 21-- from this unit, or you link this unit with other files to produce an 22-- executable, this unit does not by itself cause the resulting executable 23-- to be covered by the GPL. This exception does not however invalidate any 24-- other reasons why the executable file might be covered by the GPL. 25-- </BLOCKQUOTE> 26-- 27-- <AUTHOR> 28-- Thomas Wolf (TW) <E_MAIL> 29-- </AUTHOR> 30-- 31-- <PURPOSE> 32-- Commonly useful operations on @Wide_String@. 33-- </PURPOSE> 34-- 35-- <HISTORY> 36-- 18-JUL-2003 TW Initial version. 37-- </HISTORY> 38------------------------------------------------------------------------------- 39 40pragma License (Modified_GPL); 41 42with Ada.Characters.Handling; 43with Ada.Characters.Latin_1; 44with Ada.Strings.Wide_Maps.Wide_Constants; 45 46package Asis2.Text is 47 48 pragma Elaborate_Body; 49 50 function To_Lower 51 (Source : in Wide_String) 52 return Wide_String; 53 -- Applies @Ada.Strings.Wide_Maps.Wide_Constants.Lower_Map@ to @Source@. 54 55 function To_Upper 56 (Source : in Wide_String) 57 return Wide_String; 58 -- Applies @Ada.Strings.Wide_Maps.Wide_Constants.Upper_Map@ to @Source@. 59 60 function To_Basic 61 (Source : in Wide_String) 62 return Wide_String; 63 -- Applies @Ada.Strings.Wide_Maps.Wide_Constants.Basic_Map@ to @Source@. 64 65 function To_Mixed 66 (Source : in Wide_String) 67 return Wide_String; 68 -- Applies @Ada.Strings.Wide_Maps.Wide_Constants.Upper_Map@ the first 69 -- element in @Source@ and to all elements in source following a white 70 -- space, punctuation, or the underscore. 71 72 White_Space : constant Ada.Strings.Wide_Maps.Wide_Character_Set; 73 74 function Trim 75 (Source : in Wide_String) 76 return Wide_String; 77 -- Trims all leading or trailing characters in @White_Space@ from @Source@. 78 79private 80 81 use type Ada.Strings.Wide_Maps.Wide_Character_Set; 82 83 White_Space : constant Ada.Strings.Wide_Maps.Wide_Character_Set := 84 Ada.Strings.Wide_Maps.Wide_Constants.Control_Set or 85 Ada.Strings.Wide_Maps.To_Set 86 (Ada.Characters.Handling.To_Wide_String 87 (' ' & Ada.Characters.Latin_1.NBSP)); 88 89end Asis2.Text; 90