home *** CD-ROM | disk | FTP | other *** search
- --
- -- Copyright (C) 1996 Ada Resource Association (ARA), Columbus, Ohio.
- -- Author: Gilles Demailly
- --
- --
- -- Permission to use, copy, modify, and distribute this software and its
- -- documentation for any purpose and without fee is hereby granted,
- -- provided that the above copyright and authorship notice appear in all
- -- copies and that both that copyright notice and this permission notice
- -- appear in supporting documentation.
- --
- -- The ARA makes no representations about the suitability of this software
- -- for any purpose. It is provided "as is" without express
- -- or implied warranty.
- --
-
- -- This child package provides the class Classes :
- -- a constant pool Utf8 information is used to represent a String
- -- coded with a kind-of Utf8 Standard.
- --
- -- For more information about Java Class file format check :
- -- The Java Virtual Machine Specification
- -- (Release 1.0 Beta - Draft - August 21, 1995)
-
- with Basic_Definitions;
- use Basic_Definitions;
-
- with Byte_Utilities;
-
- with Ada.Strings.Wide_Unbounded;
-
- package CP.Utf8 is
-
- -- the class Tag value in Java files
- ------------------------------------
- C_Class_Tag : constant Unsigned_8 := 1;
-
- type Utf8 is new CP_Info with private;
-
- type Acc_Utf8 is access all Utf8'Class;
-
- -- Decode a Constant Pool information
- -------------------------------------
- procedure Decode (From_File : Byte_Utilities.File_Type;
- Some_Info : access Utf8);
-
- -- Display a Constant Pool information
- --------------------------------------
- procedure Display (Some_Info : access Utf8;
- Context : in Acc_CP_Infos);
-
- --
- -- Differents Constant Pool information to string conversion functions
- --
-
- function As_String
- (Some_Info : access Utf8) return Wide_String;
-
- function Print_String
- (Some_Info : access Utf8;
- Context : in Acc_CP_Infos) return String;
-
- function Java_Decoded_String
- (Some_Info : access Utf8;
- Context : Acc_CP_Infos;
- Purpose : Decoding_Purpose) return String;
-
- private
-
- -- the Utf8 String is first coded as an array of Bytes and
- -- then decoded to an Ada Wide_String
- ----------------------------------------------------------
- type Utf8 is new CP_Info with
- record
- Length : Unsigned_16;
- bytes : Byte_Utilities.Acc_Bytes;
- Contents : Ada.Strings.Wide_Unbounded.Unbounded_Wide_String;
- end record;
-
- end CP.Utf8;
-