#ifndef _NSREA_ // -*-c++-*-
#define _NSREA_

//----------------------------------------------------------------------
//  nsrEA.h
//   Extended Attribute Descriptors
//
//      Unpublished Confidential Information of Hewlett-Packard
//      Company. Do not disclose.  Copyright (c) Hewlett-Packard
//      Company 1995. All rights reserved
// 
// The contents of this software are proprietary and confidential to
// the Hewlett- Packard Company, and are limited in distribution to
// those with a direct need to know.  Individuals having access to
// this software are responsible for maintaining the confidentiality
// of the content and for keeping the software secure when not in use.
// Transfer to any party is strictly forbidden other than as expressly
// permitted in writing by Hewlett-Packard Company.  Unauthorized
// transfer to or possession by any unauthorized party may be a
// criminal offense.
//
//                  RESTRICTED RIGHTS LEGEND
//
//      Use,  duplication,  or disclosure by the U. S. Government is
//      subject to restrictions as set forth in subparagraph (c) (1)
//      (ii) in the Rights in Technical Data and Computer Software
//      clause in DFARS 252.227-7013 or any other successor clause.
//
//                      HEWLETT-PACKARD COMPANY
//                      3000 Hanover St.
//                      Palo Alto, CA  94304 U.S.A.
//
//      Rights for non-DOD U.S. Government Departments and Agencies
//      are as set forth in FAR 52.227-19 (c) (1,2) or any other
//      successor clause.
//
//  CLASSES:
//   ExtendedAttrHeaderDesc
//  PREFIX CLASSES
//   EAPrefix
//   ImplEAPrefix
//   UDFEAPrefix
//   ApplEAPrefix
//  ISO EXTENDED ATTRIBUTES
//   CharSetInfoEA
//   AlternatePermsEA
//   FileTimesEA
//   InfoTimesEA
//   DeviceSpecEA
//   ImplementUseEA
//   ApplicationUseEA
//  UDF EXTENDED ATTRIBUTES
//   FreeEASpaceEA
//   OS2FullEA
//   OS2FEATable
//   OS2EA
//   OS2EALengthEA
//   MacVolumeInfoEA
//   MacPoint
//   MacRect
//   MacDInfo
//   MacDXInfo
//   MacFInfo
//   MacFXInfo
//   MacDirFinderInfoEA
//   MacFileFinderInfoEA
//   SmallAD
//   MacUniqueIDTableEA
//   MacResourceForkEA
//  HP EXTENDED ATTRIBUTES
//   NovellAttrFlags
//   NovellAttrEA
//   NovellRights
//   NovellRightsAssign
//   NovellRightsTable
//   NovellTrusteeEA
//   ICBTableEA
//  EXTENDED ATTRIBUTES UTILITY CLASSES
//   EAInspector
//   SearchEA
//  
//----------------------------------------------------------------------
// $Source: /projects/HMS/nsr/udfCore/descr/nsrEA.h,v $
// $Revision: 1.27 $    $Author: hmgr $
// $State: Exp $        $Locker:  $
// $Date: 96/05/21 23:26:44 $
//

// These are FIXED by the UDF document, and may not be altered. For
// their values, see the .cpp file.

static String UDFFreeEASpaceID      ;
static String UDFOS2ID              ;
static String UDFOS2EALengthID      ;
static String UDFMacVolumeInfoID    ;
static String UDFMacFinderInfoID    ;
static String UDFMacUniqueIDTableID ;
static String UDFMacResourceForkID  ;

static String HPNovellAttrID        ;
static String HPNovellTrusteeID     ;

static String HPEarlyICBTableID     ;

//----------------------------------------------------------------------
// CLASS: ExtendedAttrHeaderDesc     --DVM
//
//  Descriptor for the header of an EA Space.
//
// PUBLIC METHODS:
// 
//  implAttrLocation()  - Gets/sets implAttrLocation field.
//  applAttrLocation()  - Gets/sets applAttrLocation field.
//  operator!=()        - Returns False if equal to another EAHD.
// 
// USAGE NOTES:
//  Usable as any other TaggedDescriptor.
// 
//----------------------------------------------------------------------
// COLLABORATORS:  
//  Derived from TaggedDescriptor.
//
// PRIVATE METHODS:
//  bodyVerifyISO()
//  bodyError()
//  bodyClear()
//  bodyInit()
//  bodyToISO()
//  bodyFromISO()
//
// IMPLEMENTATION NOTES:
//  Internal Notes go here (special cases, algorithm issues, etc.)
//
//----------------------------------------------------------------------
class ExtendedAttrHeaderDesc : public TaggedDescriptor {

    Uint32 implAttrLocation_ ;
    Uint32 applAttrLocation_ ;

  public:

    ExtendedAttrHeaderDesc() ;

    UINT32 implAttrLocation() const { return implAttrLocation_; }
    void implAttrLocation( const UINT32 l ) { implAttrLocation_ = l; }

    UINT32 applAttrLocation() const { return applAttrLocation_; }
    void applAttrLocation( const UINT32 l ) { applAttrLocation_ = l; }

#ifdef NSR_VERIFY
    Boolean operator != ( const ExtendedAttrHeaderDesc & obj ) const ;
#endif

  protected:

#ifdef NSR_VERIFY
    Error bodyVerifyISO( CONST_BYTE_PTR rbp ) ;
#endif
    Error bodyError() const { return Error(error_None); }
    void bodyClear() ;
    void bodyInit() {}        
    void bodyToISO( BYTE_PTR rbp ) ;
    void bodyFromISO( CONST_BYTE_PTR rbp ) ;

};

//----------------------------------------------------------------------
// ENUM: EAType
//
//  These are the different classifications of individual EAs.
//
// DEFINITIONS:
//  ea_CharSetInfo    - The ISO-defined EA for Character set information.
//  ea_AlternatePerms - The ISO-defined EA for Alternate Permissions..
//  ea_FileTimes      - The ISO-defined EA for File times.
//  ea_InfoTimes      - The ISO-defined EA for Information times.
//  ea_DeviceSpec     - The ISO-defined EA for Device specification.
//  ea_ImplementUse   - The ISO-defined EA classification.
//  ea_ApplicationUse - The ISO-defined EA classification.
//  ea_Unknown        - Not recognized.
//
// USES:
//  Each EA MUST fall into one of these categories. The category
//  numbers are defined by the ISO specification. These values are
//  used in the attribute Type field of the EAPrefix.
//
// NOTES:
//
//----------------------------------------------------------------------
// Private comments go here - will not be extracted into HTML.
//----------------------------------------------------------------------
enum EAType {
    ea_CharSetInfo    = 1,
    ea_AlternatePerms = 3,
    ea_FileTimes      = 5,
    ea_InfoTimes      = 6,
    ea_DeviceSpec     = 12,
    ea_ImplementUse   = 2048,
    ea_ApplicationUse = 65536,
    ea_Unknown        = -1
};

//----------------------------------------------------------------------
// CLASS: EAPrefix     --DVM
//
//  This is the descriptor structure which is shared by all EAs. It
//  goes at the beginning of each EA. It works just like the other
//  Fields.
//
// PUBLIC METHODS:
//  EAPrefix()      - Constructor requires an offset into the
//                    enclosing structure. 
//  operator!=()    - False if equal
//  attrType()      - Gets/sets the value of the attrType field.
//  attrSubtype()   - Gets the value of the attrSubtype field.
//  attrType()      - Getter/setter
//  attrLen()       - Getter/setter
//  void clear()    - Clears out all fields except for attrType
//  void toISO()    - Copies contents to supplied byte pointer
//  void fromISO()  - Initializes contents from byte pointer
//  checkValidity() - Checks reasonableness of fields.
//
// USAGE NOTES:
//  User notes go here.
// 
//----------------------------------------------------------------------
// COLLABORATORS:  
//  Contains a FieldInfo structure.
//
// PRIVATE METHODS:
//
// IMPLEMENTATION NOTES:
//  The terminology, "header" was more attractive, but already taken
//  by the EA Space header.
//
//----------------------------------------------------------------------
class EAPrefix {

  public:
    FieldInfo field_       ;
  protected:
    Uint32    attrType_    ;
    Uint8     attrSubtype_ ;
    ZeroBytes reserved_    ;
    Uint32    attrLen_     ;

    void init();
    
  public:
    EAPrefix( UINT16 o ) ;

#ifdef NSR_VERIFY
    Boolean operator != ( const EAPrefix  & obj ) const ;
#endif

    void   attrType( EAType eat );
    EAType attrType( void ) const ;

    UINT8 attrSubtype( void ) const { return attrSubtype_; }

    void   attrLen( UINT32 len) { attrLen_ = len; }
    UINT32 attrLen( void ) const { return attrLen_; }

    void clear( void ) ;
    void toISO( BYTE_PTR rbp ) ;
    void fromISO( CONST_BYTE_PTR rbp ) ;
    Error checkValidity() const;
};

