annotate gcc/ada/libgnat/a-suezst.ads @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 ------------------------------------------------------------------------------
kono
parents:
diff changeset
2 -- --
kono
parents:
diff changeset
3 -- GNAT RUN-TIME COMPONENTS --
kono
parents:
diff changeset
4 -- --
kono
parents:
diff changeset
5 -- ADA.STRINGS.UTF_ENCODING.WIDE_WIDE_STRINGS --
kono
parents:
diff changeset
6 -- --
kono
parents:
diff changeset
7 -- S p e c --
kono
parents:
diff changeset
8 -- --
kono
parents:
diff changeset
9 -- This specification is derived from the Ada Reference Manual for use with --
kono
parents:
diff changeset
10 -- GNAT. In accordance with the copyright of that document, you can freely --
kono
parents:
diff changeset
11 -- copy and modify this specification, provided that if you redistribute a --
kono
parents:
diff changeset
12 -- modified version, any changes that you have made are clearly indicated. --
kono
parents:
diff changeset
13 -- --
kono
parents:
diff changeset
14 ------------------------------------------------------------------------------
kono
parents:
diff changeset
15
kono
parents:
diff changeset
16 -- This is an Ada 2012 package defined in AI05-0137-1. It is used for encoding
kono
parents:
diff changeset
17 -- and decoding Wide_String values using UTF encodings. Note: this package is
kono
parents:
diff changeset
18 -- consistent with Ada 2005, and may be used in Ada 2005 mode, but cannot be
kono
parents:
diff changeset
19 -- used in Ada 95 mode, since Wide_Wide_Character is an Ada 2005 feature.
kono
parents:
diff changeset
20
kono
parents:
diff changeset
21 package Ada.Strings.UTF_Encoding.Wide_Wide_Strings is
kono
parents:
diff changeset
22 pragma Pure (Wide_Wide_Strings);
kono
parents:
diff changeset
23
kono
parents:
diff changeset
24 -- The encoding routines take a Wide_Wide_String as input and encode the
kono
parents:
diff changeset
25 -- result using the specified UTF encoding method. The result includes a
kono
parents:
diff changeset
26 -- BOM if the Output_BOM parameter is set to True.
kono
parents:
diff changeset
27
kono
parents:
diff changeset
28 function Encode
kono
parents:
diff changeset
29 (Item : Wide_Wide_String;
kono
parents:
diff changeset
30 Output_Scheme : Encoding_Scheme;
kono
parents:
diff changeset
31 Output_BOM : Boolean := False) return UTF_String;
kono
parents:
diff changeset
32 -- Encode Wide_Wide_String using UTF-8, UTF-16LE or UTF-16BE encoding as
kono
parents:
diff changeset
33 -- specified by the Output_Scheme parameter.
kono
parents:
diff changeset
34
kono
parents:
diff changeset
35 function Encode
kono
parents:
diff changeset
36 (Item : Wide_Wide_String;
kono
parents:
diff changeset
37 Output_BOM : Boolean := False) return UTF_8_String;
kono
parents:
diff changeset
38 -- Encode Wide_Wide_String using UTF-8 encoding
kono
parents:
diff changeset
39
kono
parents:
diff changeset
40 function Encode
kono
parents:
diff changeset
41 (Item : Wide_Wide_String;
kono
parents:
diff changeset
42 Output_BOM : Boolean := False) return UTF_16_Wide_String;
kono
parents:
diff changeset
43 -- Encode Wide_Wide_String using UTF_16 encoding
kono
parents:
diff changeset
44
kono
parents:
diff changeset
45 -- The decoding routines take a UTF String as input, and return a decoded
kono
parents:
diff changeset
46 -- Wide_String. If the UTF String starts with a BOM that matches the
kono
parents:
diff changeset
47 -- encoding method, it is ignored. An incorrect BOM raises Encoding_Error.
kono
parents:
diff changeset
48
kono
parents:
diff changeset
49 function Decode
kono
parents:
diff changeset
50 (Item : UTF_String;
kono
parents:
diff changeset
51 Input_Scheme : Encoding_Scheme) return Wide_Wide_String;
kono
parents:
diff changeset
52 -- The input is encoded in UTF_8, UTF_16LE or UTF_16BE as specified by the
kono
parents:
diff changeset
53 -- Input_Scheme parameter. It is decoded and returned as a Wide_Wide_String
kono
parents:
diff changeset
54 -- value. Note: a convenient form for Scheme may be Encoding (UTF_String).
kono
parents:
diff changeset
55
kono
parents:
diff changeset
56 function Decode
kono
parents:
diff changeset
57 (Item : UTF_8_String) return Wide_Wide_String;
kono
parents:
diff changeset
58 -- The input is encoded in UTF-8 and returned as a Wide_Wide_String value
kono
parents:
diff changeset
59
kono
parents:
diff changeset
60 function Decode
kono
parents:
diff changeset
61 (Item : UTF_16_Wide_String) return Wide_Wide_String;
kono
parents:
diff changeset
62 -- The input is encoded in UTF-16 and returned as a Wide_String value
kono
parents:
diff changeset
63
kono
parents:
diff changeset
64 end Ada.Strings.UTF_Encoding.Wide_Wide_Strings;