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 package provides the abstract class Attribute :
- -- this class is the common superclass of all Java Attribute classes.
- --
- -- 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 CP;
-
- package Attribute is
-
- -- Abstract type of Attributes
- ------------------------------
- type Attribute is abstract tagged private;
-
- -- Access to Attribute
- ----------------------
- type Acc_Attribute is access all Attribute'Class;
-
- -- Array of Attributes
- ----------------------
- type Attributes is array (Unsigned_16 range <>) of Acc_Attribute;
-
- -- Access to array of Attributes
- --------------------------------
- type Acc_Attributes is access Attributes;
-
- -- Raised when an unknown kind of Attribute is read
- ---------------------------------------------------
- E_Unknown_Attribute : exception;
-
- -- Read an Attribute from a file
- -- (Includes a call to Decode)
- -- may raise E_Unknown_Attribute
- --------------------------------
- function Read_Attribute
- (From_File : Byte_Utilities.File_Type;
- Context : CP.Acc_CP_Infos)
- return Acc_Attribute;
-
- -- Decode informations of an attribute from a file
- -- this procedure must be overwritten by subclasses
- ---------------------------------------------------
- procedure Decode (This : access Attribute;
- From_File : in Byte_Utilities.File_Type;
- Context : in CP.Acc_CP_Infos) is abstract;
-
- -- Display an Attribute
- -- this procedure must be overwritten by subclasses
- ---------------------------------------------------
- procedure Display (This : access Attribute;
- Context : in CP.Acc_CP_Infos) is abstract;
-
-
- private
-
- -- All Attributes share these two instance variables
- ----------------------------------------------------
- type Attribute is abstract tagged
- record
- Name : Unsigned_16;
- Length : Unsigned_32;
- end record;
-
- end Attribute;
-