//----------------------------------------------------------------------
// CLASS: ImplEAPrefix     --DVM
//
//  First part of Implementation Use Extended Attributes.
//
// PUBLIC METHODS:
//  ImplEAPrefix()  - Constructor requires an offset into enclosing
//                    structure.
//  operator!=()    - False if equal
//  attrType()      - Gets the value of the attrType field.
//  attrSubtype()   - Gets the value of the attrSubtype field.
//  id()            - getter/setter
//  attrLen()       - getter/setter
//  implUseLen()    - getter/setter
//  void clear()    - Clears out all fields except for attrType
//  void toISO()    - Copies contents to supplied byte pointer
//  void fromISO()  - Initializes contents from byte pointer
//  checkValidity() - Checks reasonableness of fields.
//  error()         - Returns error if any field in error.
//
// USAGE NOTES:
//  User notes go here.
// 
//----------------------------------------------------------------------
// COLLABORATORS:  
//  Contains a FieldInfo.
//  Contains an EAPrefix.
//
// PRIVATE METHODS:
//  init()          - Initializes all members to default
//
// IMPLEMENTATION NOTES:
//  The terminology, "header" was more attractive, but already taken
//  by the EA Space header.
//
//----------------------------------------------------------------------
class ImplEAPrefix {

  public:
    FieldInfo field_;
  protected:
    EAPrefix  prefix_     ;
    Uint32    implUseLen_ ;
    ImplRegID implID_     ;     // if UDF-defined, uses OSTARegID.
    
    void init();

  public:

    ImplEAPrefix( UINT16 o = 0 );

#ifdef NSR_VERIFY
    Boolean operator != ( const ImplEAPrefix  & obj ) const ;
#endif

    EAType attrType( void ) const { return prefix_.attrType(); }
    UINT8  attrSubtype( void ) const { return prefix_.attrSubtype(); }

    String id() const { return implID_.id(); }

    void attrLen(const UINT32 len) { prefix_.attrLen(len); }
    UINT32 attrLen() const { return prefix_.attrLen(); }

    void implUseLen(const UINT32 len) { implUseLen_=len; }
    UINT32 implUseLen() const { return implUseLen_; }

    void clear() ;
    void toISO( BYTE_PTR rbp ) ;
    void fromISO( CONST_BYTE_PTR rbp ) ;
    Error checkValidity() const;
    Error error() const { return implID_.error(); }

};

//----------------------------------------------------------------------
// CLASS: UDFEAPrefix     --DVM
//
//  The first part of all UDF-defined Implementation Use Extended
//  Attributes.
//
// PUBLIC METHODS:
//  UDFEAPrefix()   - Constructor needs an offset into the enclosing
//                    structure. 
//  operator!=()    - Returns False if equal.
//  attrType()      - Gets the value of the attrType field.
//  attrSubtype()   - Gets the value of the attrSubtype field.
//  id()            - setter/getter
//  attrLen()       - setter/getter
//  implUseLen()    - setter/getter
//  void clear()    - Clears out all fields except for attrType
//  void toISO()    - Copies contents to supplied byte pointer
//  void fromISO()  - Initializes contents from byte pointer
//  checkValidity() - Checks reasonableness of fields.
//  error()         - Returns error if any field in error.
//
// USAGE NOTES:
//  User notes go here.
// 
//----------------------------------------------------------------------
// COLLABORATORS:  
//  Contains a FieldInfo.
//  Contains an ImplEAPrefix
//
// PRIVATE METHODS:
//  init()          - Initializes all members to default
//  checksum()      - Returns the checksum on the appropriate number
//                    of bytes at the supplied byte location.
//
// IMPLEMENTATION NOTES:
//  The terminology, "header" was more attractive, but already taken
//  by the EA Space header.
//
//----------------------------------------------------------------------
class UDFEAPrefix {

  public:
    FieldInfo field_;
  protected:
    EAPrefix      prefix_     ;
    Uint32        implUseLen_ ;
    OSTARegID     implID_     ;
    Uint16        checksum_   ;

    void init();
    UINT16 checksum( CONST_BYTE_PTR rbp ) const;

  public:

    UDFEAPrefix( UINT16 o ) ;

#ifdef NSR_VERIFY
    Boolean operator != ( const UDFEAPrefix  & obj ) const ;
#endif

    EAType attrType( void ) const { return prefix_.attrType(); }
    UINT8  attrSubtype( void ) const { return prefix_.attrSubtype(); }

    String id() const { return implID_.id(); }
    void id(const String & iuid) { implID_.id(iuid); }

    void attrLen(const UINT32 len) { prefix_.attrLen(len); }
    UINT32 attrLen() const { return prefix_.attrLen(); }

    void implUseLen(const UINT32 len) { implUseLen_=len; }
    UINT32 implUseLen() const { return implUseLen_; }

    void clear() ;
    void toISO( BYTE_PTR rbp ) ;
    void fromISO( CONST_BYTE_PTR rbp ) ;
    Error checkValidity( CONST_BYTE_PTR rbp ) const;
    Error error() const { return implID_.error(); }

};

//----------------------------------------------------------------------
// CLASS: ApplEAPrefix     --DVM
//
//  This holds the information which goes at the beginning of all
//  Application Use Extended Attributes.
//
// PUBLIC METHODS:
//  attrType()      - Gets the value of the attrType field.
//  attrSubtype()   - Gets the value of the attrSubtype field.
//
// USAGE NOTES:
//  This is currently not implemented.
// 
//----------------------------------------------------------------------
// COLLABORATORS:  
//  <collaborating_class> (e.g., OWNS: and/or USES:)
//
// PRIVATE METHODS:
//  methodName()
//      Description_of_method
//
// IMPLEMENTATION NOTES:
//  Internal Notes go here (special cases, algorithm issues, etc.)
//
//----------------------------------------------------------------------
class ApplEAPrefix {

  public:
    FieldInfo field;
  protected:
    EAPrefix  prefix_     ;
    Uint32    applUseLen_ ;
    ImplRegID applID_     ;
    
  public:
    ApplEAPrefix( UINT16 o = 0 );

    EAType attrType( void ) const { return prefix_.attrType(); }
    UINT8  attrSubtype( void ) const { return prefix_.attrSubtype(); }

};

//----------------------------------------------------------------------
// Now, the ISO-defined EAs.
//----------------------------------------------------------------------

//----------------------------------------------------------------------
// CLASS: CharSetInfoEA     --DVM
//
//  This is the Character Set Information Extended Attribute.
//
// PUBLIC METHODS:
//  fixedLen()   - This returns the length in bytes of the portion of
//                 the Extended Attribute which cannot change in
//                 length. See the EAInspector object (the chief user
//                 of this method) for details.
//
// USAGE NOTES:
//  This is currently unimplemented, except for the fixedLen() method..
// 
//----------------------------------------------------------------------
// COLLABORATORS:  
//  Contains an EAPrefix field.
//  Contains an Bytes field.
//
// PRIVATE METHODS:
//
// IMPLEMENTATION NOTES:
//  Internal Notes go here (special cases, algorithm issues, etc.)
//
//----------------------------------------------------------------------
class CharSetInfoEA
{
    EAPrefix   prefix_       ;
    Uint32     escSeqLen_    ;
    Uint8      charSetType_  ;
    Bytes      escSequences_ ;
    
    static const UINT16 fixedLen_ ;

  public:

    CharSetInfoEA();

    static UINT16 fixedLen( void ) { return fixedLen_; }

};

//----------------------------------------------------------------------
// CLASS: AlternatePermsEA     --DVM
//
//  This is the Alternate Permissions Extended Attribute.
//
// PUBLIC METHODS:
//  fixedLen()   - This returns the length in bytes of the portion of
//                 the Extended Attribute which cannot change in
//                 length. See the EAInspector object (the chief user
//                 of this method) for details.
//
// USAGE NOTES:
//  This is currently unimplemented, except for the fixedLen() method..
// 
//----------------------------------------------------------------------
// COLLABORATORS:  
//  Contains an EAPrefix field.
//  Contains an Bytes field.
//
// PRIVATE METHODS:
//
// IMPLEMENTATION NOTES:
//  Internal Notes go here (special cases, algorithm issues, etc.)
//
//----------------------------------------------------------------------
class AlternatePermsEA
{
    EAPrefix     prefix_     ;
    Uint16       ownerID_    ;
    Uint16       groupID_    ;
    Uint16       permission_ ;

    static const UINT16 fixedLen_ ;

  public:

    AlternatePermsEA();

    static UINT16 fixedLen( void ) { return fixedLen_; }

};

//----------------------------------------------------------------------
// CLASS: FileTimesEA     --DVM
//
//  The ISO-defined FileTimes Extended Attribute.
//
//  This currently ONLY supports the UDF subset, which means it always
//  holds only the creation time.
//
// PUBLIC METHODS:
//  fileCreation() - Gets or sets the File Creation time.
//  fixedLen()     - This returns the length in bytes of the portion
//                   of the Extended Attribute which cannot change in 
//                   length. See the EAInspector object (the chief
//                   user of this method) for details.
//  error()        - Returns any state errors. Should be called after
//                   construction and after any fromISO() or toISO().
//  attrType()     - Returns the value of the attrType field.
//  attrSubtype()  - Returns the value of the attrSubtype field.
//  attrID()       - Returns the String identifying the Attr.
//  minAttrLen()   - Returns the minimum size the EA may be set to.
//  attrLen()      - Gets or sets the EA to the supplied length. If
//                   the new value is too short or disallowed for some
//                   reason, it returns an error indicating that.
//  clear()        - Sets the state to the exact same as right after 
//                   construction. All fields are initialized to
//                   defaults and/or zeroes.
//  toISO()        - Translates the structure to its ISO
//                   representation at the supplied byte pointer.
//  fromISO()      - Translates the structure from its ISO
//                   representation at the supplied byte pointer.
//
// USAGE NOTES:
//  User notes go here.
// 
//----------------------------------------------------------------------
// COLLABORATORS:  
//  Contains an EAPrefix field.
//  Contains Uint32 fields.
//  Contains a TimeStamp field.
//
// PRIVATE METHODS:
//  init()
//    Initializes all non-zero fields. Used by clear() and the
//    constructor.
//
// IMPLEMENTATION NOTES:
//  Internal Notes go here (special cases, algorithm issues, etc.)
//
//----------------------------------------------------------------------
class FileTimesEA
{
    EAPrefix  prefix_            ;
    Uint32    dataLen_           ;
    Uint32    fileTimeExistence_ ;
    TimeStamp fileCreation_      ;

