Re: NSHFSTypeCodeFromFileType troubles
Re: NSHFSTypeCodeFromFileType troubles
- Subject: Re: NSHFSTypeCodeFromFileType troubles
- From: "David W. Halliday" <email@hidden>
- Date: Thu, 07 Mar 2002 14:56:34 -0600
- Organization: TNRCC
Chris Gervais wrote:
>
Ah...I didn't even think to include the single quote as I thought that
>
NSHFSTypeCodeFromFileType just took the string as it was...the doc needs to
>
be more clear on this!
>
>
> Well OSTypes are just a 4 characters string const, like 'JPEG'.
>
>
>
> An file type right now for an HFSfile type(OSType) is encode like
>
> @"'JPEG'",
>
> note the single quotes this is important.
>
>
>
> Thanks,
>
> Andrew Pinski
>
>
>
> ...
One caveat: The present form of the encoding of HFS file types into NSStrings
is an /implementation detail/ and, hence, cannot be relied upon for all time.
Unfortunately, other than directly creating OSTypes, via 'ostp' (Apple added an
extension to gcc to allow for these special cases of the character quote---one of
the extensions that, presumably, will /never/ make it into the mainstream) there is
no function to create such OSTypes from strings (though one would be easy enough to
code, and would not have the dependency on the implementation of
NSHFSTypeCodeFromFileType, nor the Apple extension to gcc).
email@hidden
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.