Joseph J. Strout schrieb:
At 4:44 PM +0200 4/19/06, Tom wrote:

Agreed. Still I think it should be possible to cast the value one time in the enum and not every time I use the enum.

Hmm, doesn't seem to me that it is still an enum then. You're counting on these enums having particular integer values; so you should simply be using integer constants instead of enums. Enums, properly used, don't even need to HAVE any integer values -- they're just unique, opaque identifiers within a set.

Well, perhaps I need to write how I use the enums here...

From "Apple Filing Protocol Programming Guide":"Apple Filing Protocol Data Types":"Directory Bitmap":
enum {
   kFPAttributeBit = 0x1,
   kFPParentDirIDBit = 0x2,
   kFPCreateDateBit = 0x4,
   kFPModDateBit = 0x8,
   kFPBackupDateBit = 0x10,
   kFPFinderInfoBit = 0x20,
   kFPLongNameBit = 0x40,
   kFPShortNameBit = 0x80,
   kFPNodeIDBit = 0x100,
   kFPOffspringCountBit = 0x0200,
   kFPOwnerIDBit = 0x0400,
   kFPGroupIDBit = 0x0800,
   kFPAccessRightsBit = 0x1000,
   kFPProDOSInfoBit = 0x2000 // AFP version 2.2 and earlier
   kFPUTF8NameBit = 0x2000, // AFP version 3.0 and later
   kFPUnixPrivsBit = 0x8000 // AFP version 3.0 and later
};

So I want to use these constants in code. To have no huge "k..." name space I have a Module where I want to use enums via "public access".
So I want to call here e.g. MyModule.DirectoryBitmapConstants.kFPLongNameBit

When I want to use this in the Bitwise operator I need to cast.

I think the usage as shown above should be supported without casting.

Comments please.

Cheers,

Tom
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to