    static const UINT16 fixedLen_ ;

    void init(void);

  public:

    FileTimesEA( void );

    static UINT16 fixedLen( void ) { return fixedLen_; }

    time_t fileCreation(void) { return (time_t)fileCreation_; }
    void   fileCreation(time_t t) { fileCreation_ = t; }

    UINT32 dataLen() const {           //***  need this in Read_FileTimesEA
        return dataLen_;
    }
    UINT32 fileTimeExistence() const { //*** need this in Read_FileTimesEA
        return fileTimeExistence_;
    }
    UINT32 ISOLen() const {            //*** need this in Write_FileTimesEA
        return fileCreation_.field.after();
    }
    UINT32 offsetToData() const {      //*** need this in Write_FileTimesEA
        return prefix_.field_.after();
    }

    Error error(void) const ;

    UINT32 attrType() const { return prefix_.attrType(); }
    UINT8  attrSubtype() const { return prefix_.attrSubtype(); }
    String attrID() const { return String(""); }

    UINT32 minAttrLen(void) const ;

    void attrLen( UINT32 len, Error & err ) ;
    UINT32 attrLen(void) const ;

    void clear( void ) ;
    void toISO( BYTE_PTR rbp );
    void fromISO( CONST_BYTE_PTR rbp );

#ifdef NSR_VERIFY
    Boolean operator != ( const FileTimesEA & obj ) const ;
    Error verifyISO( CONST_BYTE_PTR rbp ) const;
#endif

};

//----------------------------------------------------------------------
// CLASS: InfoTimesEA     --DVM
//
//  This is the Information Times Extended Attribute.
//
// PUBLIC METHODS:
//  fixedLen()   - This returns the length in bytes of the portion of
//                 the Extended Attribute which cannot change in
//                 length. See the EAInspector object (the chief user
//                 of this method) for details.
//
// USAGE NOTES:
//  This is currently unimplemented, except for the fixedLen() method..
// 
//----------------------------------------------------------------------
// COLLABORATORS:  
//  Contains an EAPrefix field.
//  Contains Uint32 fields.
//  Contains an Bytes field.
//
// PRIVATE METHODS:
//
// IMPLEMENTATION NOTES:
//  Internal Notes go here (special cases, algorithm issues, etc.)
//
//----------------------------------------------------------------------
class InfoTimesEA
{
    EAPrefix     prefix_            ;
    Uint32       dataLen_           ;         
    Uint32       infoTimeExistence_ ;
    Bytes        InfoTimes_         ;
    
    static const UINT16 fixedLen_ ;

  public:

    InfoTimesEA();

    static UINT16 fixedLen( void ) { return fixedLen_; }

};

//----------------------------------------------------------------------
// CLASS: DeviceSpecEA     --DVM
//
//  This is the Device Specification Extended Attribute.
//
// PUBLIC METHODS:
//  fixedLen()   - This returns the length in bytes of the portion of
//                 the Extended Attribute which cannot change in
//                 length. See the EAInspector object (the chief user
//                 of this method) for details.
//
// USAGE NOTES:
//  This is currently unimplemented, except for the fixedLen() method..
// 
//----------------------------------------------------------------------
// COLLABORATORS:  
//  Contains an EAPrefix field.
//  Contains an Bytes field.
//
// PRIVATE METHODS:
//
// IMPLEMENTATION NOTES:
//  Internal Notes go here (special cases, algorithm issues, etc.)
//
//----------------------------------------------------------------------
class DeviceSpecEA
{
    EAPrefix   prefix_        ;
    Uint32     implUseLen_    ;
    Uint32     majorDeviceId_ ;
    Uint32     minorDeviceId_ ;
    Bytes      implementUse_  ;
    
    static const UINT16 fixedLen_ ;

  public:

    DeviceSpecEA();

    static UINT16 fixedLen( void ) { return fixedLen_; }

};

//----------------------------------------------------------------------
// CLASS: ImplementUseEA     --DVM
//
//  This may be used as a general-purpose Implementation Use EA.
//
// PUBLIC METHODS:
//  fixedLen()   - This returns the length in bytes of the portion of
//                 the Extended Attribute which cannot change in
//                 length. See the EAInspector object (the chief user
//                 of this method) for details.
//
// USAGE NOTES:
//  This is currently unimplemented, except for the fixedLen() method..
// 
//----------------------------------------------------------------------
// COLLABORATORS:  
//  Contains an ApplEAPrefix field.
//  Contains an Bytes field.
//
// PRIVATE METHODS:
//
// IMPLEMENTATION NOTES:
//  Internal Notes go here (special cases, algorithm issues, etc.)
//
//----------------------------------------------------------------------
class ImplementUseEA
{
    ImplEAPrefix prefix_       ;
    Bytes        implementUse_ ;
    
    static const UINT16 fixedLen_ ;

  public:

    ImplementUseEA();

    static UINT16 fixedLen( void ) { return fixedLen_; }

};

//----------------------------------------------------------------------
// CLASS: ApplicationUseEA     --DVM
//
//  This may be used as a general-purpose Application Use EA.
//
// PUBLIC METHODS:
//  fixedLen()   - This returns the length in bytes of the portion of
//                 the Extended Attribute which cannot change in
//                 length. See the EAInspector object (the chief user
//                 of this method) for details.
//
// USAGE NOTES:
//  This is currently unimplemented, except for the fixedLen() method..
// 
//----------------------------------------------------------------------
// COLLABORATORS:  
//  Contains an ApplEAPrefix field.
//  Contains an Bytes field.
//
// PRIVATE METHODS:
//
// IMPLEMENTATION NOTES:
//  Internal Notes go here (special cases, algorithm issues, etc.)
//
//----------------------------------------------------------------------
class ApplicationUseEA
{
    ApplEAPrefix prefix_;
    Bytes        applicationUse_;
    
    static const UINT16 fixedLen_ ;

  public:

    ApplicationUseEA();

    static UINT16 fixedLen( void ) { return fixedLen_; }
};

//----------------------------------------------------------------------
// Now, the UDF-defined EAs.
//----------------------------------------------------------------------

//----------------------------------------------------------------------
// CLASS: FreeSpaceEA     --DVM
//
//  Extended Attribute for UDF Free Space.
//
//  This object ONLY contains a prefix, and has no data. It is used
//  for padding out and/or reserving space in the EA space for future
//  use.
//
// PUBLIC METHODS:
//  FreeSpaceEA() - Constructs one with the supplied attrLen.
//  error()       - Returns any state errors. Should be called after
//                  construction and after any fromISO() or toISO().
//  attrType()    - Returns the value of the attrType field.
//  attrSubtype() - Returns the value of the attrSubtype field.
//  attrID()      - Returns the String identifying the Attr.
//  minAttrLen()  - Returns the minimum size the EA may be set to.
//  attrLen()     - Gets or sets the EA to the supplied length. If
//                  the new value is too short or disallowed for some
//                  reason, it returns an error indicating that.
//  reinit()      - Re-sets the size and state to the same as right
//                  after construction, but without the need to
//                  construct a new one.
//  clear()       - Sets the state to the exact same as right after 
//                  construction. All fields are initialized to
//                  defaults and/or zeroes.
//  toISO()       - Translates the structure to its ISO representation
//                  at the supplied byte pointer.
//  fromISO()     - Translates the structure from its ISO
//                  representation at the supplied byte pointer.
//
//----------------------------------------------------------------------
// COLLABORATORS:  
//  Derived from the UDFEA class.
//  Contains a ZeroBytes field.
//
// PRIVATE METHODS:
//  init()
//    Initializes all data members which should be non-zero after
//    construction and/or clear().
//
// IMPLEMENTATION NOTES:
//  This one's pretty simple...
//
//----------------------------------------------------------------------
class FreeEASpaceEA
{
    UDFEAPrefix  prefix_    ;
    ZeroBytes    freeSpace_ ;

    void init(void);

  public:

    FreeEASpaceEA( UINT32 size );

    Error error(void) const ;

    UINT32 attrType() const { return prefix_.attrType(); }
    UINT8  attrSubtype() const { return prefix_.attrSubtype(); }
    String attrID() const { return UDFFreeEASpaceID; }

    UINT32 minAttrLen(void) const ;

    void attrLen( UINT32 len, Error & err ) ;
    UINT32 attrLen(void) const ;

    void reinit( UINT32 size ) ;
    void clear( void ) ;
    void toISO( BYTE_PTR rbp ) ;
    void fromISO( CONST_BYTE_PTR rbp ) ;

#ifdef NSR_VERIFY
    Boolean operator != ( const FreeEASpaceEA & obj ) const ;
    Error verifyISO( CONST_BYTE_PTR rbp ) const;
#endif

};

#ifdef _INCL_OS2_EATTRS_
//----------------------------------------------------------------------
// Now, the UDF-defined OS/2 EAs.
//----------------------------------------------------------------------

// !!! OS2FullEA not implemented.
class OS2FullEA
{
public:

private:

    Uint8     flags_      ;
    Uint8     lenOfName_  ;
    Uint16    lenOfValue_ ;
    Bytes     name_       ;
    // Bytes     value_      ;
    //!!! This should PROBABLY NOT hold the value, since it may take
    //!!! up WAY TOO MUCH memory.
public:
    OS2FullEA(void) ;
    
#ifdef NSR_VERIFY
    Boolean operator != ( const OS2FullEA  & obj ) const ;
#endif

};

// !!! OS2FEATable not implemented.
class OS2FEATable {
public:

    FieldInfo fieldInfo_  ;

private:
    // This MAY NOT be like the other Table classes, because it has
    // variable-length entries. Thus, accessing it as a table will not
    // work. Instead, it should hold them in a list format, with each
    // one pointing to the next. We should probably use the
    // RWCollectable scheme to collect them in a list.
public:
#ifdef NSR_VERIFY
    Boolean operator != ( const OS2FEATable  & obj ) const ;
#endif
    
};

// !!! OS2EA not implemented.
class OS2EA
{
    UDFEAPrefix  prefix_      ;
    OS2FEATable  os2FEATable_ ;
    void init();

public:

    OS2EA( UINT32 size );

    // May want to hide this, but right now, allowing IT to support
    // all operations directly. NOTE that if it changes, the length of
    // the entire EA needs to be updated. We should follow the lead of
    // the other Table-bearing descriptors
    OS2FEATable & os2FEATable(void) { return os2FEATable_; }

    Error error() const ;

    UINT32 minAttrLen() const ;
    void attrLen( UINT32 len, Error & err ) ;
    UINT32 attrLen() const ;

    void clear( );
    void toISO( BYTE_PTR rbp );
    void fromISO( CONST_BYTE_PTR rbp );

#ifdef NSR_VERIFY
    Boolean operator != ( const OS2EA& obj ) const ;
    Error verifyISO( CONST_BYTE_PTR rbp ) const;
#endif

};

// !!! OS2EA not implemented.
class OS2EALengthEA
{
    UDFEAPrefix prefix_      ;
    Uint32      os2EALength_ ;
    void init(void);

public:

    OS2EALength(void);

    UINT32 os2EALength(void) { return os2EALength_; }
    void os2EALength(UINT32 len) { os2EALength_ = len; }

    Error error() const ;

    UINT32 minAttrLen() const ;
    Error attrLen( UINT32 len ) ;
    UINT32 attrLen() const ;

    void clear( );
    void toISO( BYTE_PTR rbp );
    void fromISO( CONST_BYTE_PTR rbp );

#ifdef NSR_VERIFY
    Boolean operator != ( const OS2EALengthEA & obj ) const ;
    Error verifyISO( CONST_BYTE_PTR rbp ) const;
#endif

};
#endif // _INCL_OS2_EATTRS_

#ifdef _INCL_MAC_EATTRS_
//----------------------------------------------------------------------
// Now, the UDF-defined Mac EAs.
//----------------------------------------------------------------------

//----------------------------------------------------------------------
// CLASS: MacVolumeInfoEA     --DVM
//
//  Extended Attribute for Macintosh Volume Information
//
// PUBLIC METHODS:
//  lastModifyDate()   - Gets or sets appropriate field
//  lastBackupDate()   - Gets or sets appropriate field
//  volumeFinderInfo() - Returns a reference to the Int32Table.
//
//  error()       - Returns any state errors. Should be called after
//                  construction and after any fromISO() or toISO().
//  attrType()    - Returns the value of the attrType field.
//  attrSubtype() - Returns the value of the attrSubtype field.
//  attrID()      - Returns the String identifying the Attr.
//  minAttrLen()  - Returns the minimum size the EA may be set to.
//  attrLen()     - Gets or sets the EA to the supplied length. If
//                  the new value is too short or disallowed for some
//                  reason, it returns an error indicating that.
//  clear()       - Sets the state to the exact same as right after 
//                  construction. All fields are initialized to
//                  defaults and/or zeroes.
//  toISO()       - Translates the structure to its ISO representation
//                  at the supplied byte pointer.
//  fromISO()     - Translates the structure from its ISO
//                  representation at the supplied byte pointer.
//
// USAGE NOTES:
//  Note that dates are passed in and out of the fields via a time_t.
//  Also note that the example below demonstrates how to access the
//  volumeFinderInfo array members:
//
//  for (int i=0; i<8; i++) {
//      printf("vfi[%d]=%d\n",mviea.volumeFinderInfo()[i]);
//  }
// 
//----------------------------------------------------------------------
// COLLABORATORS:  
//  Contains a UDFEAPrefix field.
//  Contains Timestamp fields.
//  Contains an Int32Table field.
//
// PRIVATE METHODS:
//  init()
//    Initializes all data members which should be non-zero after
//    construction and/or clear().
//
// IMPLEMENTATION NOTES:
//  Internal Notes go here (special cases, algorithm issues, etc.)
//
//----------------------------------------------------------------------
class MacVolumeInfoEA 
{
    UDFEAPrefix   prefix_           ;
    TimeStamp     lastModifyDate_   ;
    TimeStamp     lastBackupDate_   ;
    Int32Table    volumeFinderInfo_ ;

private:

    void init(void);

public:

    MacVolumeInfoEA(void);

    time_t lastModifyDate(void) const { return (time_t) lastModifyDate_; }
    void   lastModifyDate( time_t newTime ){ lastModifyDate_ = newTime; }
    
    time_t lastBackupDate(void) const { return (time_t) lastBackupDate_; }
    void   lastBackupDate( time_t newTime ){ lastBackupDate_ = newTime; }

    const Int32Table &volumeFinderInfo(void) const { return volumeFinderInfo_; }
    Int32Table &volumeFinderInfo(void) { return volumeFinderInfo_; }

    UINT32 ISOLen() const {
        return volumeFinderInfo_.field.after();
    }
    UINT32 offsetToData() const {
        return prefix_.field_.after();
    }

    Error error() const ;

    UINT32 attrType() const { return prefix_.attrType(); }
    UINT8  attrSubtype() const { return prefix_.attrSubtype(); }
    String attrID() const { return UDFMacVolumeInfoID; }

    UINT32 minAttrLen() const ;
    void attrLen( UINT32 len, Error & err ) ;
    UINT32 attrLen() const ;

    void clear( );
    void toISO( BYTE_PTR rbp );
    void fromISO( CONST_BYTE_PTR rbp );

#ifdef NSR_VERIFY
    Boolean operator != ( const MacVolumeInfoEA& obj ) const ;
    Error verifyISO( CONST_BYTE_PTR rbp ) const;
#endif
    
};

class MacPoint
{
public:
    FieldInfo     field ;

    Int16         v     ;
    Int16         h     ;

public:
    MacPoint( UINT16 o ) ;
#ifdef NSR_VERIFY
    Boolean operator != ( const MacPoint & obj ) const ;
#endif
    void clear( void ) ;
    void toISO( BYTE_PTR rbp ) ;
    void fromISO( CONST_BYTE_PTR rbp ) ;
};

class MacRect
{
public:
    FieldInfo     field  ;

    Int16         top    ;
    Int16         left   ;
    Int16         bottom ;
    Int16         right  ;

    MacRect( UINT16 o ) ;
#ifdef NSR_VERIFY
    Boolean operator != ( const MacRect & obj ) const ;
#endif
    void clear( void ) ;
    void toISO( BYTE_PTR rbp ) ;
    void fromISO( CONST_BYTE_PTR rbp ) ;
};

class MacDInfo
{
public:
    FieldInfo     field      ;

    MacRect       frRect     ;
    Int16         frFlags    ;
    MacPoint      frLocation ;
    Int16         frView     ;

    MacDInfo( UINT16 o ) ;
#ifdef NSR_VERIFY
    Boolean operator != ( const MacDInfo & obj ) const ;
#endif
    void clear( void ) ;
    void toISO( BYTE_PTR rbp ) ;
    void fromISO( CONST_BYTE_PTR rbp ) ;
};

class MacDXInfo
{
public:
    FieldInfo     field       ;

    MacPoint      frScroll    ;
    Int32         frOpenChain ;
    Int8          frScript    ;
    Int8          frXflags    ;
    Int16         frComment   ;
    Int32         frPutAway   ;

    MacDXInfo( UINT16 o ) ;
#ifdef NSR_VERIFY
    Boolean operator != ( const MacDXInfo & obj ) const ;
#endif
    void clear( void ) ;
    void toISO( BYTE_PTR rbp ) ;
    void fromISO( CONST_BYTE_PTR rbp ) ;
};

class MacFInfo
{
public:
    FieldInfo     field      ;

    Uint32        fdType     ;
    Uint32        fdCreator  ;
    Uint16        fdFlags    ;
    MacPoint      fdLocation ;
    Int16         fdFldr     ;

    MacFInfo( UINT16 o ) ;
#ifdef NSR_VERIFY
    Boolean operator != ( const MacFInfo & obj ) const ;
#endif
    void clear( void ) ;
    void toISO( BYTE_PTR rbp ) ;
    void fromISO( CONST_BYTE_PTR rbp ) ;
};

class MacFXInfo
{
public:
    FieldInfo     field     ;

    Int16         fdIconID  ;
    ZeroBytes     fdUnused  ;
    Int8          fdScript  ;
    Int8          fdXflags  ;
    Int16         fdComment ;
    Int32         fdPutAway ;

    MacFXInfo( UINT16 o ) ;
#ifdef NSR_VERIFY
    Boolean operator != ( const MacFXInfo & obj ) const ;
#endif
    void clear( void ) ;
    void toISO( BYTE_PTR rbp ) ;
    void fromISO( CONST_BYTE_PTR rbp ) ;
};

//----------------------------------------------------------------------
// CLASS: MacDirFinderInfoEA     --DVM
//
//  Extended Attribute for Macintosh Finder information for
//  Directories.
//
// PUBLIC METHODS:
//  parentDirID() - Gets or sets the appropriate field.
//  dirInfo()     - Returns a non-const reference to the appropriate
//                  field.  
//  dirXInfo()    - Returns a non-const reference to the appropriate
//                  field.  
//
//  error()       - Returns any state errors. Should be called after
//                  construction and after any fromISO() or toISO().
//  attrType()    - Returns the value of the attrType field.
//  attrSubtype() - Returns the value of the attrSubtype field.
//  attrID()      - Returns the String identifying the Attr.
//  minAttrLen()  - Returns the minimum size the EA may be set to.
//  attrLen()     - Gets or sets the EA to the supplied length. If
//                  the new value is too short or disallowed for some
//                  reason, it returns an error indicating that.
//  clear()       - Sets the state to the exact same as right after 
//                  construction. All fields are initialized to
//                  defaults and/or zeroes.
//  toISO()       - Translates the structure to its ISO representation
//                  at the supplied byte pointer.
//  fromISO()     - Translates the structure from its ISO
//                  representation at the supplied byte pointer.
//
// USAGE NOTES:
//  User notes go here.
// 
//----------------------------------------------------------------------
// COLLABORATORS:  
//  <collaborating_class> (e.g., OWNS: and/or USES:)
//
// PRIVATE METHODS:
//  methodName()
//      Description_of_method
//
// IMPLEMENTATION NOTES:
//  Internal Notes go here (special cases, algorithm issues, etc.)
//
//----------------------------------------------------------------------
class MacDirFinderInfoEA
{
    UDFEAPrefix   prefix_      ;
    ZeroBytes     pad_         ;
    Uint32        parentDirID_ ;
    MacDInfo      dirInfo_     ;
    MacDXInfo     dirXInfo_    ;

    void init(void);

public:

    MacDirFinderInfoEA(void);

    UINT32 parentDirID(void) const { return parentDirID_; }
    void   parentDirID(UINT32 pdid) { parentDirID_ = pdid; }

    MacDInfo &  dirInfo(void)  { return dirInfo_; }
    MacDXInfo & dirXInfo(void) { return dirXInfo_; }

    UINT32 ISOLen() const {     //*** need this in Write_MacDirFinderInfoEA
        return dirXInfo_.field.after();
    }
    UINT32 offsetToData() const { //*** need this in Write_MacDirFinderInfoEA
        return prefix_.field_.after();
    }

    Error error() const ;

    UINT32 attrType() const { return prefix_.attrType(); }
    UINT8  attrSubtype() const { return prefix_.attrSubtype(); }
    String attrID() const { return UDFMacFinderInfoID; }

    UINT32 minAttrLen() const ;
    void attrLen( UINT32 len, Error & err ) ;
    UINT32 attrLen() const ;

    void clear( );
    void toISO( BYTE_PTR rbp );
    void fromISO( CONST_BYTE_PTR rbp );

#ifdef NSR_VERIFY
    Boolean operator != ( const MacDirFinderInfoEA& obj ) const ;
    Error verifyISO( CONST_BYTE_PTR rbp ) const;
#endif
    
};

//----------------------------------------------------------------------
// CLASS: MacFileFinderInfoEA     --DVM
//
//  Extended Attribute for Macintosh Finder information for files.
//
// PUBLIC METHODS:
//  parentDirID()     - Gets or sets the appropriate field.
//  fileInfo()        - Returns a non-const reference to the
//                      appropriate field. 
//  fileXInfo()       - Returns a non-const reference to the
//                      appropriate field. 
//  resForkDataLen()  - Gets or sets the appropriate field.
//  resForkAllocLen() - Gets or sets the appropriate field.
//
//  error()       - Returns any state errors. Should be called after
//                  construction and after any fromISO() or toISO().
//  attrType()    - Returns the value of the attrType field.
//  attrSubtype() - Returns the value of the attrSubtype field.
//  attrID()      - Returns the String identifying the Attr.
//  minAttrLen()  - Returns the minimum size the EA may be set to.
//  attrLen()     - Gets or sets the EA to the supplied length. If
//                  the new value is too short or disallowed for some
//                  reason, it returns an error indicating that.
//  clear()       - Sets the state to the exact same as right after 
//                  construction. All fields are initialized to
//                  defaults and/or zeroes.
//  toISO()       - Translates the structure to its ISO representation
//                  at the supplied byte pointer.
//  fromISO()     - Translates the structure from its ISO
//                  representation at the supplied byte pointer.
//
// USAGE NOTES:
//  User notes go here.
// 
//----------------------------------------------------------------------
// COLLABORATORS:  
//  <collaborating_class> (e.g., OWNS: and/or USES:)
//
// PRIVATE METHODS:
//  methodName()
//      Description_of_method
//
// IMPLEMENTATION NOTES:
//  Internal Notes go here (special cases, algorithm issues, etc.)
//
//----------------------------------------------------------------------
class MacFileFinderInfoEA
{
    UDFEAPrefix   prefix_          ;
    ZeroBytes     pad_             ;
    Uint32        parentDirID_     ;
    MacFInfo      fileInfo_        ;
    MacFXInfo     fileXInfo_       ;
    Uint32        resForkDataLen_  ;
    Uint32        resForkAllocLen_ ;

    void init(void);

public:

    MacFileFinderInfoEA(void);

    UINT32 parentDirID(void) const { return parentDirID_; }
    void   parentDirID(UINT32 pdid) { parentDirID_ = pdid; }

    MacFInfo &  fileInfo(void)  { return fileInfo_; }
    MacFXInfo & fileXInfo(void) { return fileXInfo_; }

    UINT32 resForkDataLen(void) const { return resForkDataLen_; }
    void   resForkDataLen(UINT32 pdid) { resForkDataLen_ = pdid; }

    UINT32 resForkAllocLen(void) const { return resForkAllocLen_; }
    void   resForkAllocLen(UINT32 pdid) { resForkAllocLen_ = pdid; }

    UINT32 ISOLen() const {     //*** need this in Write_MacFileFinderInfoEA
        return resForkAllocLen_.field.after();
    }
    UINT32 offsetToData() const { //*** need this in Write_MacFileFinderEA
        return prefix_.field_.after();
    }

    Error error() const ;

    UINT32 attrType() const { return prefix_.attrType(); }
    UINT8  attrSubtype() const { return prefix_.attrSubtype(); }
    String attrID() const { return UDFMacFinderInfoID; }

    UINT32 minAttrLen() const ;
    void attrLen( UINT32 len, Error & err ) ;
    UINT32 attrLen() const ;

    void clear( );
    void toISO( BYTE_PTR rbp );
    void fromISO( CONST_BYTE_PTR rbp );

#ifdef NSR_VERIFY
    Boolean operator != ( const MacFileFinderInfoEA& obj ) const ;
    Error verifyISO( CONST_BYTE_PTR rbp ) const;
#endif
    
};

class SmallAD 
{
    // No need for fieldInfo -- only goes into table.
    // So, offer a static function to get its length.
    Uint16           extLength_   ;
    LogicalBlockAddr extLocation_ ;
public:

    static UINT16 fieldLen(void) { return 8; } 

    SmallAD( void ) ;

    UINT16 extLength(void)  const { return extLength_; }
    void extLength( UINT16 el)    { extLength_ = el; }

    UINT32 logBlockNo()     const { return extLocation_.logicalBlockNo; }
    void logBlockNo( UINT32 lbn ) { extLocation_.logicalBlockNo = lbn;  }

    UINT16 partRefNo()      const { return extLocation_.partitionRefNo; }
    void partRefNo( UINT16 prn )  { extLocation_.partitionRefNo = prn;  }

#ifdef _INCL_SSOBJS_
    void toLogExtent(LogicalVolume * lvp,
                     LogExtent& le, 
                     Error& err) const;

    void fromLogExtent(const LogExtent & le,
                       Error & err);
#endif // _INCL_SSOBJS_

#ifdef NSR_VERIFY
    Boolean operator != ( const SmallAD & obj ) const ;
#endif
    void clear( void ) ;
    void toISO( BYTE_PTR rbp ) ;
    void fromISO( CONST_BYTE_PTR rbp ) ;
};

//----------------------------------------------------------------------
// CLASS: MacUniqueIDTableEA     --DVM
//
//  Extended Attribute for Macintosh Unique ID Table
//
//  This class does NOT read in or write out ANY table entries, but
//  rather offers a method to calculate the offset from the beginning
//  of the EA to the supplied UniqueID entry. This is because the
//  table may be huge. Consequently, users should do a fromISO() on
//  this, then call its offsetToID() method, make sure they read into
//  memory the appropriate piece of the EA, and then perform a
//  SmallAD::fromISO() followed by a SmallAD::toLogExtent(). The
//  LogExtent is the table entry for the supplied UID.
//
// PUBLIC METHODS:
//  offsetToUID() - Returns the byte offset from the beginning of the
//                  EA to the supplied UniqueID's table entry, which
//                  holds a SmallAD defining where the UID's FileEntry
//                  resides.
//  numUIDMaps()  - Gets and sets the number of UID Map Table
//                  Entries. If the numUIDMaps cannot fit into the
//                  current attrLen, minAttrLen is changed to fit the
//                  required number of table entries, and attrLen is
//                  grown and set to the new minAttrLen. If the number
//                  is shrunk, minAttrLen changes, but attrLen stays the
//                  same.
//  error()       - Returns any state errors. Should be called after
//                  construction and after any fromISO() or toISO().
//  attrType()    - Returns the value of the attrType field.
//  attrSubtype() - Returns the value of the attrSubtype field.
//  attrID()      - Returns the String identifying the Attr.
//  minAttrLen()  - Returns the minimum size the EA may be set to.
//  attrLen()     - Gets or sets the EA to the supplied length. If
//                  the new value is too short or disallowed for some
//                  reason, it returns an error indicating that.
//  clear()       - Sets the state to the exact same as right after 
//                  construction. All fields are initialized to
//                  defaults and/or zeroes. NOTE that the numUIDMaps
//                  is not changed, but the attrLen is set to the
//                  minimum.
//  toISO()       - Translates the structure to its ISO representation
//                  at the supplied byte pointer.
//  fromISO()     - Translates the structure from its ISO
//                  representation at the supplied byte pointer.
//
// USAGE NOTES:
//  User notes go here.
// 
//----------------------------------------------------------------------
// COLLABORATORS:  
//  Contains a UDFEAPrefix field.
//  Contains a ZeroBytes field.
//  Contains a Uint32 field.
//
// PRIVATE METHODS:
//  init()
//    Initializes the non-zero fields to their appropriate values.
//
// IMPLEMENTATION NOTES:
//
//----------------------------------------------------------------------
class MacUniqueIDTableEA
{
    UDFEAPrefix  prefix_     ;
    ZeroBytes    reserved_   ;
    Uint32       numUIDMaps_ ;

    void init( UINT32 nuidm );

public:

    MacUniqueIDTableEA( UINT32 nuidm );

    // NOTE see UDF 1.01 3.3.4.5.4.3 for how UID and MacDFID are related.
    UINT32 offsetToUID(UINT32 uid) const
    {
        return (numUIDMaps_.field.after() +
                SmallAD::fieldLen() * uid);
    }

    void numUIDMaps(UINT32 n) ; // somewhat tricky - placed in .cpp
    UINT32 numUIDMaps(void) const { return numUIDMaps_ ; }
    
    Error error(void) const ;

    UINT32 attrType() const { return prefix_.attrType(); }
    UINT8  attrSubtype() const { return prefix_.attrSubtype(); }
    String attrID() const { return UDFMacUniqueIDTableID; }

    UINT32 minAttrLen(void) const ;
    void attrLen( UINT32 len, Error & err ) ;
    UINT32 attrLen(void) const ;

    void clear( void );
    void toISO( BYTE_PTR rbp );
    void fromISO( CONST_BYTE_PTR rbp );

#ifdef NSR_VERIFY
    Boolean operator != ( const MacUniqueIDTableEA& obj ) const ;
    Error verifyISO( CONST_BYTE_PTR rbp ) const;
#endif
    
};

//----------------------------------------------------------------------
// CLASS: MacResourceForkEA     --DVM
//
//  Extended Attribute for the Macintosh Resource Fork
//  
//  This class does NOT read in or write out any of the Resource Fork
//  data. Rather,it offers a method to calculate the offset from the
//  beginning of the EA to the beginning of the Resource Fork
//  Data. This should be used to adjust read and write offsets into
//  the Resource fork data before going to the data itself.
//
// PUBLIC METHODS:
//  offsetToData() - Returns the offset in bytes from the beginning of 
//                   the EA to the beginning of the Resource Fork
//                   Data.
//  error()        - Returns any state errors. Should be called after
//                   construction and after any fromISO() or toISO().
//  dataLen()      - Sets or gets the length of the Resource Fork
//                   Data. If it causes the attrLen to be too small,
//                   it is set to the minAttrLen for the new
//                   dataLen. If dataLen() is reduced, the attrLen()
//                   is left unchanged.
//  attrType()     - Returns the value of the attrType field.
//  attrSubtype()  - Returns the value of the attrSubtype field.
//  attrID()       - Returns the String identifying the Attr.
//  minAttrLen()   - Returns the minimum size the EA may be set to.
//  attrLen()      - Gets or sets the EA to the supplied length. If
//                   the new value is too short or disallowed for some
//                   reason, it returns an error indicating that.
//  clear()        - Sets the state to the exact same as right after 
//                   construction. All fields are initialized to
//                   defaults and/or zeroes. Note that the size of the
//                   resourceFork is not changed, but the attrLen is
//                   set to the minAttrLen.
//  toISO()        - Translates the structure to its ISO
//                   representation at the supplied byte pointer.
//  fromISO()      - Translates the structure from its ISO
//                   representation at the supplied byte pointer.
//
// USAGE NOTES:
//  attrLen() methods are used to grow or shrink this EA as well as the
//  Resource Fork data itself. !!! Is padding possible here? How? We
//  HAVE to propagate up access to more than one length. --
//  ImplUseLen() and EALen().?
// 
//----------------------------------------------------------------------
// COLLABORATORS:  
//  Contains a UDFEAPrefix field.
//
// PRIVATE METHODS:
//  init()
//    Initializes all data members which must not have a zero value.
//
//----------------------------------------------------------------------
class MacResourceForkEA 
{
    UDFEAPrefix   prefix_ ;

    void init(UINT32 dataLen);

public:

    MacResourceForkEA(UINT32 dataLen);

    UINT32 offsetToData(void) const {
        return prefix_.field_.after();
    }

    void dataLen(UINT32 len);
    UINT32 dataLen( void ) const ;
    
    Error error( void ) const ;

    UINT32 attrType() const { return prefix_.attrType(); }
    UINT8  attrSubtype() const { return prefix_.attrSubtype(); }
    String attrID() const { return UDFMacResourceForkID; }

    UINT32 minAttrLen( void ) const ;
    void attrLen( UINT32 len, Error & err ) ;
    UINT32 attrLen( void ) const ;

    void clear( void );
    void toISO( BYTE_PTR rbp );
    void fromISO( CONST_BYTE_PTR rbp );

#ifdef NSR_VERIFY
    Boolean operator != ( const MacResourceForkEA& obj ) const ;
    Error verifyISO( CONST_BYTE_PTR rbp ) const ;
#endif
    
};

#endif // _INCL_MAC_EATTRS_

#ifdef _INCL_NOVELL_EATTRS_
//----------------------------------------------------------------------
// Now, the Novell EAs.
//----------------------------------------------------------------------

//----------------------------------------------------------------------
// CLASS: NovellAttrFlags     --DVM
//
//  <terse_desc>
//  <long_desc_if_needed>
//
// PUBLIC DATA MEMBERS:
//  type   member   <descr>
//  type   member   <descr>
//
// PUBLIC METHODS:
//  methodName()
//      Description_of_method
//
// USAGE NOTES:
//  User notes go here.
// 
//----------------------------------------------------------------------
// COLLABORATORS:  
//  <collaborating_class> (e.g., OWNS: and/or USES:)
//
// PRIVATE METHODS:
//  methodName()
//      Description_of_method
//
// IMPLEMENTATION NOTES:
//  Internal Notes go here (special cases, algorithm issues, etc.)
//
//----------------------------------------------------------------------
class NovellAttrFlags {

  public:
    FieldInfo field_;
  protected:
    Bit8 copyInhibit_   ; // Mac only. Map to MacAttr?
    Bit8 indexed_       ;
    Bit8 purge_         ;
    Bit8 readAudit_     ;
    Bit8 renameInhibit_ ;
    Bit8 shareable_     ;
    Bit8 transactional_ ;
    Bit8 writeAudit_    ;

  public:

    NovellAttrFlags( UINT16 o );

    void markShareable() { shareable_ = 1; }
    Boolean isShareable() const { return shareable_ ? True : False; }

    void clear() ;
    void toISO( BYTE_PTR rbp ) ;
    void fromISO( CONST_BYTE_PTR rbp ) ;

#ifdef NSR_VERIFY
    Boolean operator != ( const NovellAttrFlags  & obj ) const ;
#endif
};

//----------------------------------------------------------------------
// CLASS: NovellAttrEA     --DVM
//
//  <terse_desc>
//  <long_desc_if_needed>
//
// PUBLIC DATA MEMBERS:
//  type   member   <descr>
//  type   member   <descr>
//
// PUBLIC METHODS:
//  attrType()    - Returns the value of the attrType field.
//  attrSubtype() - Returns the value of the attrSubtype field.
//  attrID()      - Returns the String identifying the Attr.
//  methodName()
//      Description_of_method
//
// USAGE NOTES:
//  User notes go here.
// 
//----------------------------------------------------------------------
// COLLABORATORS:  
//  <collaborating_class> (e.g., OWNS: and/or USES:)
//
// PRIVATE METHODS:
//  methodName()
//      Description_of_method
//
// IMPLEMENTATION NOTES:
//  Internal Notes go here (special cases, algorithm issues, etc.)
//
//----------------------------------------------------------------------
class NovellAttrEA {

    UDFEAPrefix     prefix_   ;
    NovellAttrFlags flags_    ;
    ZeroBytes       reserved_ ;

    void init();
  public:

    NovellAttrEA(void);

    Error error(void) const ;

    UINT32 attrType() const { return prefix_.attrType(); }
    UINT8  attrSubtype() const { return prefix_.attrSubtype(); }
    String attrID() const { return HPNovellAttrID; }

    UINT32 minAttrLen(void) const;
    void attrLen( UINT32 len, Error & err );
    UINT32 attrLen(void) const ;

    void markShareable(void) { flags_.markShareable(); }
    Boolean isShareable(void) const { return flags_.isShareable(); }

    void clear(void);
    void toISO( BYTE_PTR rbp );
    void fromISO( CONST_BYTE_PTR rbp );
#ifdef NSR_VERIFY
    Boolean operator != ( const NovellAttrEA& obj ) const ;
    Error verifyISO( CONST_BYTE_PTR rbp ) const;
#endif

};

#ifdef TRUSTEES
// Novell Trustee stuff, fields first... -------------------------

//----------------------------------------------------------------------
// CLASS: NovellRights     --DVM
//
//  <terse_desc>
//  <long_desc_if_needed>
//
// PUBLIC DATA MEMBERS:
//  type   member   <descr>
//  type   member   <descr>
//
// PUBLIC METHODS:
//  methodName()
//      Description_of_method
//
// USAGE NOTES:
//  User notes go here.
// 
//----------------------------------------------------------------------
// COLLABORATORS:  
//  <collaborating_class> (e.g., OWNS: and/or USES:)
//
// PRIVATE METHODS:
//  methodName()
//      Description_of_method
//
// IMPLEMENTATION NOTES:
//  Internal Notes go here (special cases, algorithm issues, etc.)
//
//----------------------------------------------------------------------
class NovellRights {

  public:
    FieldInfo field_;
  protected:
    Bit8      accessControl_ ;
    Bit8      fileScan_      ;
    Bit8      modify_        ;
    Bit8      erase_         ;
    Bit8      create_        ;
    Bit8      write_         ;
    Bit8      read_          ;
    Bit8      supervisory_   ;
    ZeroBytes reserved_      ;

  public:

    NovellRights( UINT16 o = 0 );

    void setInhRights( const NetwareTrusteeInfo::Inh_Rights & ir );
    NetwareTrusteeInfo::Inh_Rights getInhRights( ) const ;

    void setRights( const NetwareTrusteeInfo::Rights & r );
    NetwareTrusteeInfo::Rights getRights( ) const ;

    void clear() ;
    void toISO( BYTE_PTR rbp ) ;
    void fromISO( CONST_BYTE_PTR rbp ) ;

#ifdef NSR_VERIFY
    Boolean operator != ( const NovellRights  & obj ) const ;
#endif
};

//----------------------------------------------------------------------
// CLASS: NovellRightsAssign     --DVM
//
//  <terse_desc>
//  <long_desc_if_needed>
//
// PUBLIC DATA MEMBERS:
//  type   member   <descr>
//  type   member   <descr>
//
// PUBLIC METHODS:
//  methodName()
//      Description_of_method
//
// USAGE NOTES:
//  User notes go here.
// 
//----------------------------------------------------------------------
// COLLABORATORS:  
//  <collaborating_class> (e.g., OWNS: and/or USES:)
//
// PRIVATE METHODS:
//  methodName()
//      Description_of_method
//
// IMPLEMENTATION NOTES:
//  Internal Notes go here (special cases, algorithm issues, etc.)
//
//----------------------------------------------------------------------
class NovellRightsAssign {

  public:
    FieldInfo field_;           // Needed?
  protected:
    Uint32       user_   ;      // Better name for this?
    NovellRights rights_ ;

  public:

    NovellRightsAssign( UINT16 o = 0);

    void setAssignment( const NetwareTrusteeInfo::Assignment & a );
    NetwareTrusteeInfo::Assignment getAssignment( ) const ;

    void clear() ;
    void toISO( BYTE_PTR rbp ) ;
    void fromISO( CONST_BYTE_PTR rbp ) ;

#ifdef NSR_VERIFY
    Boolean operator != ( const NovellRightsAssign  & obj ) const ;
#endif
};

//----------------------------------------------------------------------
// CLASS: NovellRightsTable     --DVM
//
//  <terse_desc>
//  <long_desc_if_needed>
//
// PUBLIC DATA MEMBERS:
//  type   member   <descr>
//  type   member   <descr>
//
// PUBLIC METHODS:
//  methodName()
//      Description_of_method
//
// USAGE NOTES:
//  User notes go here.
// 
//----------------------------------------------------------------------
// COLLABORATORS:  
//  <collaborating_class> (e.g., OWNS: and/or USES:)
//
// PRIVATE METHODS:
//  methodName()
//      Description_of_method
//
// IMPLEMENTATION NOTES:
//  Internal Notes go here (special cases, algorithm issues, etc.)
//
//----------------------------------------------------------------------
class NovellRightsTable {

  public:
    FieldInfo field_;
  protected:
    UINT32               numEnts_;
    NovellRightsAssign   nullEntry_;
    NovellRightsAssign * entry_;

    void allocEnts( UINT32 n);
    void freeEnts() {
        delete [] entry_;
    }
  public:
    NovellRightsTable( UINT16 o, UINT32 ne ) ;
    virtual ~NovellRightsTable();

    // Cannot use const NTI, since it sets err on out of bounds.
    void setRightsTable( const NetwareTrusteeInfo & t ); 
    void getRightsTable( NetwareTrusteeInfo & t ) const ;

    UINT32 numEnts() const { return numEnts_; }
    NovellRightsAssign &operator[]( UINT32 i) ;
    const NovellRightsAssign &operator[]( UINT32 i) const ;

#ifdef NSR_VERIFY
    Boolean operator != ( const NovellRightsTable  & obj ) const ;
#endif

    Error error() const ;
    void clear() ;
    void fitEnts( UINT32 ne ) ;
    void toISO( BYTE_PTR rbp ) ;
    void fromISO( CONST_BYTE_PTR rbp ) ;
};

// Now for the NovellTrueteeEA itself...
    
//----------------------------------------------------------------------
// CLASS: NovellTrusteeEA     --DVM
//
//  <terse_desc>
//  <long_desc_if_needed>
//
// PUBLIC DATA MEMBERS:
//  type   member   <descr>
//  type   member   <descr>
//
// PUBLIC METHODS:
//  attrType()    - Returns the value of the attrType field.
//  attrSubtype() - Returns the value of the attrSubtype field.
//  attrID()      - Returns the String identifying the Attr.
//
// USAGE NOTES:
//  User notes go here.
// 
//----------------------------------------------------------------------
// COLLABORATORS:  
//  <collaborating_class> (e.g., OWNS: and/or USES:)
//
// PRIVATE METHODS:
//  methodName()
//      Description_of_method
//
// IMPLEMENTATION NOTES:
//  Internal Notes go here (special cases, algorithm issues, etc.)
//
//----------------------------------------------------------------------
class NovellTrusteeEA {
    UDFEAPrefix       prefix_           ;
    ZeroBytes         reserved_         ; // To make it  mult of 4 bytes
    NovellRights      inhRightsMask_    ;
    Uint32            rightsTableCount_ ; // ??? needed ???
    NovellRightsTable rightsTable_      ;

    void init();
  public:

    NovellTrusteeEA( UINT32 n = 1 );

    Error error( void ) const ;

    UINT32 attrType( void ) const { return prefix_.attrType(); }
    UINT8  attrSubtype( void ) const { return prefix_.attrSubtype(); }
    String attrID( void ) const { return HPNovellTrusteeID; }

    UINT32 minAttrLen( void ) const ;
    void attrLen( UINT32 len, Error & err );
    UINT32 attrLen( void ) const ;

    // Cannot use const NTI, since it sets err on out of bounds.
    void setTrusteeInfo( const NetwareTrusteeInfo & t );
    void getTrusteeInfo( NetwareTrusteeInfo & t ) const ;

    const NovellRightsTable & rightsTable() const { return rightsTable_; }
    NovellRightsTable & rightsTable() { return rightsTable_; }

    void clear( void );
    void toISO( BYTE_PTR rbp );
    void fromISO( CONST_BYTE_PTR rbp );
#ifdef NSR_VERIFY
    Boolean operator != ( const NovellTrusteeEA& obj ) const ;
    Error verifyISO( CONST_BYTE_PTR rbp ) const;
#endif

};
#endif // TRUSTEES
#endif //_INCL_NOVELL_EATTRS_

#ifdef _INCL_ICBTABLE_EATTR_
//----------------------------------------------------------------------
//   ICB Table Stuff
//----------------------------------------------------------------------

//----------------------------------------------------------------------
// CLASS: ICBTableEA     --DVM
//
//  Extended Attribute used by HP's Archive Object for holding the ICB
//  Table.
//
// PUBLIC METHODS:
//  error()       - Returns any state errors. Should be called after
//                  construction and after any fromISO() or toISO().
//  attrType()    - Returns the value of the attrType field.
//  attrSubtype() - Returns the value of the attrSubtype field.
//  attrID()      - Returns the String identifying the Attr.
//  minAttrLen()  - Returns the minimum size the EA may be set to.
//  attrLen()     - Gets or sets the EA to the supplied length. If
//                  the new value is too short or disallowed for some
//                  reason, it returns an error indicating that.
//  icbTbl()      - returns a pointer to the C-array of longADs.
//  numEnts()     - returns the number of ADs in the ICBTable
//  clear()       - Sets the state to the exact same as right after 
//                  construction. All fields are initialized to
//                  defaults and/or zeroes.
//  toISO()       - Translates the structure to its ISO representation
//                  at the supplied byte pointer.
//  fromISO()     - Translates the structure from its ISO
//                  representation at the supplied byte pointer.
//  operator!=()  - Returns False if all fields are the same;
//                  otherwise return True.
//  verifyISO()   - Returns a non-zero error if the ISO image at the
//                  supplied byte pointer location does not match the
//                  current state of the object.
//
// USAGE NOTES:
//  Refer to the source code of the Archive object for an example.
// 
//----------------------------------------------------------------------
// COLLABORATORS:  
//  Contains UDFEAPrefix, ADTable.
//
// PRIVATE METHODS:
//  init()       - called by clear() to set all fields which should be
//                 non-zero.
//
// IMPLEMENTATION NOTES:
//  Internal Notes go here (special cases, algorithm issues, etc.)
//
//----------------------------------------------------------------------
class ICBTableEA {

    ImplEAPrefix prefix_         ;
    Uint32       hpEAType_       ; // See enum HPEAType
    Uint32       icbTableLength_ ; // From department of redundancy
                                   // department.
    ADTable      icbTable_       ;

    void init(void);

  public:

    ICBTableEA( UINT16 n );

    Error error(void) const ;

    UINT32 attrType() const { return prefix_.attrType(); }
    UINT8  attrSubtype() const { return prefix_.attrSubtype(); }
    String attrID() const { return prefix_.id(); }

    UINT32 minAttrLen(void) const ;
    void attrLen( UINT32 len, Error & err ) ;
    UINT32 attrLen(void) const ;

    LongAllocDesc * icbTbl(void) { return ( icbTable_.longADp() ); }
    UINT16 numEnts(void) const { return ( icbTable_.numADs() ); }

    void clear(void);
    void toISO( BYTE_PTR rbp );
    void fromISO( CONST_BYTE_PTR rbp );
#ifdef NSR_VERIFY
    Boolean operator != ( const ICBTableEA& obj ) const ;
    Error verifyISO( CONST_BYTE_PTR rbp ) const;
#endif // NSR_VERIFY

};
#endif // _INCL_ICBTABLE_EATTR_

//----------------------------------------------------------------------
// CLASS: EAInspector     --DVM
//
//  This decodes Extended Attributes, and provides information about
//  them in such a way that they may be identified and padded without
//  having to instantiate specific descriptors for each one.
//
//  Each EA is viewed by the EAInspector in the following way:
//
//   ----------------------------------------------------------
//  |                |                        |                |
//   ----------------------------------------------------------
//  |<-- fixedLen -->|<---- varyingLen ------>|                |
//  |<------------- minAttrLen -------------->|                |
//  |<----------------------- attrLen ------------------------>|
//  
//  The fixedLen does not vary between instances of a given Extended
//  Attribute. The varyingLen may vary between instances, but holds
//  some of the information in the Extended Attribute. The sum of the
//  fixedLen and varyingLen is the length of the information inside
//  the Extended Attribute, and drives the definition of the
//  minAttrLen. The attrLen is the length of the attribute plus all
//  padding.
//
//  Note that the fixedLen and varyingLen distinction are needed in
//  order to calculate the minAttrLen, and are not needed for padding
//  or identification. They are provided in case they are of use for
//  debugging purposes.
//  
// PUBLIC METHODS:
//  error()       - Returns any state errors. Should be called after
//                  construction and after any fromISO().
//  attrType()    - Returns the value of the attrType field.
//  attrSubtype() - Returns the value of the attrSubtype field.
//  attrID()      - Returns the String identifying the Attr.
//  AttrLen()     - Returns the current length of the EA.
//  minAttrLen()  - Returns the minimum length the EA may be set
//                  to. NOTE  that this is broken down into the
//                  varying and fixed components, listed below, but is
//                  also guaranteed to be a multiple of four bytes, in
//                  order to meet the UDF requirements.
//  varyingLen()  - Returns the number of bytes in the
//                  variable-length field of the EA, if any.
//  fixedLen()    - Returns the non-changing length associated with
//                  the EA.
//  fromISO()     - Translates the structure from its ISO
//                  representation at the supplied byte pointer.
//
// USAGE NOTES:
//  User notes go here.
// 
//----------------------------------------------------------------------
// COLLABORATORS:  
//  This is used with the EARegistry.
//  It contains an EAPrefix field.
//  It contains a Uint32 field.
//  It contains an OSTARegID field.
//
// PRIVATE METHODS:
//  clear()        - Sets the state to the exact same as right after 
//                   construction.
//
// IMPLEMENTATION NOTES:
//  Internal Notes go here (special cases, algorithm issues, etc.)
//
//----------------------------------------------------------------------
class EAInspector 
{
    // The fields first
    UDFEAPrefix  eaPrefix_   ;
    Uint32       varyingLen_ ;
    ImplRegID    attrID_     ;

    // Non-field data member
    UINT32       fixedLen_   ;

    void clear( void );

public:

    EAInspector( void );

    Error error( void ) const ;

    UINT32 attrType( void )    const { return eaPrefix_.attrType(); }
    UINT8  attrSubtype( void ) const { return eaPrefix_.attrSubtype(); }
    String attrID( void )      const { return attrID_.id(); }
    UINT32 attrLen( void )     const { return eaPrefix_.attrLen(); }
    UINT32 varyingLen( void )  const { return varyingLen_; }
    UINT32 fixedLen( void )    const { return fixedLen_; }
    UINT32 minAttrLen( void )  const
    {
        return ((((varyingLen_ + fixedLen_) + 3) / 4) * 4);
    }

    void fromISO( CONST_BYTE_PTR rbp );
};

//----------------------------------------------------------------------
// ENUM: HPEAType
//
//  The different types of HP-defined implementation-use EAs.
//
// DEFINITIONS:
//  hpea_ICBTable  The ICB Table used in the Archive object.
//
// USES:
//  This is used inside of the ImplUseEAs.
//
// NOTES:
//  Not very many defined yet.
//
//----------------------------------------------------------------------
// Private comments go here - will not be extracted into HTML.
//----------------------------------------------------------------------
enum HPEAType {
    hpea_ICBTable  = 1,
};

//----------------------------------------------------------------------
// ENUM: SupportedEAType
//
//  Different EAs. Used by the SearchEA -- NOT on-disk constants. Each
//  represents a different ExtendedAttribute.
//
// DEFINITIONS:
// (ISO-defined)
//  sea_CharSetInfo
//  sea_AlternatePerms
//  sea_FileTimes
//  sea_InfoTimes
//  sea_DeviceSpec
//  sea_ImplementUse
//  sea_ApplicationUse
// (UDF EAs common to all OSes)
//  sea_UDFFreeEASpace
// (OS/2 EAs)
//  sea_UDFOS2EALength
// (Official Mac EAs)
//  sea_UDFMacVolumeInfo
//  sea_UDFMacFinderInfo
//  sea_UDFMacUniqueIDTable
//  sea_UDFMacResourceFork
// (HP-proposed Novell EAs)
//  sea_HPNovellAttr
//  sea_HPNovellTrustee
// (HP-proprietary Archive EAs)
//  sea_HPICBTable
// (else)
//  sea_Unknown
//
// USES:
//  Used with the SearchEA.
//
// NOTES:
//  optional
//
//----------------------------------------------------------------------
// Private comments go here - will not be extracted into HTML.
//----------------------------------------------------------------------
enum SupportedEAType {

    // First, the official ISO Types:

    sea_CharSetInfo          = 0,
    sea_AlternatePerms       ,
    sea_FileTimes            ,
    sea_InfoTimes            ,
    sea_DeviceSpec           ,
    sea_ImplementUse         ,
    sea_ApplicationUse       ,

    // Then, UDF common EAs (all implementation use)

    sea_UDFFreeEASpace      = 1000,
    
    // Official OS/2 EAs

    sea_UDFOS2              = 1100,
    sea_UDFOS2EALength      ,

    // Official Mac EAs

    sea_UDFMacVolumeInfo    = 1200,
    sea_UDFMacFinderInfo    ,
    sea_UDFMacUniqueIDTable ,
    sea_UDFMacResourceFork  ,

    // HP-proposed Novell EAs

    sea_HPNovellAttr       = 1300,
    sea_HPNovellTrustee    ,

    // HP-proprietary Archive EAs

    sea_HPICBTable         = 10000,
    sea_HPOther            = 10001,

    sea_Unknown              = -1
};

//----------------------------------------------------------------------
// CLASS: SearchEA     --DVM
//
//  This is the OLD method of searching through EAs and grabbing as
//  much information about them as possible. It is recommended that
//  the EAInspector object be used instead.
//
//  NOTE that this does more checking for validity than the
//  EAInspector, but it is also more closed, and less friendly to
//  future EAs (UDF EAs especially).
//
// PUBLIC METHODS:
//
// USAGE NOTES:
//  User notes go here.
// 
//----------------------------------------------------------------------
// COLLABORATORS:  
//  <collaborating_class> (e.g., OWNS: and/or USES:)
//
// PRIVATE METHODS:
//  methodName()
//      Description_of_method
//
// IMPLEMENTATION NOTES:
//  Internal Notes go here (special cases, algorithm issues, etc.)
//
//----------------------------------------------------------------------
class SearchEA {

    EAPrefix     eaPrefix_     ; // These should overlap each other.
    ImplEAPrefix impleaPrefix_ ; // These should overlap each other.
    UDFEAPrefix  udfeaPrefix_  ; // These should overlap each other.
    Uint32       hpEAType_     ; // This follows the ImplEAPrefix_.
    
  public:

    SearchEA();

    void fromISO( CONST_BYTE_PTR rbp );

    Error error( CONST_BYTE_PTR rbp ) const ;
    
    UINT32 attrLen() const { return eaPrefix_.attrLen(); }
    SupportedEAType eaType() const ;
    String id() const ;

};

#endif
